3

I have quite complicated setup with

But long story short - everything works fine at my local Ubuntu (17.10) desktop, but when run in Docker(18.03.0-ce) via docker-compose(1.18.0) (config version 3.3, some related details here https://github.com/miyakogi/pyppeteer/issues/14) it bloats up with zombie chrome processes spawned from python.

Any ideas why it might happen and what to do with it?

enter image description here

scythargon
  • 2,750
  • 3
  • 23
  • 49
  • Did you ever come up with a workaround for this? – Andy Hayden Jun 26 '18 at 21:32
  • @AndyHayden hey, yes - look at two answers below this question here. Mine become much better with wrapping the python process with bash, but still not perfect - still encounter zombies sometimes, but I didn't have time to try the `dumb-init` as suggested in the another answer below, but I do play to give it a try. If you will - please add a comment here about how it went! – scythargon Jun 27 '18 at 16:46
  • 1
    I think my issue is slightly different / not zombie chrome processes (this time), networking issues I think. – Andy Hayden Jun 27 '18 at 17:23

2 Answers2

1

Seems like it is because python process is not meant to be a root-level process - the topmost one in the processes tree. It just does not handle zombies properly. So after few hours of struggling I end up with the next ugly docker-compose config entry:

entrypoint: /bin/bash -c
command: "(luigid) &"

Where luigid is a python process. This makes bash a root process which handles zombies perfectly.

Would be great to know a more straightforward way of doing this.

scythargon
  • 2,750
  • 3
  • 23
  • 49
  • Glad to find this. I actually already had a bash script calling python, but it was using "exec", so python became proc id 1. Removed the exec, and zombies are gone – Joe Watkins Aug 19 '20 at 13:31
1

Try installing dumb-init: https://github.com/Yelp/dumb-init (available both in alpine and debian) inside your container and use it as entry point (more reading here: https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/)

error
  • 172
  • 1
  • 10