new deploy: 2022-06-04T14:54:37+00:00

pages
Loïc Dachary 2022-06-04 14:54:37 +00:00 committed by dachary
parent 2021fcb3b7
commit 0afe3aa993
6 changed files with 12 additions and 12 deletions

View File

@ -12,7 +12,7 @@
<updated>2022-06-04T00:00:00+00:00</updated> <updated>2022-06-04T00:00:00+00:00</updated>
<link href="https://hostea.org/blog/zombies-part-2/" type="text/html"/> <link href="https://hostea.org/blog/zombies-part-2/" type="text/html"/>
<id>https://hostea.org/blog/zombies-part-2/</id> <id>https://hostea.org/blog/zombies-part-2/</id>
<content type="html">&lt;p&gt;Gitea can &lt;a href=&quot;zombies&quot;&gt;create zombies&lt;&#x2F;a&gt;, for instance if a Git mirror takes too long. When updating a mirror, Gitea relies on the &lt;code&gt;git remote update&lt;&#x2F;code&gt; command which creates a child process, &lt;code&gt;git-remote-https&lt;&#x2F;code&gt;, to fetch data from the remote repository. Gitea has an internal timeout that will kill the child process (e.g. &lt;code&gt;git remote update&lt;&#x2F;code&gt;) when it takes too long but will not kill the grandchild. This grandchild will become an orphan and run forever or until its own timeout expires, which is about two minutes on git version 2.25.&lt;&#x2F;p&gt; <content type="html">&lt;p&gt;Gitea can &lt;a href=&quot;&#x2F;blog&#x2F;zombies&quot;&gt;create zombies&lt;&#x2F;a&gt;, for instance if a Git mirror takes too long. When updating a mirror, Gitea relies on the &lt;code&gt;git remote update&lt;&#x2F;code&gt; command which creates a child process, &lt;code&gt;git-remote-https&lt;&#x2F;code&gt;, to fetch data from the remote repository. Gitea has an internal timeout that will kill the child process (e.g. &lt;code&gt;git remote update&lt;&#x2F;code&gt;) when it takes too long but will not kill the grandchild. This grandchild will become an orphan and run forever or until its own timeout expires, which is about two minutes on git version 2.25.&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;$ time git clone https:&#x2F;&#x2F;4.4.4.4 &lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;$ time git clone https:&#x2F;&#x2F;4.4.4.4
&lt;&#x2F;span&gt;&lt;span&gt;Clonage dans &amp;#39;4.4.4.4&amp;#39;... &lt;&#x2F;span&gt;&lt;span&gt;Clonage dans &amp;#39;4.4.4.4&amp;#39;...
&lt;&#x2F;span&gt;&lt;span&gt;fatal: impossible d&amp;#39;accéder à &amp;#39;https:&#x2F;&#x2F;4.4.4.4&#x2F;&amp;#39;: Failed to connect to 4.4.4.4 port 443: Connexion terminée par expiration du délai d&amp;#39;attente &lt;&#x2F;span&gt;&lt;span&gt;fatal: impossible d&amp;#39;accéder à &amp;#39;https:&#x2F;&#x2F;4.4.4.4&#x2F;&amp;#39;: Failed to connect to 4.4.4.4 port 443: Connexion terminée par expiration du délai d&amp;#39;attente
@ -21,7 +21,7 @@
&lt;&#x2F;span&gt;&lt;span&gt;user 0m0,001s &lt;&#x2F;span&gt;&lt;span&gt;user 0m0,001s
&lt;&#x2F;span&gt;&lt;span&gt;sys 0m0,009s &lt;&#x2F;span&gt;&lt;span&gt;sys 0m0,009s
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt; &lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;As explained in the &lt;a href=&quot;zombies&#x2F;#killing-a-child-process-and-all-its-children&quot;&gt;diagnostic blog post regarding Gitea zombies&lt;&#x2F;a&gt; there fortunately is a very simple way to avoid this by making sure each Gitea child is a &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Process_group&quot;&gt;process group leader&lt;&#x2F;a&gt;. That first step was &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;introduced in Gitea 1.17&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;backported to Gitea 1.16.9&lt;&#x2F;a&gt;. The actual bug fix can now be implemented.&lt;&#x2F;p&gt; &lt;p&gt;As explained in the &lt;a href=&quot;&#x2F;blog&#x2F;zombies&#x2F;#killing-a-child-process-and-all-its-children&quot;&gt;diagnostic blog post regarding Gitea zombies&lt;&#x2F;a&gt; there fortunately is a very simple way to avoid this by making sure each Gitea child is a &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Process_group&quot;&gt;process group leader&lt;&#x2F;a&gt;. That first step was &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;introduced in Gitea 1.17&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;backported to Gitea 1.16.9&lt;&#x2F;a&gt;. The actual bug fix can now be implemented.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;using-negative-process-id-to-kill-children&quot;&gt;Using negative process id to kill children&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-negative-process-id-to-kill-children&quot; aria-label=&quot;Anchor link for: using-negative-process-id-to-kill-children&quot; &lt;h3 id=&quot;using-negative-process-id-to-kill-children&quot;&gt;Using negative process id to kill children&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-negative-process-id-to-kill-children&quot; aria-label=&quot;Anchor link for: using-negative-process-id-to-kill-children&quot;
&gt;&lt;span class=&quot;anchor-icon&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a &gt;&lt;span class=&quot;anchor-icon&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a
&gt; &gt;

