-
Notifications
You must be signed in to change notification settings - Fork 147
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
Need a way to finish the spawned process if wkhtmltopdf never responds #96
Comments
Should be able to just add a |
Hi, Setting a timeout on the child or the stream seems to kill only the parent process when executing on One thought was to avoid the issue entirely and spawn wkhtmltopdf without the need for To do that, assuming that wkhtmltopdf is available I'm spawning the process with With debug enabled I see the wkhtmltopdf command executed If I run the same command in the terminal and append Any information of insight you have would be great! |
@royazuniga I'm having the same issue:
No error returned, no exception catched. What I'm passing as EDIT Running on MacOS Sierra, will try to run the app (MeteorJS backed) via some Docker container and will let you know if same issue applies. |
@royazuniga Is that behavior only on OSX and not on Linux? |
@zxlin I've seen it on both osx (local) and linux (staging & prod). |
@royazuniga The original author put in the shell spawn for a reason and I'm not comfortable just removing it. It seems the wkhtmltopdf repo is discussing the possibility of adding timeouts to wkhtmltopdf itself. We can possibly find a way to kill the descendant process that the shell spawns and kill that directly. thoughts? |
For our case, we don't want wkhtmltopdf keep processing on large document. it's better just kill it. We made a patch in index.js line 200. |
timeout option here #133 |
Use case: We're using wkhtmltopdf (version 0.12.4 w/patched qt) with --window-status argument. If the page loaded by wkhtmltopdf never emits the proper window status, wkhtmltopdf never finishes. Logged against wkhtmltopdf as wkhtmltopdf/wkhtmltopdf#2490
Justification for using --window-status: We're using wkhtmltopdf to print web pages that run a lot of JavaScript & make a lot of long-running requests before the pages are ready to print.
With this wrapper (version 0.3.4), running into wkhtmltopdf issue 2490, the child processes never finish: the /bin/sh wkhtmltopdf process nor the wkhtmltopdf process (running on Linux or Mac OS X.)
Either we need a reference to the spawned child process returned from wkhtmltopdf, or we need an option included like "processTimeout", which specifies how many milliseconds to wait until the child process is killed (if it is still there). Ideally, the read stream is also closed at that point.
Thoughts? If you point me in the right direction, my coworker and/or I may be able to work on a pull request.
The text was updated successfully, but these errors were encountered: