don't be in the future just yet
ci/woodpecker/push/woodpecker Pipeline was successful Details

pull/36/head
Loïc Dachary 2022-06-02 15:30:41 +02:00
parent aba2b29872
commit 0e9a9c0c6a
Signed by: dachary
GPG Key ID: 992D23B392F9E4F2
1 changed files with 1 additions and 5 deletions

View File

@ -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.