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

Zombie processes: from manually closing websocket? #20

Open
craigwalton-dsit opened this issue Dec 19, 2024 · 0 comments
Open

Zombie processes: from manually closing websocket? #20

craigwalton-dsit opened this issue Dec 19, 2024 · 0 comments
Labels
question Further information is requested

Comments

@craigwalton-dsit
Copy link
Collaborator

Looking at ps aux in an agent container with 1 running command shows lots of zombied processes

root@agent-env-9oge6g5v-default-0:~# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  11028  3816 ?        Ss   17:37   0:00 tail -f /dev/null
root        87  0.0  0.0      0     0 ?        Z    17:39   0:00 [bash] <defunct>
root        88 72.0  0.0      0     0 ?        Z    17:39   4:36 [bash] <defunct>
root        89  0.0  0.0      0     0 ?        Z    17:39   0:00 [grep] <defunct>
root     37816  0.3  0.0  12720  6280 ?        Ss   17:43   0:00 bash
root     42980  0.0  0.0      0     0 ?        Z    17:44   0:00 [bash] <defunct>
root     42982  0.0  0.0      0     0 ?        Z    17:44   0:00 [bash] <defunct>
root     42985  0.0  0.0      0     0 ?        Z    17:44   0:00 [bash] <defunct>
root     42987  0.0  0.0      0     0 ?        Z    17:44   0:00 [timeout] <defunct>
root     42989  0.0  0.0      0     0 ?        Z    17:44   0:00 [bash] <defunct>
root     42990  0.0  0.0      0     0 ?        Z    17:44   0:00 [timeout] <defunct>
root     42992  0.0  0.0      0     0 ?        Z    17:44   0:00 [bash] <defunct>
root     42993  0.1  0.0      0     0 ?        Z    17:44   0:00 [timeout] <defunct>
root     42995  0.1  0.0      0     0 ?        Z    17:44   0:00 [bash] <defunct>
root     42997  0.0  0.0      0     0 ?        Z    17:44   0:00 [bash] <defunct>
root     42998  0.1  0.0      0     0 ?        Z    17:44   0:00 [timeout] <defunct>
root     43000  0.1  0.0      0     0 ?        Z    17:44   0:00 [timeout] <defunct>
root     43001  0.0  0.0      0     0 ?        Z    17:44   0:00 [bash] <defunct>
root     43002  0.0  0.0      0     0 ?        Z    17:44   0:00 [bash] <defunct>
root     43003  0.0  0.0      0     0 ?        Z    17:44   0:00 [timeout] <defunct>
root     43005  0.0  0.0      0     0 ?        Z    17:44   0:00 [timeout] <defunct>
root     43007  0.0  0.0      0     0 ?        Z    17:44   0:00 [bash] <defunct>
root     43008  0.0  0.0      0     0 ?        Z    17:44   0:00 [bash] <defunct>
root     43010  0.0  0.0  11000  3712 ?        Ss   17:44   0:00 timeout 300s /bin/sh
root     43011  0.0  0.0  10664  2828 ?        S    17:44   0:00 /bin/sh
root     43012  0.0  0.0  12456  6176 ?        S    17:44   0:00 bash -c finally() {     pwd > /tmp/bash_tool_last_dir     export -p  > /tmp/bash_tool_last_env } trap 'f
root     43013 96.1  0.0  15260  8084 ?        R    17:44   1:17 bash -c finally() {     pwd > /tmp/bash_tool_last_dir     export -p  > /tmp/bash_tool_last_env } trap 'f
root     43014  0.0  0.0  11968  4608 ?        S    17:44   0:00 grep is open
root     59414  176  0.0  16256  8540 ?        R    17:45   0:00 ps aux
root     59426 45.4  0.0  15260  8088 ?        R    17:45   0:00 [bash]
root     59433 85.7  0.0  15260  8088 ?        S    17:45   0:00 bash -c finally() {     pwd > /tmp/bash_tool_last_dir     export -p  > /tmp/bash_tool_last_env } trap 'f
root     59438  116  0.0  15260  8088 ?        S    17:45   0:00 bash -c finally() {     pwd > /tmp/bash_tool_last_dir     export -p  > /tmp/bash_tool_last_env } trap 'f
root     59440  150  0.0  15260  8088 ?        S    17:45   0:00 bash -c finally() {     pwd > /tmp/bash_tool_last_dir     export -p  > /tmp/bash_tool_last_env } trap 'f
root     59443  200  0.0  15260  8088 ?        S    17:45   0:00 bash -c finally() {     pwd > /tmp/bash_tool_last_dir     export -p  > /tmp/bash_tool_last_env } trap 'f
root     59444  550  0.0  11000  2984 ?        R    17:45   0:00 [timeout]
root     59445  600  0.0  15260  8088 ?        S    17:45   0:00 bash -c finally() {     pwd > /tmp/bash_tool_last_dir     export -p  > /tmp/bash_tool_last_env } trap 'f

Are these just sticking around because we manually closed the websocket upon seeing the sentinel value? I.e. maybe the stdout/stderr file descriptors remain open? Should we be closing it in some other way? Is this problematic?

Couldn't repro this reliably. It doesn't appear to be something which always happens.

@craigwalton-dsit craigwalton-dsit added the question Further information is requested label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant