You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run node p1, once the browser opens, hit Ctrl+C, you'll notice the node process has exited but the browser still lingers.
I'm working around this by sending a cleanup signal from the main thread to the worker thread and manually closing the puppeteer instance in the worker thread. This isn't ideal and has been error prone.
Fix child process killing when the parent process SIGINTs.
If you `ctrl + c` the Puppeteer parent process, we would sometimes not properly handle killing of the child processes. This would then leave child processes behind, with running Chromium instances. This in turn could block Puppeteer from launching again and results in
cryptic errors.
Instead of using the generic `process.kill` with the process id (which for some reason is negative the pid, which I don't get), we can kill the child process directly by calling `proc.kill`.
Fixes#5729.
Fixes#4796.
Fixes#4963.
Fixes#4333.
Fixes#1825.
Is it possible to always launch the child process with
detached = false
?puppeteer/src/Launcher.js
Lines 77 to 88 in 8509f46
In some instances, puppeteer browsers linger even after the parent process is closed/killed.
This can be reproduced by using a worker thread.
p1.js
:p2.js
:Run
node p1
, once the browser opens, hit Ctrl+C, you'll notice the node process has exited but the browser still lingers.I'm working around this by sending a cleanup signal from the main thread to the worker thread and manually closing the puppeteer instance in the worker thread. This isn't ideal and has been error prone.
This might help solve #1825
The text was updated successfully, but these errors were encountered: