sheebz / phantom-proxy

a lightweight proxy that lets you to drive phantomjs from node.
MIT License
137 stars 33 forks source link

Why is the exit handler commented out? #38

Open kevzettler opened 11 years ago

kevzettler commented 11 years ago

Why is this commented out?

https://github.com/sheebz/phantom-proxy/blob/master/lib/proxy.js#L81

I believe this is causing zombie phantomjs processes to pile up and requires a killall

sheebz commented 11 years ago

Ive switched this code back and forth a few times. There is a performance advantage to keeping the server up - no startup cost if server is already up. On the other hand you have to call exit or you'll get zombies like you said. Can you make sure your code is calling exit and waiting for callback to complete?

sheebz commented 11 years ago

Maybe we should close all processes by default, then provide an option to keep open?

kevzettler commented 11 years ago

I think the most natural and expected behavior is to close the phantomjs process by default. I find that leaving it open the phantom-proxy dosen't always reconnect and spins up additional processes. Phantomjs will also crash and have strange behavior with multiple instances running.