-
Notifications
You must be signed in to change notification settings - Fork 244
Phantomjs Processes Won't Stop #32
Comments
Maybe this bug should be cut into two;
I'm guessing some request already had the same url at the same time, so one of them removed it before the other. |
Catch error if trying to unlink a file that has been already removed by either a prior simultaneous request or some other application.
This commit fixes the crash but the response remains empty. I think the caching mechanism needs some improvement. Though I could not reproduce the big amount of phantomjs processes. |
Any ideas how to improve? As for the processes, I got them with tens of thousands of requests in a couple of minutes... |
What version of phantomJS are you running?
About the crash: The filename is based on a md5 hash of the options. If you switch on caching the time to elapse until you have this error should increase. If you do not use caching at all you can just add e.g. the timestamp to the filename creation. For me the main problem seems to be that this script tries to read the screenshot, fails but does not have a fallback. I dont know if the following process would improve the situation:
I did not completely think about a "final solution". Maybe there are other drawbacks to handle in this case. |
Yeah, I might just change the naming and see how it goes, thanks, but that doesn't solve problems that might be caused by disk errors, etc. |
If you apply the patch the service will not crash but return an empty response. I dont know if you could live with that. You could implement a fallback if the file is not found to retry taking a screenshot, maybe with exclusive naming so nobody can delete this one special file which was created for this one request. If I find a great solution I will let yo know. |
Don't crash if image doesn't exist. Related to #32
I am having a similar Issue. The service works for about 3000 Screenshots. But when it tries to restart itself. The It fails to stop the server somehow.
This will go on unit I have up to 40 phantomjs servers running. I used the latest version of screenshot-as-a-service and:
Does anyone know a Solution? |
I have same issue, phantomjs process are staying as phantom process ^^ Maybe a kind of cron task or with supervisord to kill these process ? |
My test case:
And the result is oprhaned phantomjs processes consuming memory:
![Kuvankaappaus 2013-4-8 kello 16 21 34](https://camo.githubusercontent.com/87542d420c09c14430334855e05a24b1d10be901c420dc6978fbe115bc3e9e52/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3537303534352f3335313633382f61613831393562302d613034662d313165322d383164622d3733393437393064653038612e706e67)
Crash:
The text was updated successfully, but these errors were encountered: