Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f152adf

Browse filesBrowse files
cjihrigMyles Borins
authored andcommitted
cluster: close ownerless handles on disconnect()
When a worker is disconnecting, it shuts down all of the handles it is waiting on. It is possible that a handle does not have an owner, which causes a crash. This commit closes such handles without accessing the missing owner. Fixes: #6561 PR-URL: #6909 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
1 parent c0a42bc commit f152adf
Copy full SHA for f152adf

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Collapse file

‎lib/cluster.js‎

Copy file name to clipboardExpand all lines: lib/cluster.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,11 @@ function workerInit() {
703703
const handle = handles[key];
704704
delete handles[key];
705705
waitingCount++;
706-
handle.owner.close(checkWaitingCount);
706+
707+
if (handle.owner)
708+
handle.owner.close(checkWaitingCount);
709+
else
710+
handle.close(checkWaitingCount);
707711
}
708712

709713
checkWaitingCount();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.