You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
worker.exitedAfterDisconnect is false, after the worker process has exited using process.exit() #28837
changed the title [-]worker.exitedAfterDisconnect is false, after the worker process has exited on its own[/-][+]worker.exitedAfterDisconnect is false, after the worker process has exited using process.exit()[/+]on Jul 24, 2019
Set by calling .kill() or .disconnect(). Until then, it is undefined.
The behaviour you describe is exactly what is documented. Neither kill() or disconnect() was called in your situation, the worker called exit(), so exitedAfterDisconnect is false.
It's repeatedly normalized from truthy/falsy to true/false: worker.exitedAfterDisconnect = !!worker.exitedAfterDisconnect. I'm not sure about the history of this. Can you troll the git history to see why this occurs?
I strongly suspect current behaviour is an improvement, but the docs need updating.
Also, I wonder, is the initial value false? If not, it probably should be.
Yeah I checked out the git history to this PR #3743
Here .suicide was replaced by .exitedAfterDisconnect but the truthy/falsy to true/false was retained and documentation was updated too but not anything about false. truth/false seems suicide behaviour.
Yeah, it was an improvement over .suicide
IMO docs and the code both need an update, it should be true or false, and the change reflected in the docs. If you approve I can create a PR for the fix of this.
Version: 10.16.0
Platform: 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64
Call process.exit() in worker/child, in master log the value after any worker exit