View File

@ -216,7 +216,7 @@
<div class="blog__content"> <div class="blog__content">
<p>Gitea can <a href="zombies">create zombies</a>, for instance if a Git mirror takes too long. When updating a mirror, Gitea relies on the <code>git remote update</code> command which creates a child process, <code>git-remote-https</code>, to fetch data from the remote repository. Gitea has an internal timeout that will kill the child process (e.g. <code>git remote update</code>) when it takes too long but will not kill the grandchild. This grandchild will become an orphan and run forever or until its own timeout expires, which is about two minutes on git version 2.25.</p> <p>Gitea can <a href="/blog/zombies">create zombies</a>, for instance if a Git mirror takes too long. When updating a mirror, Gitea relies on the <code>git remote update</code> command which creates a child process, <code>git-remote-https</code>, to fetch data from the remote repository. Gitea has an internal timeout that will kill the child process (e.g. <code>git remote update</code>) when it takes too long but will not kill the grandchild. This grandchild will become an orphan and run forever or until its own timeout expires, which is about two minutes on git version 2.25.</p>
<pre style="background-color:#2b303b;color:#c0c5ce;"><code><span>$ time git clone https://4.4.4.4 <pre style="background-color:#2b303b;color:#c0c5ce;"><code><span>$ time git clone https://4.4.4.4
</span><span>Clonage dans &#39;4.4.4.4&#39;... </span><span>Clonage dans &#39;4.4.4.4&#39;...
</span><span>fatal: impossible d&#39;accéder à &#39;https://4.4.4.4/&#39;: Failed to connect to 4.4.4.4 port 443: Connexion terminée par expiration du délai d&#39;attente </span><span>fatal: impossible d&#39;accéder à &#39;https://4.4.4.4/&#39;: Failed to connect to 4.4.4.4 port 443: Connexion terminée par expiration du délai d&#39;attente
@ -225,7 +225,7 @@
</span><span>user 0m0,001s </span><span>user 0m0,001s
</span><span>sys 0m0,009s </span><span>sys 0m0,009s
</span></code></pre> </span></code></pre>
<p>As explained in the <a href="zombies/#killing-a-child-process-and-all-its-children">diagnostic blog post regarding Gitea zombies</a> there fortunately is a very simple way to avoid this by making sure each Gitea child is a <a href="https://en.wikipedia.org/wiki/Process_group">process group leader</a>. That first step was <a href="https://github.com/go-gitea/gitea/pull/19865">introduced in Gitea 1.17</a> and <a href="https://github.com/go-gitea/gitea/pull/19865">backported to Gitea 1.16.9</a>. The actual bug fix can now be implemented.</p> <p>As explained in the <a href="/blog/zombies/#killing-a-child-process-and-all-its-children">diagnostic blog post regarding Gitea zombies</a> there fortunately is a very simple way to avoid this by making sure each Gitea child is a <a href="https://en.wikipedia.org/wiki/Process_group">process group leader</a>. That first step was <a href="https://github.com/go-gitea/gitea/pull/19865">introduced in Gitea 1.17</a> and <a href="https://github.com/go-gitea/gitea/pull/19865">backported to Gitea 1.16.9</a>. The actual bug fix can now be implemented.</p>
<h3 id="using-negative-process-id-to-kill-children">Using negative process id to kill children<a class="zola-anchor" href="#using-negative-process-id-to-kill-children" aria-label="Anchor link for: using-negative-process-id-to-kill-children" <h3 id="using-negative-process-id-to-kill-children">Using negative process id to kill children<a class="zola-anchor" href="#using-negative-process-id-to-kill-children" aria-label="Anchor link for: using-negative-process-id-to-kill-children"
><span class="anchor-icon">#</span></a ><span class="anchor-icon">#</span></a
> >

View File

@ -12,7 +12,7 @@
<updated>2022-06-04T00:00:00+00:00</updated> <updated>2022-06-04T00:00:00+00:00</updated>
<link href="https://hostea.org/blog/zombies-part-2/" type="text/html"/> <link href="https://hostea.org/blog/zombies-part-2/" type="text/html"/>
<id>https://hostea.org/blog/zombies-part-2/</id> <id>https://hostea.org/blog/zombies-part-2/</id>
<content type="html">&lt;p&gt;Gitea can &lt;a href=&quot;zombies&quot;&gt;create zombies&lt;&#x2F;a&gt;, for instance if a Git mirror takes too long. When updating a mirror, Gitea relies on the &lt;code&gt;git remote update&lt;&#x2F;code&gt; command which creates a child process, &lt;code&gt;git-remote-https&lt;&#x2F;code&gt;, to fetch data from the remote repository. Gitea has an internal timeout that will kill the child process (e.g. &lt;code&gt;git remote update&lt;&#x2F;code&gt;) when it takes too long but will not kill the grandchild. This grandchild will become an orphan and run forever or until its own timeout expires, which is about two minutes on git version 2.25.&lt;&#x2F;p&gt; <content type="html">&lt;p&gt;Gitea can &lt;a href=&quot;&#x2F;blog&#x2F;zombies&quot;&gt;create zombies&lt;&#x2F;a&gt;, for instance if a Git mirror takes too long. When updating a mirror, Gitea relies on the &lt;code&gt;git remote update&lt;&#x2F;code&gt; command which creates a child process, &lt;code&gt;git-remote-https&lt;&#x2F;code&gt;, to fetch data from the remote repository. Gitea has an internal timeout that will kill the child process (e.g. &lt;code&gt;git remote update&lt;&#x2F;code&gt;) when it takes too long but will not kill the grandchild. This grandchild will become an orphan and run forever or until its own timeout expires, which is about two minutes on git version 2.25.&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;$ time git clone https:&#x2F;&#x2F;4.4.4.4 &lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;$ time git clone https:&#x2F;&#x2F;4.4.4.4
&lt;&#x2F;span&gt;&lt;span&gt;Clonage dans &amp;#39;4.4.4.4&amp;#39;... &lt;&#x2F;span&gt;&lt;span&gt;Clonage dans &amp;#39;4.4.4.4&amp;#39;...
&lt;&#x2F;span&gt;&lt;span&gt;fatal: impossible d&amp;#39;accéder à &amp;#39;https:&#x2F;&#x2F;4.4.4.4&#x2F;&amp;#39;: Failed to connect to 4.4.4.4 port 443: Connexion terminée par expiration du délai d&amp;#39;attente &lt;&#x2F;span&gt;&lt;span&gt;fatal: impossible d&amp;#39;accéder à &amp;#39;https:&#x2F;&#x2F;4.4.4.4&#x2F;&amp;#39;: Failed to connect to 4.4.4.4 port 443: Connexion terminée par expiration du délai d&amp;#39;attente
@ -21,7 +21,7 @@
&lt;&#x2F;span&gt;&lt;span&gt;user 0m0,001s &lt;&#x2F;span&gt;&lt;span&gt;user 0m0,001s
&lt;&#x2F;span&gt;&lt;span&gt;sys 0m0,009s &lt;&#x2F;span&gt;&lt;span&gt;sys 0m0,009s
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt; &lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;As explained in the &lt;a href=&quot;zombies&#x2F;#killing-a-child-process-and-all-its-children&quot;&gt;diagnostic blog post regarding Gitea zombies&lt;&#x2F;a&gt; there fortunately is a very simple way to avoid this by making sure each Gitea child is a &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Process_group&quot;&gt;process group leader&lt;&#x2F;a&gt;. That first step was &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;introduced in Gitea 1.17&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;backported to Gitea 1.16.9&lt;&#x2F;a&gt;. The actual bug fix can now be implemented.&lt;&#x2F;p&gt; &lt;p&gt;As explained in the &lt;a href=&quot;&#x2F;blog&#x2F;zombies&#x2F;#killing-a-child-process-and-all-its-children&quot;&gt;diagnostic blog post regarding Gitea zombies&lt;&#x2F;a&gt; there fortunately is a very simple way to avoid this by making sure each Gitea child is a &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Process_group&quot;&gt;process group leader&lt;&#x2F;a&gt;. That first step was &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;introduced in Gitea 1.17&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;backported to Gitea 1.16.9&lt;&#x2F;a&gt;. The actual bug fix can now be implemented.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;using-negative-process-id-to-kill-children&quot;&gt;Using negative process id to kill children&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-negative-process-id-to-kill-children&quot; aria-label=&quot;Anchor link for: using-negative-process-id-to-kill-children&quot; &lt;h3 id=&quot;using-negative-process-id-to-kill-children&quot;&gt;Using negative process id to kill children&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-negative-process-id-to-kill-children&quot; aria-label=&quot;Anchor link for: using-negative-process-id-to-kill-children&quot;
&gt;&lt;span class=&quot;anchor-icon&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a &gt;&lt;span class=&quot;anchor-icon&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a
&gt; &gt;

View File

@ -12,7 +12,7 @@
<updated>2022-06-04T00:00:00+00:00</updated> <updated>2022-06-04T00:00:00+00:00</updated>
<link href="https://hostea.org/blog/zombies-part-2/" type="text/html"/> <link href="https://hostea.org/blog/zombies-part-2/" type="text/html"/>
<id>https://hostea.org/blog/zombies-part-2/</id> <id>https://hostea.org/blog/zombies-part-2/</id>
<content type="html">&lt;p&gt;Gitea can &lt;a href=&quot;zombies&quot;&gt;create zombies&lt;&#x2F;a&gt;, for instance if a Git mirror takes too long. When updating a mirror, Gitea relies on the &lt;code&gt;git remote update&lt;&#x2F;code&gt; command which creates a child process, &lt;code&gt;git-remote-https&lt;&#x2F;code&gt;, to fetch data from the remote repository. Gitea has an internal timeout that will kill the child process (e.g. &lt;code&gt;git remote update&lt;&#x2F;code&gt;) when it takes too long but will not kill the grandchild. This grandchild will become an orphan and run forever or until its own timeout expires, which is about two minutes on git version 2.25.&lt;&#x2F;p&gt; <content type="html">&lt;p&gt;Gitea can &lt;a href=&quot;&#x2F;blog&#x2F;zombies&quot;&gt;create zombies&lt;&#x2F;a&gt;, for instance if a Git mirror takes too long. When updating a mirror, Gitea relies on the &lt;code&gt;git remote update&lt;&#x2F;code&gt; command which creates a child process, &lt;code&gt;git-remote-https&lt;&#x2F;code&gt;, to fetch data from the remote repository. Gitea has an internal timeout that will kill the child process (e.g. &lt;code&gt;git remote update&lt;&#x2F;code&gt;) when it takes too long but will not kill the grandchild. This grandchild will become an orphan and run forever or until its own timeout expires, which is about two minutes on git version 2.25.&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;$ time git clone https:&#x2F;&#x2F;4.4.4.4 &lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;$ time git clone https:&#x2F;&#x2F;4.4.4.4
&lt;&#x2F;span&gt;&lt;span&gt;Clonage dans &amp;#39;4.4.4.4&amp;#39;... &lt;&#x2F;span&gt;&lt;span&gt;Clonage dans &amp;#39;4.4.4.4&amp;#39;...
&lt;&#x2F;span&gt;&lt;span&gt;fatal: impossible d&amp;#39;accéder à &amp;#39;https:&#x2F;&#x2F;4.4.4.4&#x2F;&amp;#39;: Failed to connect to 4.4.4.4 port 443: Connexion terminée par expiration du délai d&amp;#39;attente &lt;&#x2F;span&gt;&lt;span&gt;fatal: impossible d&amp;#39;accéder à &amp;#39;https:&#x2F;&#x2F;4.4.4.4&#x2F;&amp;#39;: Failed to connect to 4.4.4.4 port 443: Connexion terminée par expiration du délai d&amp;#39;attente
@ -21,7 +21,7 @@
&lt;&#x2F;span&gt;&lt;span&gt;user 0m0,001s &lt;&#x2F;span&gt;&lt;span&gt;user 0m0,001s
&lt;&#x2F;span&gt;&lt;span&gt;sys 0m0,009s &lt;&#x2F;span&gt;&lt;span&gt;sys 0m0,009s
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt; &lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;As explained in the &lt;a href=&quot;zombies&#x2F;#killing-a-child-process-and-all-its-children&quot;&gt;diagnostic blog post regarding Gitea zombies&lt;&#x2F;a&gt; there fortunately is a very simple way to avoid this by making sure each Gitea child is a &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Process_group&quot;&gt;process group leader&lt;&#x2F;a&gt;. That first step was &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;introduced in Gitea 1.17&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;backported to Gitea 1.16.9&lt;&#x2F;a&gt;. The actual bug fix can now be implemented.&lt;&#x2F;p&gt; &lt;p&gt;As explained in the &lt;a href=&quot;&#x2F;blog&#x2F;zombies&#x2F;#killing-a-child-process-and-all-its-children&quot;&gt;diagnostic blog post regarding Gitea zombies&lt;&#x2F;a&gt; there fortunately is a very simple way to avoid this by making sure each Gitea child is a &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Process_group&quot;&gt;process group leader&lt;&#x2F;a&gt;. That first step was &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;introduced in Gitea 1.17&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;backported to Gitea 1.16.9&lt;&#x2F;a&gt;. The actual bug fix can now be implemented.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;using-negative-process-id-to-kill-children&quot;&gt;Using negative process id to kill children&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-negative-process-id-to-kill-children&quot; aria-label=&quot;Anchor link for: using-negative-process-id-to-kill-children&quot; &lt;h3 id=&quot;using-negative-process-id-to-kill-children&quot;&gt;Using negative process id to kill children&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-negative-process-id-to-kill-children&quot; aria-label=&quot;Anchor link for: using-negative-process-id-to-kill-children&quot;
&gt;&lt;span class=&quot;anchor-icon&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a &gt;&lt;span class=&quot;anchor-icon&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a
&gt; &gt;

