status: leaves behind zombie (i.e. <defunct>) processes
See original GitHub issueDescription
I happened to run ps -e and noticed hundreds of process with command dvc <defunct>. I was able to reproduce in a clean shell with dvc status, with each call to dvc status leaving behind two zombies.
Reproduce
(HdEqokMk-py3.8) root@32381816d00a# ps -e
PID TTY TIME CMD
1 ? 00:00:04 jupyter-lab
54 pts/0 00:00:01 bash
59 pts/0 00:00:00 poetry
62 pts/1 00:00:01 bash
69 pts/1 00:00:00 ps
(HdEqokMk-py3.8) root@32381816d00a# dvc status
WARNING: stage: 'data.dvc' is frozen. Its dependencies are not going to be shown in the status output.
discover@0:
changed deps:
modified: abcd
transform:
changed deps:
modified: pyproject.toml
modified: abcd
modified: vendor
modified: data/schema.xlsx
changed outs:
modified: build/datapackage.json
modified: build/abcd.csv
(HdEqokMk-py3.8) root@32381816d00a# ps -e
PID TTY TIME CMD
1 ? 00:00:04 jupyter-lab
54 pts/0 00:00:01 bash
59 pts/0 00:00:00 poetry
62 pts/1 00:00:01 bash
78 ? 00:00:00 dvc <defunct>
79 ? 00:00:00 dvc <defunct>
82 pts/1 00:00:00 ps
Expected
No dvc <defunct> processes.
Environment information
I cannot reproduce this on macOS. I encountered this working out of a rootless docker container.
Output of dvc doctor:
DVC version: 2.7.4 (pip)
---------------------------------
Platform: Python 3.8.10 on Linux-5.11.0-27-generic-x86_64-with-glibc2.29
Supports:
gdrive (pydrive2 = 1.10.0),
http (aiohttp = 3.7.4.post0, aiohttp-retry = 2.4.5),
https (aiohttp = 3.7.4.post0, aiohttp-retry = 2.4.5)
Cache types: symlink
Cache directory: fuse.glusterfs on glusteruser.domain.pub:/glusteruser
Caches: local
Remotes: gdrive, local, local
Workspace directory: ext4 on /dev/sda5
Repo: dvc, git
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
<defunct> processes remain behind - Unix Stack Exchange
Defnct (or zombie - that's where the Z comes from) processes can't be killed, the just linger in the process table until their...
Read more >Zombie Processes and their Prevention - GeeksforGeeks
Zombie state: When a process is created in UNIX using fork() system call, the parent process is cloned. If the parent process calls...
Read more >"run script" hook leaves behind defunct/zombie processes
So whenever the child process has exited, kea collects the status so that the process does not remain in defunct (zombie) state. This...
Read more >How to identify and kill zombie/defunct processes in Linux ...
The process status becomes EXIT_ZOMBIE and the process parent is notified that its child process has died with the SIGCHLD signal.
Read more >how to kill (or avoid) zombie processes with subprocess module
A zombie process is not a real process; it's just a remaining entry in the process table until the parent process requests the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Recommend closing as not a DVC issue. I have non DVC processes going undead on me now too. I suspect it’s rootlesskit…
Definitely, hours. But none since disabling core.analytics. I could try to isolate to docker container, or dvc remote, or something if it would help.