Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

[cluster.js] removeHandlesForWorker() on both 'exit' and 'disconnect' events. #9418

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,14 @@ function masterInit() {
}

worker.process.once('exit', function(exitCode, signalCode) {
/*
* Remove the handles associated with this
* worker a second time just in case 'disconnect'
* event isn't emitted.
*/
if (worker.state != 'disconnected')
removeHandlesForWorker(worker);

/*
* Remove the worker from the workers list only
* if it has disconnected, otherwise we might
Expand Down