View File

@ -12,7 +12,7 @@
<updated>2022-06-04T00:00:00+00:00</updated> <updated>2022-06-04T00:00:00+00:00</updated>
<link href="https://hostea.org/blog/zombies-part-2/" type="text/html"/> <link href="https://hostea.org/blog/zombies-part-2/" type="text/html"/>
<id>https://hostea.org/blog/zombies-part-2/</id> <id>https://hostea.org/blog/zombies-part-2/</id>
<content type="html">&lt;p&gt;Gitea can &lt;a href=&quot;zombies&quot;&gt;create zombies&lt;&#x2F;a&gt;, for instance if a Git mirror takes too long. When updating a mirror, Gitea relies on the &lt;code&gt;git remote update&lt;&#x2F;code&gt; command which creates a child process, &lt;code&gt;git-remote-https&lt;&#x2F;code&gt;, to fetch data from the remote repository. Gitea has an internal timeout that will kill the child process (e.g. &lt;code&gt;git remote update&lt;&#x2F;code&gt;) when it takes too long but will not kill the grandchild. This grandchild will become an orphan and run forever or until its own timeout expires, which is about two minutes on git version 2.25.&lt;&#x2F;p&gt; <content type="html">&lt;p&gt;Gitea can &lt;a href=&quot;&#x2F;blog&#x2F;zombies&quot;&gt;create zombies&lt;&#x2F;a&gt;, for instance if a Git mirror takes too long. When updating a mirror, Gitea relies on the &lt;code&gt;git remote update&lt;&#x2F;code&gt; command which creates a child process, &lt;code&gt;git-remote-https&lt;&#x2F;code&gt;, to fetch data from the remote repository. Gitea has an internal timeout that will kill the child process (e.g. &lt;code&gt;git remote update&lt;&#x2F;code&gt;) when it takes too long but will not kill the grandchild. This grandchild will become an orphan and run forever or until its own timeout expires, which is about two minutes on git version 2.25.&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;$ time git clone https:&#x2F;&#x2F;4.4.4.4 &lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;$ time git clone https:&#x2F;&#x2F;4.4.4.4
&lt;&#x2F;span&gt;&lt;span&gt;Clonage dans &amp;#39;4.4.4.4&amp;#39;... &lt;&#x2F;span&gt;&lt;span&gt;Clonage dans &amp;#39;4.4.4.4&amp;#39;...
&lt;&#x2F;span&gt;&lt;span&gt;fatal: impossible d&amp;#39;accéder à &amp;#39;https:&#x2F;&#x2F;4.4.4.4&#x2F;&amp;#39;: Failed to connect to 4.4.4.4 port 443: Connexion terminée par expiration du délai d&amp;#39;attente &lt;&#x2F;span&gt;&lt;span&gt;fatal: impossible d&amp;#39;accéder à &amp;#39;https:&#x2F;&#x2F;4.4.4.4&#x2F;&amp;#39;: Failed to connect to 4.4.4.4 port 443: Connexion terminée par expiration du délai d&amp;#39;attente
@ -21,7 +21,7 @@
&lt;&#x2F;span&gt;&lt;span&gt;user 0m0,001s &lt;&#x2F;span&gt;&lt;span&gt;user 0m0,001s
&lt;&#x2F;span&gt;&lt;span&gt;sys 0m0,009s &lt;&#x2F;span&gt;&lt;span&gt;sys 0m0,009s
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt; &lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;As explained in the &lt;a href=&quot;zombies&#x2F;#killing-a-child-process-and-all-its-children&quot;&gt;diagnostic blog post regarding Gitea zombies&lt;&#x2F;a&gt; there fortunately is a very simple way to avoid this by making sure each Gitea child is a &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Process_group&quot;&gt;process group leader&lt;&#x2F;a&gt;. That first step was &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;introduced in Gitea 1.17&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;backported to Gitea 1.16.9&lt;&#x2F;a&gt;. The actual bug fix can now be implemented.&lt;&#x2F;p&gt; &lt;p&gt;As explained in the &lt;a href=&quot;&#x2F;blog&#x2F;zombies&#x2F;#killing-a-child-process-and-all-its-children&quot;&gt;diagnostic blog post regarding Gitea zombies&lt;&#x2F;a&gt; there fortunately is a very simple way to avoid this by making sure each Gitea child is a &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Process_group&quot;&gt;process group leader&lt;&#x2F;a&gt;. That first step was &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;introduced in Gitea 1.17&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;backported to Gitea 1.16.9&lt;&#x2F;a&gt;. The actual bug fix can now be implemented.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;using-negative-process-id-to-kill-children&quot;&gt;Using negative process id to kill children&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-negative-process-id-to-kill-children&quot; aria-label=&quot;Anchor link for: using-negative-process-id-to-kill-children&quot; &lt;h3 id=&quot;using-negative-process-id-to-kill-children&quot;&gt;Using negative process id to kill children&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-negative-process-id-to-kill-children&quot; aria-label=&quot;Anchor link for: using-negative-process-id-to-kill-children&quot;
&gt;&lt;span class=&quot;anchor-icon&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a &gt;&lt;span class=&quot;anchor-icon&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a
&gt; &gt;

