Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When calling exit(), added call to phantom.kill() #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

When calling exit(), added call to phantom.kill() #25

wants to merge 1 commit into from

Conversation

ryanone
Copy link

@ryanone ryanone commented Dec 20, 2012

Calling exit() doesn't terminate the spawned process. So I added a call to phantom.kill() to do the trick.

Fixes #24

@AndrewRayCode
Copy link
Contributor

oh thank god. that explains why phantom never dies for me.

@alexscheelmeyer
Copy link
Owner

This does not work for me. Normally all PhantomJS instances exit correctly for me, but if I include this they stop exiting. Which platform are you on?

@ryanone
Copy link
Author

ryanone commented Jan 11, 2013

Thanks for responding, Alex.

I'm on RHEL6.

@delvarworld - How about you?

@ndrut
Copy link

ndrut commented Jan 16, 2013

CentOS 6(RHEL 6) here -- Same issue. But, I assumed it was because I haven't figured out how to add a timeout to the phantom object.

@sandinmyjoints
Copy link

I see this, too: Phantom never dies. On OS X, using 1.8.1.

@kaareal
Copy link

kaareal commented Mar 26, 2013

Also using 1.8.1 on osx

@eddloschi
Copy link

This line fixes phantom process not exiting for me

  • Arch Linux Kernel 3.8.4
  • PhantomJS 1.9.0
  • Node.js 0.10.2

@kaareal
Copy link

kaareal commented Apr 24, 2013

I think one need to wait for the kill event to be send.
I resolved this by waiting a bit before exiting the script.

@potmo
Copy link

potmo commented Jul 4, 2013

having the same problem on
osx 10.7.5
phantomjs 1.9.0
Node 0.8.10

The instances are draining a lot of cpu as well from what I can see in
top -o cpu

Its the bridge.js that has started them from what I can see with
ps aux | grep phantom

@potmo
Copy link

potmo commented Jul 4, 2013

The fix doesn't work for me. I think I get a script error in phantom that crashes phantom silently. The phantom-process is never killed

@AlexGilleran
Copy link

Whew, just spent hours wondering why I was spawning off phantomjs zombie processes. Fix works for me - I can't modify the node-phantom code so I'm working around it by using:

ph.exit();
ph._phantom.kill('SIGTERM');

@thisispete
Copy link

shouldn't the right place to put this be line 141: ?

case 'phantomExited':
                            request(socket,[0,'exitAck']);
                            server.close();
                            io.set('client store expiration', 0);
                            cmds[cmdId].cb();
                            phantom.kill('SIGTERM');
                            delete cmds[cmdId];
                            break;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling ph.exit() doesn't terminate spawned process
10 participants