Closed SystemParadox closed 9 years ago
After further investigation it appears that this is caused by the shell sending the SIGINT to the whole process group, which means both node and phantomJS. So phridge tries to tell phantomJS to exit and gets an EPIPE error (from child.stdin
) because it's already gone.
Using kill -SIGINT
to send the SIGINT directly to node works as expected.
To fix this I would suggest that phridge needs to catch EPIPE errors and mark that child as destroyed.
Maybe the epipebomb module will come in useful here.
Should be no problem now
test program:
output:
Change
SIGINT
toSIGTERM
, use a timeout or anything else to trigger the shutdown and it works fine. Maybe SIGINT closes stdin/stdout?Interestingly it also works if I do
process.emit('SIGINT')
.I am using Linux (bash).
Thanks.