Skip to content

Commit 7dae5d7

Browse files
committed
cluster: defer errno propagation to nextTick
This change allows to remove the errno message from the read buffer of the IPC channel in the event an exception is thrown and then catched when processing the message. Without this change, the message will be handled multiple times.
1 parent 7c3e920 commit 7dae5d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/cluster.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,9 @@ function workerInit() {
617617
// Round-robin. Master distributes handles across workers.
618618
function rr(message, cb) {
619619
if (message.errno)
620-
return cb(message.errno, null);
620+
return process.nextTick(function() {
621+
cb(message.errno, null);
622+
});
621623

622624
var key = message.key;
623625
function listen(backlog) {

0 commit comments

Comments
 (0)