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
if we set up pm2 to resurrect on failure, this causes the unexpected resurrection of the killed/deleted/stopped processes.
Based on this thread I think it is related to a synchronization error when multiple processes are closed at once. I was also able to delete the processes one by one without any problem.
I could mitigate the error adding a callback to handle the exception:
cluster.on("exit",(worker)=>{// notify all active workersfor(constworkerIdincluster.workers){if(hasOwnProperty.call(cluster.workers,workerId)){cluster.workers[workerId].send({source: MESSAGE_SOURCE,type: EventType.WORKER_EXIT,data: worker.id,},(err)=>{if(err){if(err.code=='ERR_IPC_CHANNEL_CLOSED'||err.code=='EPIPE'){console.warn(`There was a synchronization problem. Wrong attempt to send a message to a disconnected worker`)console.log(err);}else{throwerr;}}});}}});
The text was updated successfully, but these errors were encountered:
RolandoAndrade
changed the title
ERR_IPC_CHANNEL_CLOSED and EPIPE errors on exit event c
ERR_IPC_CHANNEL_CLOSED and EPIPE errors on exit event
Oct 7, 2022
Hey! Nice work! I found an issue when I try to run a process in cluster mode using this library.
Description
When I run a process in cluster mode using the
@socket.io/pm2
library and I try to delete them usingpm2 delete all
I get the following errors:It seems on exit it is trying to send the
WORKER_EXIT
message to disconnected workers.socket.io-cluster-adapter/lib/index.ts
Lines 579 to 590 in 43f9ee8
if we set up pm2 to resurrect on failure, this causes the unexpected resurrection of the killed/deleted/stopped processes.
Based on this thread I think it is related to a synchronization error when multiple processes are closed at once. I was also able to delete the processes one by one without any problem.
I could mitigate the error adding a callback to handle the exception:
Steps to reproduce
pm2
and install@socket.io/pm2
After doing this, you will see the exceptions.
Env details
The text was updated successfully, but these errors were encountered: