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

Wakapi in Docker leaving zombie process 🧟 #713

Open
baddate opened this issue Nov 22, 2024 · 4 comments
Open

Wakapi in Docker leaving zombie process 🧟 #713

baddate opened this issue Nov 22, 2024 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed prio c

Comments

@baddate
Copy link

baddate commented Nov 22, 2024

Describe the bug
running the wakapi docker container will generate a zombie process

zombie process

System information

  • Wakapi version 2.12.2
  • Ubuntu 22.04
  • Docker image with latest tag
  • PgSQL
@YC
Copy link
Collaborator

YC commented Nov 22, 2024

This is what I see when I ran Wakapi 2.12.2 with Postgres 17.

root     1103040       1  0 20:32 ?        00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id 0396e1b11c58286a2847b40097c6b923957276cdb2f5021804eafec8dbfe3978 -address /run/containerd/containerd.sock
999      1103091 1103040  0 20:32 ?        00:00:00  \_ postgres
999      1103239 1103091  0 20:32 ?        00:00:00      \_ postgres: checkpointer
999      1103240 1103091  0 20:32 ?        00:00:00      \_ postgres: background writer
999      1103242 1103091  0 20:32 ?        00:00:00      \_ postgres: walwriter
999      1103243 1103091  0 20:32 ?        00:00:00      \_ postgres: autovacuum launcher
999      1103244 1103091  0 20:32 ?        00:00:00      \_ postgres: logical replication launcher
999      1103262 1103091  0 20:32 ?        00:00:00      \_ postgres: wakapi wakapi 172.19.0.3(45668) idle
999      1103264 1103091  0 20:32 ?        00:00:00      \_ postgres: wakapi wakapi 172.19.0.3(45682) idle
root     1103069       1  0 20:32 ?        00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id 5cfc3755f29a64d7b2b9c5c4c6ac8879897dfa7ce73d4b8c94fa8e8b21b33415 -address /run/containerd/containerd.sock
1000    1103099 1103069  0 20:32 ?        00:00:00  \_ ./wakapi
1000    1103164 1103099  0 20:32 ?        00:00:00      \_ [timeout] <defunct>

The timeout is perhaps coming from wait-for-it.sh.
https://github.com/muety/wakapi/blob/master/Dockerfile#L4
Didn't see the others.

@muety
Copy link
Owner

muety commented Nov 22, 2024

Can you please explain this a bit further? From your screenshot I don't quite understand what the problem is.

@baddate
Copy link
Author

baddate commented Nov 22, 2024

Can you please explain this a bit further? From your screenshot I don't quite understand what the problem is.

I encountered a zombie process and subsequently determined that its parent process was Wakapi.

@muety
Copy link
Owner

muety commented Nov 22, 2024

Alright, went a bit deeper into this, but can't really explain why this is happening. My first intuition was that - as @YC suggested - it's related to this part of the wait-for-it script. But then I'm wondering why wakapi is the parent process of that zombie? Also, I can't reproduce this outside of a container (even when using wait-for-it) so it's probably indeed related to Docker.

Here is a super interesting discussion about Docker and zombie processes in general.

Wakapi itself doesn't spawn any child processes, to the best of my knowledge (unless some external libraries / database driver / etc. do).

While a zombie process doesn't really hurt, I'd still be happy if someone with proficient Linux expertise could have a look at this. Thanks for reporting.

@muety muety added bug Something isn't working help wanted Extra attention is needed prio c labels Nov 22, 2024
@muety muety changed the title zombie process Wakapi in Docker leaving zombie process 🧟 Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed prio c
Projects
None yet
Development

No branches or pull requests

3 participants