From 0e9a9c0c6af14a0d0c53a5104ecb20f1d61f5e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dachary?= Date: Thu, 2 Jun 2022 15:30:41 +0200 Subject: [PATCH] don't be in the future just yet --- content/blog/2022-06-02-zombies.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/content/blog/2022-06-02-zombies.md b/content/blog/2022-06-02-zombies.md index df18439..6853016 100644 --- a/content/blog/2022-06-02-zombies.md +++ b/content/blog/2022-06-02-zombies.md @@ -1,5 +1,5 @@ +++ -title = "[solved] Zombies created by Gitea version <= 1.16.8" +title = "[solved] Zombies created by Gitea" date = 2022-06-02 description = "An increasing number of zombies processes are created by Gitea because it only kills its direct children on timeout." [taxonomies] @@ -9,8 +9,6 @@ tags = ['hostea', 'gitea', 'troubleshoot', 'problem'] author = 'dachary' +++ -**TL;DR: run Gitea version >= 1.16.9 to avoid zombies** - The first [issue about zombie processes](https://github.com/go-gitea/gitea/issues/3242) created by Gitea was reported in 2017 and [resurfaced](https://github.com/go-gitea/gitea/issues/13987) on a [regular basis](https://github.com/go-gitea/gitea/issues/19077). Although it does not look pretty, zombie processes are leftovers that do not consume resources and never caused any kind of harm. Here is one scenario that will create a zombie: * Gitea updates a mirror by spawning the process `git remote update` @@ -81,5 +79,3 @@ PPID PID COMMAND COMMAND ### Killing a child process and all its children There should be no need for an admin running Gitea to worry about those gory details, it should be taken care of regardless of the environment Gitea runs in. Fortunately there is a very simple way to avoid the creation of zombies by ensuring that all Gitea child process are [process group leaders](https://en.wikipedia.org/wiki/Process_group). In a nutshell it means that when the child is killed all its children and grand children are also killed. - -A [patch was introduced in Gitea 1.17](https://github.com/go-gitea/gitea/pull/19865) and backported to Gitea 1.16.9 so that all `git` commands are created as process group leaders and solve this problem for good.