Repository navigation
Workers generate many Zombie processes over time #2173
Description
Activity
@swarren12 thank you for opening this issue and welcome back.
We'll look into this one right away.
Reacted by Simon Warren@swarren12 Does the work in #2241 fix this if you enable namespaces?
I noticed that
v1.0.0was released, so before trying anything else I upgraded our farm to the latest version. Maybe unsurprisingly, the zombie processes are still being generated on that version.I've then updated some workers to an image based off
:sq72ivxkjh44pgkm32w03g09pimyxxbb.So far, I don't see any Zombies on those workers. I'll keep an eye on it over the next few hours but I'd tentatively say that the problem has been fixed with the recent changes.
Edit: might have spoken too soon. Came back from lunch and it seems like those nodes have also spawned some zombies. :(
Reacted by Tom Parker-ShemiltSo, I just realised that the previous test was using a stale config without the
use_namespacesflag set (so it defaulted tofalse).I tried to turn it on, but now the worker crashes on start-up:
Error: Error { code: Unavailable, messages: ["Namespaces not supported", "Could not make LocalWorker", "main() function failed"] }The documentation says that
use_namespacesis only supported for Linux, but the worker is running inside a Rocky 8 container so I'm not sure what the problem is?@swarren12 I am going to try and test on Rocky Linux sometime this weekend or next week when I get some time, but it should definitely work there. I cannot think of any reason why use_namespaces would not work on Rocky but I honestly have not stayed up to date on it myself. I only know that some of our customers and open source community use Rocky Linux.
Reacted by Simon WarrenThe documentation says that
use_namespacesis only supported for Linux, but the worker is running inside a Rocky 8 container so I'm not sure what the problem is?In retrospect, the problem there is obvious. We can't do the namespacing fix inside a Docker container, as it's already in a chroot and so the
unsharecall we do to do the namespacing fails. #2290 makes this case clearer and fixes the docs to clarify this.We'll need to figure out to fix this another way!
The documentation says that
use_namespacesis only supported for Linux, but the worker is running inside a Rocky 8 container so I'm not sure what the problem is?In retrospect, the problem there is obvious. We can't do the namespacing fix inside a Docker container, as it's already in a chroot and so the
unsharecall we do to do the namespacing fails. #2290 makes this case clearer and fixes the docs to clarify this.@swarren12 This isn't quite correct. If you use privileged containers it works just fine. Is that an option for you?
Running with
--privilegedseems to have helped. I'll keep an eye on the container and see if its still spawning zombies.Reacted by Tom Parker-ShemiltI'll close this one as resolved and we can make a note in the docs or re-open if there are continued issues. Thank you for keeping us updated.
Reacted by Simon Warren
I've noticed that our containerised worker agents build up a number of
Zombie processes. Almost all of these are eithersleeporps.Expected behaviour: no zombie/defunct processes are running after a build completes
Actual behaviour: test (I think) targets leave behind zombie
sleep/psprocessesSteps to reproduce:
test-setup.sh(I think...)ps auxfrom inside the containerMore details
The
bashprocesses could be from thedocker execs but I believe thepsandsleepprocesses are being spawned by thetest-setup.shscript that Bazel uses:We've been seeing this behaviour since at least
0.7.x(possibly even earlier), currently using0.8.0.We're running on Bazel
9.0.0.