-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[Cluster] AssertionError: Resource leak detected. #9409
Comments
I think i have the same issue
|
@hertzg Do you, by any chance, have a |
@jshkurti I'm using |
Hey @hertzg , I did a Pull Request to fix this (which actually works) : #9418 But until it's accepted and merged I have found a work around. function workAround(worker) {
var listeners = null;
listeners = worker.process.listeners('exit')[0];
var exit = listeners[Object.keys(listeners)[0]];
listeners = worker.process.listeners('disconnect')[0];
var disconnect = listeners[Object.keys(listeners)[0]];
worker.process.removeListener('exit', exit);
worker.process.once('exit', function(exitCode, signalCode) {
if (worker.state != 'disconnected')
disconnect();
exit(exitCode, signalCode);
});
} Works like a charm ;) |
@jshkurti I'm unable to reproduce this issue again but will keep that in mind. Thanks |
@jshkurti THX! - happened to me with a simple test script on ARM. It happens when a worker terminates (in my case there was an Error in the http request handler). |
We ran into this with one of our servers last night :( Is this fixed in v4.0.0? |
@Splaktar I had the same error today on a machine running v4.0.0 |
Add initWorker() to server which should clean up worker resources on both disconnect and exit. Reference nodejs/node-v0.x-archive#9409 Update JSHint for server and fix some issues including removing unused requires. Add key entries for frisbee keys. Remove some newRelic cruft. Fixes #54.
Is anybody knows how to reproduce such a bug "in vitro"? Is it still actual for node 4.1.1? |
I can confirm this error is still happening for me on spinning down my cluster.
I am going to try implementing this workaround into https://www.npmjs.com/package/infant and see if that works. |
I implemented this fix into Infant 0.10.0 it seems to be working for me I have yet to see this error appear again. I will keep an eye on this issue and if this gets resolved upstream I will update accordingly. |
Workaround is works, but in production it's provokes the cluster stuck. |
It looks like nodejs/node#3510 fixes the issue. |
Great! Looking forward to it getting into a release. |
Hello guys.
I'm doing some intensive use of cluster module and I'm still getting this error sometimes (nodejs v0.12.0).
I can see that it happens when there is still some handles left after all workers are deleted.
https://github.com/joyent/node/blob/master/lib/cluster.js#L347-L348
I also noticed that you call
removeHandlesForWorker()
only on 'disconnect' event, not on 'exit'.https://github.com/joyent/node/blob/master/lib/cluster.js#L382
Is it possible that 'exit' event could be fired before 'disconnect' and thus be the reason for this bug to happen ?
Is this a Node.js bug or am I misusing the cluster module at some point ?
If so, what scenario could possibly trigger this bug ? Could you show me a sample code which intentionally triggers this exception ?
Thanks a lot.
The text was updated successfully, but these errors were encountered: