public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix zombie children when git is PID 1 in containers
@ 2026-02-23 16:51 Andrew Au
  2026-02-23 16:51 ` [PATCH 1/1] transport-helper, connect: add atexit handler to reap children on abnormal exit Andrew Au
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Andrew Au @ 2026-02-23 16:51 UTC (permalink / raw)
  To: git; +Cc: cshung

When git runs as PID 1 inside a container and exits via exit(128) on
transport errors, child processes (git-remote-https, ssh, proxy) are
never waited on because the normal cleanup paths (disconnect_helper,
finish_connect) are bypassed. Since PID 1 has no parent to reap its
children, these become zombies that persist for the container's lifetime.

This patch registers atexit handlers in transport-helper.c and connect.c
to ensure children are reaped on any exit path, and clears them on the
normal cleanup paths to avoid double-waiting.

Blog post with detailed investigation: https://cshung.github.io/posts/zombie-git/

Andrew Au (1):
  transport-helper, connect: add atexit handler to reap children on
    abnormal exit

 connect.c          | 17 +++++++++++++++++
 transport-helper.c | 11 +++++++++++
 2 files changed, 28 insertions(+)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2026-03-16 21:25 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-23 16:51 [PATCH 0/1] Fix zombie children when git is PID 1 in containers Andrew Au
2026-02-23 16:51 ` [PATCH 1/1] transport-helper, connect: add atexit handler to reap children on abnormal exit Andrew Au
2026-02-23 17:14   ` Kristoffer Haugsbakk
2026-02-23 18:12     ` Andrew Au
2026-03-11 14:20 ` [PATCH v2] " Andrew Au
2026-03-11 17:58   ` Junio C Hamano
2026-03-11 18:19     ` Andrew Au
2026-03-11 19:38       ` Junio C Hamano
2026-03-11 18:42   ` Jeff King
2026-03-12 19:55     ` [PATCH v3] transport-helper, connect: use clean_on_exit " Andrew Au
2026-03-12 20:40       ` Jeff King
2026-03-12 20:41         ` Jeff King
2026-03-12 20:49       ` Junio C Hamano
2026-03-12 21:49     ` [PATCH v4] " Andrew Au
2026-03-12 22:04       ` Junio C Hamano
2026-03-14 16:08         ` Jeff King
2026-03-14 17:24           ` Junio C Hamano
2026-03-16 20:31           ` Junio C Hamano
2026-03-16 21:19             ` Jeff King
2026-03-16 21:24               ` Junio C Hamano
2026-03-11 21:15 ` [PATCH 0/1] Fix zombie children when git is PID 1 in containers brian m. carlson
2026-03-12 19:40   ` Andrew Au

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox