Skip to content
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

Spawns zombie processes #9

Open
caffeinatedgaze opened this issue Feb 12, 2020 · 8 comments
Open

Spawns zombie processes #9

caffeinatedgaze opened this issue Feb 12, 2020 · 8 comments
Assignees

Comments

@caffeinatedgaze
Copy link

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'

image

Note: I stumble across this issue independently of whether I run this utility using Python interface or the CLI.

@caffeinatedgaze
Copy link
Author

caffeinatedgaze commented Feb 12, 2020

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()

@caffeinatedgaze
Copy link
Author

Well, I checked it inside the host Ubuntu machine. Works just fine. No zombies are spawned

@caffeinatedgaze
Copy link
Author

Okay, this is already here miyakogi/pyppeteer#274

@kiwi0fruit
Copy link
Owner

kiwi0fruit commented Feb 12, 2020

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.

@kiwi0fruit kiwi0fruit self-assigned this Feb 12, 2020
@caffeinatedgaze
Copy link
Author

caffeinatedgaze commented Feb 12, 2020

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.

@kiwi0fruit
Copy link
Owner

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...

@kiwi0fruit
Copy link
Owner

kiwi0fruit commented Oct 17, 2020

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.

@kiwi0fruit
Copy link
Owner

kiwi0fruit commented Oct 17, 2020

Ver. 0.1.1 might be slightly better. But anyway I have no idea what else to do. Latest version is 0.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants