alexscheelmeyer / node-phantom

bridge to PhantomJS from Node.js
317 stars 117 forks source link

Handling PhantomJS crash. #36

Closed MrOrz closed 11 years ago

MrOrz commented 11 years ago

I have encountered several PhantomJS crashes.

The crash causes aborted children processes and the corresponding http server is never closed. This blocks the script from exiting normally.

In commit #2038394 The phantom process's exit event is handled. Though there exists another process exit event handler (in module.exports.create), but it was meant for detecting spawning failure. Therefore I added my own exit event handler in the callback of the spawnPhantom method.

In commit #f6fec47 I expose the child process's on method to the phantom proxy, enabling the developers to handle the child process events.

ChrisCinelli commented 11 years ago

This should be merged!

sunki commented 11 years ago

Thanks a lot for the commit, it works.

alexscheelmeyer commented 11 years ago

Thanks for this!