Cluster crash in main process, callback undefined when handling internal messages #3072
Closed
Description
Found this issue in production on 4.1.1:
The main process crashed with this stack trace:
TypeError: Cannot read property 'apply' of undefined
at ChildProcess.<anonymous> (cluster.js:710:7)
at emitTwo (events.js:92:20)
at ChildProcess.emit (events.js:172:7)
at handleMessage (internal/child_process.js:685:10)
at Pipe.channel.onread (internal/child_process.js:440:11)
I am unable to create a reproducible test case, and we can only get this error to occur at scale. Works in v2.3.3, the previous version we were using.
My take on this: if you look at the error line, this can only happen if cb
was undefined, or if there is no entry in callbacks
for message.ack
. The first case is not possible as cb
is always onmessage
. So that leaves the second case. One idea is that a message somehow gets duplicated (maybe a bug in libuv?), which would guarantee that there be no entry in callbacks
as line 708 would delete the entry the first time the message was received.
Activity