peerigon / phridge

A bridge between node and PhantomJS
The Unlicense
519 stars 50 forks source link

PhantomJS process hanging in some cases #18

Closed backflip closed 9 years ago

backflip commented 9 years ago

We are using phridge as a dependency of https://github.com/Otouto/gulp-raster

At some point, we discovered that ps aux was listing lots of hanging processes on our Jenkins instance although no gulp task was running anymore:

jenkins  20650  0.0  0.6 1293792 25160 ?       Sl   Sep12   0:00 /var/lib/jenkins/workspace/node_modules/gulp-raster/node_modules/phridge/node_modules/phantomjs/lib/phantom/bin/phantomjs

Do you have any idea why this would happen? Is there a possible workaround (e.g. specifying a timeout for PhantomJS processes)?

jhnns commented 9 years ago

Mhmm ... I have no idea. Sometimes I had the same issue on windows, but it was always related to node not exiting cleanly.

You could try to wrap phantom.exit(0) here in a setTimeout with some arbitrary delay. That's just a wild guess, but it helped to solve these issues in a previous version of phridge (when I was using another way to communicate with PhantomJS).

Could you try that and tell me if it worked for you? I'm currently on holiday, so don't expect an immediate answer :grinning:

backflip commented 9 years ago

Thanks! I will re-open if I discover anything.

jhnns commented 9 years ago

Ok thx. Unfortunately I can't confirm this problem with my setup.