-
Notifications
You must be signed in to change notification settings - Fork 44
Orphaned phantomjs processes #33
Comments
This is closely related to #34 and #35, I guess. Let me sort that out: SIGTERMIt should be possible to exit cleanly with
Uncaught exceptionYou should probably listen on I guess it heavily depends on the OS you're using. Some OS will automatically kill child processes, some won't. If your OS does not kill child processes, you'll responsible to shut them down. From phridge's perspective, it is not possible to shutdown child processes synchronously because we're just using the stdin stream which is asynchronous in node. |
Could you checkout the current master? I'm explicitly killing the childProcess now if something goes wrong. This should leave no orphans.... |
Is this still an issue with |
I've been running this for a while and it seems to be ok :) Thanks very much |
Hi. This might just be a documentation issue, but I am not clear how to correctly cleanup the phantomJS processes when node exits either due to a
SIGTERM
or an uncaught exception.At the moment we are getting a collection of orphaned phantomJS processes which grows whenever we restart node.
The documentation specifically states that it is not safe to call
phantom.disposeAll()
fromprocess.on('exit')
because it is async. But when an exception occurs, or when the node process is being terminated (i.e. by a supervisor), the only way to reliably cleanup is to useprocess.on('exit')
and do it synchronously.How should I best deal with this? Maybe we need a
phridge.killAll()
? Although, shouldn't it be phridge's responsibility to ensure that any child processes it created are definitely cleaned up when node exits?Thanks.
The text was updated successfully, but these errors were encountered: