<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 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" 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"> 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>: celery==5.0.5</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>: python 3.8</li>
<li><strong>Minimal Celery Version</strong>: celery==5.0.5</li>
<li><strong>Minimal Kombu Version</strong>: kombu==5.0.2</li>
<li><strong>Minimal Broker Version</strong>: redis:4.0.14</li>
<li><strong>Minimal Result Backend Version</strong>:  redis:4.0.14</li>
<li><strong>Minimal OS and/or Kernel Version</strong>: ubuntu 20.04</li>
<li><strong>Minimal Broker Client Version</strong>: redis==3.5.3</li>
<li><strong>Minimal Result Backend Client Version</strong>: redis==3.5.3</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>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="def test_celery_redis_connection_reset(celery_app):

    # Manual wait so we can have redis up when celery_app fixture is created, but then  shut redis down manually before call to send_task
    input(&quot;waiting for your input ...&quot;)

    # If redis is down, fails immediately with redis.exceptions.ConnectionError instead of retrying
    celery_app.send_task(&quot;ping&quot;)"><pre class="notranslate"><span class="pl-k">def</span> <span class="pl-en">test_celery_redis_connection_reset</span>(<span class="pl-s1">celery_app</span>):

    <span class="pl-c"># Manual wait so we can have redis up when celery_app fixture is created, but then  shut redis down manually before call to send_task</span>
    <span class="pl-en">input</span>(<span class="pl-s">"waiting for your input ..."</span>)

    <span class="pl-c"># If redis is down, fails immediately with redis.exceptions.ConnectionError instead of retrying</span>
    <span class="pl-s1">celery_app</span>.<span class="pl-en">send_task</span>(<span class="pl-s">"ping"</span>)</pre></div>
<details>
<p dir="auto">
</p><p dir="auto">celery_app.send_task doesn't retry to establish connection to redis at all.<br>
There is a retry logic built into celery, and it's being used when creating celery_app pytest fixture, but it's not used in     celery_app.send_task. Why? What could be done to turn it on?</p>
<p dir="auto">I'm using</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    celery_app.conf.broker_transport_options = {
        'retry_policy': {
        'timeout': 5.0
        }
    }"><pre class="notranslate">    <span class="pl-s1">celery_app</span>.<span class="pl-s1">conf</span>.<span class="pl-s1">broker_transport_options</span> <span class="pl-c1">=</span> {
        <span class="pl-s">'retry_policy'</span>: {
        <span class="pl-s">'timeout'</span>: <span class="pl-c1">5.0</span>
        }
    }</pre></div>
<p dir="auto">but that's not honored at all - even when celery_app test fixture tries to establish connection it instead performs up to 20 retries spaced out at 1 seconds interval.</p>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>

<p dir="auto">To be resilient to intermittent connection problems celery client should retry to reestablish connection if it fails the first time.</p>
<h1 dir="auto">Actual Behavior</h1>

<p dir="auto">Celery client fails immediately with redis.exceptions.ConnectionError if connection can't be established on first attempt.</p>
<ul class="contains-task-list">
<li>[x ] I have checked the <a href="https://github.com/celery/celery/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+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" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed fixes.</li>
<li>[x ] 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>[ x] I have included all related issues and possible duplicate issues in this issue<br>
(If there are none, check this box anyway).</li>
</ul>
<h2 dir="auto">Related Issues and Possible Duplicates</h2>

<h4 dir="auto">Related Issues</h4>
<p dir="auto">(actually a pull request)</p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="429072124" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/5437" data-hovercard-type="pull_request" data-hovercard-url="/celery/celery/pull/5437/hovercard" href="https://github.com/celery/celery/pull/5437">#5437</a></li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h1 dir="auto">Description</h1>
<p dir="auto">Correct fix in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="429072124" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/5437" data-hovercard-type="pull_request" data-hovercard-url="/celery/celery/pull/5437/hovercard" href="https://github.com/celery/celery/pull/5437">#5437</a> has been merged yet still shows incorrect migration command on the website. <a href="https://docs.celeryproject.org/en/latest/django/first-steps-with-django.html" rel="nofollow">https://docs.celeryproject.org/en/latest/django/first-steps-with-django.html</a></p>
<h1 dir="auto">Suggestions</h1>
<p dir="auto">Review the web page and make sure the change in the repo is reflected in the website.</p>