Open caffeinatedgaze opened 4 years ago
Now it seems that the pyppeteer library has a flaw itself. The following sequence results in one additional zombie process.
from pyppeteer import launch
browser = await launch(args=['--disable-gpu', '--no-sandbox', '--single-process'])
await browser.close()
Well, I checked it inside the host Ubuntu machine. Works just fine. No zombies are spawned
Okay, this is already here https://github.com/miyakogi/pyppeteer/issues/274
Looks like a nasty bug in the (unmaintained) pyppeteer. You can try using the same approach I use in knitty when dealing with buggy external deps: https://github.com/kiwi0fruit/knitty/blob/master/knitty/ast_filter.py
If you would try it please tell me if it worked.
Very nice, but will it be able to kill the orphaned processes? I've tried to kill those with Unix's kill
and no success.
Who knows... May be not. But we won't know until we try. And I don't know when I will have time to tinker with this...
I implemented hack from https://github.com/kiwi0fruit/knitty/blob/master/knitty/ast_filter.py in the pyppdf 0.1.0. Latest version is 0.1.2.
But I have no idea if it fixes this bug as I don't want to hunt it and reproduce. But if you have the bug you can test 0.1.2 version and tell us if it worked.
Ver. 0.1.1 might be slightly better. But anyway I have no idea what else to do. Latest version is 0.1.2.
After running the following command inside Debian GNU/Linux 10 (buster) docker image, I see multiple defunct processes. Each consequent run gives birth to 4 more zombies.
pyppdf -a "{'args': ['--disable-gpu', '--no-sandbox'],'goto': {'waitUntil':'networkidle0', 'timeout':100000},'pdf':{'printBackground':True, 'landscape':True, 'scale':0.7}}" 'file:///tmp/temp-pdfreport-page.html'
Note: I stumble across this issue independently of whether I run this utility using Python interface or the CLI.