You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running Node.js in EC2 instance, and sometimes while restarting the EC2, I am getting an EADDRINUSE error. I am using cluster.fork() to fork the process on the number of CPUs.
The main problem in my use case is, I am not able to replicate this scenario locally. This is coming very frequently in EC2 when auto-deployment happens.
Can someone help me understand what is causing the issue here?
I am suspecting that cluster.fork() is creating the problem.
PS: I know this error comes when the port is already occupied and we can manually kill the process using the command. but that solution will not work here. When we deploy, we get a new instance hence and we check the port availability so chances are very very less that port is already occupied by some other service.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am running Node.js in EC2 instance, and sometimes while restarting the EC2, I am getting an
EADDRINUSE
error. I am usingcluster.fork()
to fork the process on the number of CPUs.The main problem in my use case is, I am not able to replicate this scenario locally. This is coming very frequently in EC2 when auto-deployment happens.
Can someone help me understand what is causing the issue here?
I am suspecting that
cluster.fork()
is creating the problem.Code:
PS: I know this error comes when the port is already occupied and we can manually kill the process using the command. but that solution will not work here. When we deploy, we get a new instance hence and we check the port availability so chances are very very less that port is already occupied by some other service.
Beta Was this translation helpful? Give feedback.
All reactions