-
Notifications
You must be signed in to change notification settings - Fork 2k
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
run fish in docker image will spawn a zombie python process #7183
Comments
This is fish running the completion generator. It happens on first start, when it will create a It should just complete after a few minutes. |
|
Yes, I don't think this is expected. Zombie processes in Docker are usually the result of running the container without a full init process, though your |
I found that if I I have use the |
It is expected that fish runs the completion generator. It is not expected that it doesn't finish. It should just take a couple of minutes (worst case - it takes 6s for me with ~3000 man pages but that's on a fairly quick ssd) and then exit. |
zombie is different from background process or a process that isn't finished; it is finishing but it's not being reaped (which is to be expected in the absence of init). Since it didn't finish successfully, this happens each time rather than just the first session. Perhaps broken permissions or broken docker path mappings are preventing it from completing successfully (which is different from not completing)? I would delete that folder you just created and manually run the completion script in a session to see what errors it throws/why it's not able to generate the completions. |
The
I found the zombie maker piece is in the |
Ah, okay. So the conclusion is:
Tbh I'm tempted to call this a distro bug, but then the combination with docker that makes this annoying would make them not want to handle it as well. There's little we can do about python turning into a zombie when it does something (get an actual init system please), but we can check if the script exists so it doesn't happen again and again and again. |
I don't think what's happening? PID 1 is only supposed to clean up orphaned zombie processes (where the parent has exited), but these processes have a parent - fish - that is not reaping them properly. |
We |
Disowning removes them from the job list, but (because of #5342) fish keeps a list of disowned processes and occasionally calls You can produce zombies by running However, it looks like I can reproduce this by putting |
(also, bash calls waitpid when receiving SIGCHLD, which might be an easier way of dealing with zombie children) |
Oh no! PGID strikes again!
I think the answer here is to make |
add_disowned_pgid skips jobs that have a PGID equal to the running process. However, this includes processes started in config.fish or when job control is turned off, so they never get waited on. Instead, add all the PIDs of the job to the list of disowned PIDs/PGIDs as well. Fixes fish-shell#7183.
add_disowned_pgid skipped jobs that have a PGID equal to the running process. However, this includes processes started in config.fish or when job control is turned off, so they never get waited on. Instead, refactor this function to add_disowned_job, and add either the PGID or all the PIDs of the job to the list of disowned PIDs/PGIDs. Fixes fish-shell#7183.
add_disowned_pgid skipped jobs that have a PGID equal to the running process. However, this includes processes started in config.fish or when job control is turned off, so they never get waited on. Instead, refactor this function to add_disowned_job, and add either the PGID or all the PIDs of the job to the list of disowned PIDs/PGIDs. Fixes fish-shell#7183.
add_disowned_pgid skipped jobs that have a PGID equal to the running process. However, this includes processes started in config.fish or when job control is turned off, so they never get waited on. Instead, refactor this function to add_disowned_job, and add either the PGID or all the PIDs of the job to the list of disowned PIDs/PGIDs. Fixes fish-shell#7183.
Disown PIDs as well as PGIDs Closes #7183
fish version: 3.1.0
docker image: ubuntu 20.04
docker run command:
docker run -it --rm --init <image id>
However when I run fish on host linux, there is no such issue. Is this docker issue or fish issue? Or can you explain the python zombie process?
The text was updated successfully, but these errors were encountered: