Child Processes in Node 0.8 'exit' prematurely

Due to a recent change in the API, a lot of existing code based around spawning child processes will break. The change is explained on the Node Github Wiki:

  • the'exit'event is now emitted right after the child process exits. It no longer waits for all stdio pipes to be closed.
  • the'close'event was added that has is emitted after the child has exitedandall the stdio pipes are closed.

Most spawned processes wait for the ‘exit’ event, and should now listen for the 'close’ event. This is a gotcha that burned me with the node.gzip library.

Happy noding!