View File

@ -12,7 +12,7 @@
<updated>2022-06-04T00:00:00+00:00</updated> <updated>2022-06-04T00:00:00+00:00</updated>
<link href="https://hostea.org/blog/zombies-part-2/" type="text/html"/> <link href="https://hostea.org/blog/zombies-part-2/" type="text/html"/>
<id>https://hostea.org/blog/zombies-part-2/</id> <id>https://hostea.org/blog/zombies-part-2/</id>
<content type="html">&lt;p&gt;Gitea can &lt;a href=&quot;zombies&quot;&gt;create zombies&lt;&#x2F;a&gt;, for instance if a Git mirror takes too long. When updating a mirror, Gitea relies on the &lt;code&gt;git remote update&lt;&#x2F;code&gt; command which creates a child process, &lt;code&gt;git-remote-https&lt;&#x2F;code&gt;, to fetch data from the remote repository. Gitea has an internal timeout that will kill the child process (e.g. &lt;code&gt;git remote update&lt;&#x2F;code&gt;) when it takes too long but will not kill the grandchild. This grandchild will become an orphan and run forever or until its own timeout expires, which is about two minutes on git version 2.25.&lt;&#x2F;p&gt; <content type="html">&lt;p&gt;Gitea can &lt;a href=&quot;&#x2F;blog&#x2F;zombies&quot;&gt;create zombies&lt;&#x2F;a&gt;, for instance if a Git mirror takes too long. When updating a mirror, Gitea relies on the &lt;code&gt;git remote update&lt;&#x2F;code&gt; command which creates a child process, &lt;code&gt;git-remote-https&lt;&#x2F;code&gt;, to fetch data from the remote repository. Gitea has an internal timeout that will kill the child process (e.g. &lt;code&gt;git remote update&lt;&#x2F;code&gt;) when it takes too long but will not kill the grandchild. This grandchild will become an orphan and run forever or until its own timeout expires, which is about two minutes on git version 2.25.&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;$ time git clone https:&#x2F;&#x2F;4.4.4.4 &lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;$ time git clone https:&#x2F;&#x2F;4.4.4.4
&lt;&#x2F;span&gt;&lt;span&gt;Clonage dans &amp;#39;4.4.4.4&amp;#39;... &lt;&#x2F;span&gt;&lt;span&gt;Clonage dans &amp;#39;4.4.4.4&amp;#39;...
&lt;&#x2F;span&gt;&lt;span&gt;fatal: impossible d&amp;#39;accéder à &amp;#39;https:&#x2F;&#x2F;4.4.4.4&#x2F;&amp;#39;: Failed to connect to 4.4.4.4 port 443: Connexion terminée par expiration du délai d&amp;#39;attente &lt;&#x2F;span&gt;&lt;span&gt;fatal: impossible d&amp;#39;accéder à &amp;#39;https:&#x2F;&#x2F;4.4.4.4&#x2F;&amp;#39;: Failed to connect to 4.4.4.4 port 443: Connexion terminée par expiration du délai d&amp;#39;attente
@ -21,7 +21,7 @@
&lt;&#x2F;span&gt;&lt;span&gt;user 0m0,001s &lt;&#x2F;span&gt;&lt;span&gt;user 0m0,001s
&lt;&#x2F;span&gt;&lt;span&gt;sys 0m0,009s &lt;&#x2F;span&gt;&lt;span&gt;sys 0m0,009s
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt; &lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;As explained in the &lt;a href=&quot;zombies&#x2F;#killing-a-child-process-and-all-its-children&quot;&gt;diagnostic blog post regarding Gitea zombies&lt;&#x2F;a&gt; there fortunately is a very simple way to avoid this by making sure each Gitea child is a &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Process_group&quot;&gt;process group leader&lt;&#x2F;a&gt;. That first step was &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;introduced in Gitea 1.17&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;backported to Gitea 1.16.9&lt;&#x2F;a&gt;. The actual bug fix can now be implemented.&lt;&#x2F;p&gt; &lt;p&gt;As explained in the &lt;a href=&quot;&#x2F;blog&#x2F;zombies&#x2F;#killing-a-child-process-and-all-its-children&quot;&gt;diagnostic blog post regarding Gitea zombies&lt;&#x2F;a&gt; there fortunately is a very simple way to avoid this by making sure each Gitea child is a &lt;a href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Process_group&quot;&gt;process group leader&lt;&#x2F;a&gt;. That first step was &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;introduced in Gitea 1.17&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;go-gitea&#x2F;gitea&#x2F;pull&#x2F;19865&quot;&gt;backported to Gitea 1.16.9&lt;&#x2F;a&gt;. The actual bug fix can now be implemented.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;using-negative-process-id-to-kill-children&quot;&gt;Using negative process id to kill children&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-negative-process-id-to-kill-children&quot; aria-label=&quot;Anchor link for: using-negative-process-id-to-kill-children&quot; &lt;h3 id=&quot;using-negative-process-id-to-kill-children&quot;&gt;Using negative process id to kill children&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-negative-process-id-to-kill-children&quot; aria-label=&quot;Anchor link for: using-negative-process-id-to-kill-children&quot;
&gt;&lt;span class=&quot;anchor-icon&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a &gt;&lt;span class=&quot;anchor-icon&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;a
&gt; &gt;