Closed nkouevda closed 11 years ago
Thanks @nkouevda !
I just tested your pull request. Unfortunately it results in stopping the phantomjs process and not starting a new one.
I believe, that the rasterizer.on('exit', ...)
event never get's called in this case.
Removing the second startService
will result in the same problem.
@HaNdTriX How did you test this? I can't reproduce the behavior you've detailed.
@HaNdTriX I still haven't been able to reproduce what you said, but I've changed my fix anyway. Instead of removing startService
from restartService
, killService
removes the exit handler before killing the rasterizer. This way, killService
actually kills the rasterizer (in the past, it would've restarted itself), and in the case that it fails to do so, restartService
will still start a new rasterizer.
@nkouevda thanks! Works for me!
Thanks!
Hello,
It seems there are still some issues with the restartService. Here is my log :+1:
Request for http://www.mongohq.com/home - Rasterizing it Sending image in response phantomjs error: PhantomJS has crashed. Please read the crash reporting guide at https://github.com/ariya/phantomjs/wiki/Crash-Reporting and file a bug report at https://github.com/ariya/phantomjs/issues/new with the crash dump file attached: /tmp/1f5b12b4-4aaf-bdca-5429b03e-06acd95d.dmp
phantomjs failed; restarting
[uncaughtException] [TypeError: Object #
Thank you for this very useful project !
David.
restartService
kills the rasterizer and starts a new one, but the killed rasterizer also callsstartService
on its ownexit
event. As a result, every timerestartService
is called, 2 new rasterizers are spawned for the 1 killed.Since the automatic
startService
onexit
should remain intact, thestartService
withinrestartService
should be removed.This is probably related to what @lahdekorpi and @HaNdTriX report in #32.