<p dir="auto">Logs and details after the comment here <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="9093319" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/1118" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/1118/hovercard?comment_id=16307366&amp;comment_type=issue_comment" href="https://github.com/celery/celery/issues/1118#issuecomment-16307366">#1118 (comment)</a></p>
<p dir="auto">Test code: <a href="https://gist.github.com/ionelmc/4259997">https://gist.github.com/ionelmc/4259997</a></p>
<p dir="auto">I am using Celery version 3.0.19 from pypi (upgraded and tested today). Here are my steps to reproduce:</p>
<p dir="auto">app.py:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from time import sleep
from celery import Celery

celery = Celery(broker=&quot;amqp://&quot;)
celery.conf.update(
        CELERYD_CONCURRENCY=1,
        CELERYD_MAX_TASKS_PER_CHILD=1,
    )

@celery.task
def accept_argument(argument):
    sleep(5)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">time</span> <span class="pl-k">import</span> <span class="pl-s1">sleep</span>
<span class="pl-k">from</span> <span class="pl-s1">celery</span> <span class="pl-k">import</span> <span class="pl-v">Celery</span>

<span class="pl-s1">celery</span> <span class="pl-c1">=</span> <span class="pl-v">Celery</span>(<span class="pl-s1">broker</span><span class="pl-c1">=</span><span class="pl-s">"amqp://"</span>)
<span class="pl-s1">celery</span>.<span class="pl-s1">conf</span>.<span class="pl-en">update</span>(
        <span class="pl-v">CELERYD_CONCURRENCY</span><span class="pl-c1">=</span><span class="pl-c1">1</span>,
        <span class="pl-v">CELERYD_MAX_TASKS_PER_CHILD</span><span class="pl-c1">=</span><span class="pl-c1">1</span>,
    )

<span class="pl-en">@<span class="pl-s1">celery</span>.<span class="pl-s1">task</span></span>
<span class="pl-k">def</span> <span class="pl-en">accept_argument</span>(<span class="pl-s1">argument</span>):
    <span class="pl-en">sleep</span>(<span class="pl-c1">5</span>)</pre></div>
<p dir="auto">script.py:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from app import accept_argument

big_data = &quot;A&quot; * 1024 * 1024 * 8

accept_argument.delay(big_data)
accept_argument.delay(big_data)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">app</span> <span class="pl-k">import</span> <span class="pl-s1">accept_argument</span>

<span class="pl-s1">big_data</span> <span class="pl-c1">=</span> <span class="pl-s">"A"</span> <span class="pl-c1">*</span> <span class="pl-c1">1024</span> <span class="pl-c1">*</span> <span class="pl-c1">1024</span> <span class="pl-c1">*</span> <span class="pl-c1">8</span>

<span class="pl-s1">accept_argument</span>.<span class="pl-en">delay</span>(<span class="pl-s1">big_data</span>)
<span class="pl-s1">accept_argument</span>.<span class="pl-en">delay</span>(<span class="pl-s1">big_data</span>)</pre></div>
<p dir="auto">Run the worker:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ celery worker --app=app -l info"><pre class="notranslate">$ celery worker --app=app -l info</pre></div>
<p dir="auto">Crash the worker:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ python script.py"><pre class="notranslate">$ python script.py</pre></div>
<p dir="auto">Expected result:</p>
<ul dir="auto">
<li>Both tasks are run, in sequence.</li>
<li>The worker (sub)process restarts at the 5 second mark after the first task completes (MAX_TASKS_PER_CHILD=1 reached)</li>
<li>The worker process restarts at the 10 second mark after the second task.</li>
</ul>
<p dir="auto">Actual result:</p>
<ul dir="auto">
<li>The first task runs.</li>
<li>The first worker process goes into a zombie state.</li>
<li>The worker main process hangs in Modules/_billiard/socket_connection.c
<ul dir="auto">
<li>Observe by attaching gdb to the running process.</li>
<li>Presumably the main process is writing the second task to the zombie original worker, but should be writing it to a new worker process.</li>
</ul>
</li>
</ul>
<p dir="auto">I strongly suspect that this is the same problem as issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="6579399" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/957" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/957/hovercard" href="https://github.com/celery/celery/issues/957">#957</a>, but that was closed-presumed-fixed as of version  3.0.13 and I am using a later version of Celery.</p>
<p dir="auto">EDIT: tweaking reproduction code.</p>