<h1 dir="auto">Checklist</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues in this issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one message broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue with retries, ETA/Countdown &amp; rate limits disabled.</li>
</ul>
<p dir="auto"><strong>ISSUE</strong><br>
Working with celery 4.2.0 and Redis as broker and backend.</p>
<p dir="auto">Having a task</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@shared_task()
def add(a, b):
    return a+b"><pre class="notranslate"><code class="notranslate">@shared_task()
def add(a, b):
    return a+b
</code></pre></div>
<p dir="auto">And while a worker is active, running the fallowing command:</p>
<p dir="auto"><code class="notranslate">add.apply_async(countdown=60) </code>Results in the task not being registered to the default celery queue, but still being executed after the period of time stated in countdown</p>
<p dir="auto">Why is that, and how can I look for all pending tasks? Doing this would have worked if the task would be registered to the queue:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    with celery_app.pool.acquire(block=True) as conn:
        tasks = conn.default_channel.client.lrange('celery', 0, -1)"><pre class="notranslate"><code class="notranslate">    with celery_app.pool.acquire(block=True) as conn:
        tasks = conn.default_channel.client.lrange('celery', 0, -1)
</code></pre></div>
<p dir="auto">If I terminate the worker while task havent been started I get the fallowing:</p>
<blockquote>
<p dir="auto">[WARNING/MainProcess] Restoring 1 unacknowledged message(s)</p>
</blockquote>
<p dir="auto">This tells me the task is kept somewhere else other then the queue, but why ?</p>
<p dir="auto">We've seen this CI failure sporadically since we fixed the pypy3 CI job. It possible an attribute in a timer is being mocked/assigned incorrectly, or there's just some difference in how pypy3 implements <code class="notranslate">Timer</code> objects (I believe the complaint is about a <code class="notranslate">threading.Timer()</code> object).</p>
<h1 dir="auto">Checklist</h1>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> This has already been asked to the <a href="https://groups.google.com/forum/#!forum/celery-users" rel="nofollow">discussion group</a> first.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have read the relevant section in the<br>
<a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br>
on reporting bugs.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical bug reports.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br>
to find out if the bug was already fixed in the master branch.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all related issues and possible duplicate issues<br>
in this issue (If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Mandatory Debugging Information</h2>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br>
(if you are not able to do this, then at least specify the Celery<br>
version affected).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all the versions of all the external dependencies required<br>
to reproduce this bug.</li>
</ul>
<h2 dir="auto">Optional Debugging Information</h2>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one Python version<br>
and/or implementation.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br>
result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br>
broker and/or result backend.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br>
ETA/Countdown &amp; rate limits disabled.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue after downgrading<br>
and/or upgrading Celery and its dependencies.</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>

<h4 dir="auto">Related Issues</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h2 dir="auto">Environment &amp; Settings</h2>

<p dir="auto"><strong>Celery version</strong>:</p>

<details>
<summary><b><code class="notranslate">celery report</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Steps to Reproduce</h1>
<h2 dir="auto">Required Dependencies</h2>

<ul dir="auto">
<li><strong>Minimal Python Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Celery Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Kombu Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li>
</ul>
<h3 dir="auto">Python Packages</h3>

<details>
<summary><b><code class="notranslate">pip freeze</code> Output:</b></summary>
<p dir="auto">
</p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>

<details>
<p dir="auto">
N/A
</p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>

<details>
<p dir="auto">
</p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>

<h1 dir="auto">Actual Behavior</h1>

<details>
<summary>Output from failed unit tests on pypy</summary>
```
t/unit/worker/test_worker.py::test_Consumer::test_receieve_message_eta_isoformat FAILED [ 97%]
<p dir="auto">t/unit/worker/test_worker.py::test_Consumer::test_receieve_message_eta_isoformat ERROR [ 97%]</p>
<p dir="auto">==================================== ERRORS ====================================</p>
<p dir="auto">____ ERROR at teardown of test_Consumer.test_receieve_message_eta_isoformat ____</p>
<p dir="auto">self = &lt;t.unit.worker.test_worker.test_Consumer object at 0x0000000008936528&gt;</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def teardown(self):"><pre class="notranslate"><code class="notranslate">def teardown(self):
</code></pre></div>
<blockquote>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  self.timer.stop()"><pre class="notranslate"><code class="notranslate">  self.timer.stop()
</code></pre></div>
</blockquote>
<p dir="auto">t/unit/worker/test_worker.py:92:</p>
<hr>
<p dir="auto">self = &lt;Timer(Timer-106, stopped daemon 139665216587520)&gt;</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def stop(self):

    self._is_shutdown.set()

    if self.running:"><pre class="notranslate"><code class="notranslate">def stop(self):

    self._is_shutdown.set()

    if self.running:
</code></pre></div>
<blockquote>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="      self._is_stopped.wait()"><pre class="notranslate"><code class="notranslate">      self._is_stopped.wait()
</code></pre></div>
</blockquote>
<p dir="auto">E           AttributeError: 'bool' object has no attribute 'wait'</p>
<p dir="auto">celery/utils/timer2.py:96: AttributeError</p>
<p dir="auto">=================================== FAILURES ===================================</p>
<p dir="auto">______________ test_Consumer.test_receieve_message_eta_isoformat _______________</p>
<p dir="auto">self = &lt;t.unit.worker.test_worker.test_Consumer object at 0x0000000008936528&gt;</p>
<blockquote>
<p dir="auto">???</p>
</blockquote>
<p dir="auto">t/unit/worker/test_worker.py:417:</p>
<hr>
<p dir="auto">self = &lt;Timer(Timer-106, stopped daemon 139665216587520)&gt;</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def stop(self):

    self._is_shutdown.set()

    if self.running:"><pre class="notranslate"><code class="notranslate">def stop(self):

    self._is_shutdown.set()

    if self.running:
</code></pre></div>
<blockquote>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="      self._is_stopped.wait()"><pre class="notranslate"><code class="notranslate">      self._is_stopped.wait()
</code></pre></div>
</blockquote>
<p dir="auto">E           AttributeError: 'bool' object has no attribute 'wait'</p>
<p dir="auto">celery/utils/timer2.py:96: AttributeError</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;/details&gt;"><pre class="notranslate"><code class="notranslate">&lt;/details&gt;
</code></pre></div></details>