Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions lib/internal/cluster/child.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,14 @@ function _disconnect(primaryInitiated) {
}
}

handles.forEach((handle) => {
for (const handle of handles.values()) {
waitingCount++;

if (handle[owner_symbol])
handle[owner_symbol].close(checkWaitingCount);
else
handle.close(checkWaitingCount);
});
}

handles.clear();
checkWaitingCount();
Expand Down
5 changes: 3 additions & 2 deletions lib/internal/cluster/primary.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ function removeWorker(worker) {
function removeHandlesForWorker(worker) {
assert(worker);

handles.forEach((handle, key) => {
// eslint-disable-next-line node-core/no-array-destructuring
for (const [key, handle] of handles) {
Comment thread
jerome-benoit marked this conversation as resolved.
Resolved
if (handle.remove(worker))
handles.delete(key);
});
}
}

cluster.fork = function(env) {
Expand Down