<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 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 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/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" checked=""> 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>
<ul dir="auto">
<li>None</li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h1 dir="auto">Description</h1>
<p dir="auto">The RabbitMQ setting <a href="https://docs.celeryproject.org/en/stable/userguide/configuration.html#task-queue-ha-policy" rel="nofollow">task_queue_ha_policy</a> no longer has any affect, as <a href="https://www.rabbitmq.com/blog/2012/11/19/breaking-things-with-rabbitmq-3-0/" rel="nofollow">described in the release notes for version 3</a>.</p>
<p dir="auto">This was <a href="https://groups.google.com/u/1/g/celery-users/c/hiZPiz2JWo8/m/2_q_Q5sM0BIJ" rel="nofollow">reported to the mailing list here</a> (in 2013!) and the answer then was that it's deprecated and will be removed.</p>
<h1 dir="auto">Suggestions</h1>
<p dir="auto">Remove the configuration parameter and maybe reference the blog post and/or docs on how to set a policy.</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 checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Enhancement%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br>
for similar or identical enhancement to an existing feature.</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%22Issue+Type%3A+Enhancement%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br>
for existing proposed enhancements.</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/commits/master">commit log</a><br>
to find out if the if the same enhancement was already implemented in the<br>
master branch.</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<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>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="552058448" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/5928" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/5928/hovercard" href="https://github.com/celery/celery/issues/5928">#5928</a></li>
</ul>
<h4 dir="auto">Possible Duplicates</h4>
<ul dir="auto">
<li>None</li>
</ul>
<h1 dir="auto">Brief Summary</h1>

<p dir="auto"><code class="notranslate">db.authenticate()</code> is deprecated starting from <a href="https://pymongo.readthedocs.io/en/stable/changelog.html#changes-in-version-3-5" rel="nofollow">pymongo 3.5</a>.</p>
<p dir="auto">It is being used in our backend:</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/celery/celery/blob/ee13eae8e20896beadd89dec8f521bd781522416/celery/backends/mongodb.py#L266-L277">celery/celery/backends/mongodb.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 266 to 277
      in
      <a data-pjax="true" class="commit-tease-sha" href="/celery/celery/commit/ee13eae8e20896beadd89dec8f521bd781522416">ee13eae</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L266" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="266"></td>
          <td id="LC266" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">_get_database</span>(<span class="pl-s1">self</span>): </td>
        </tr>

        <tr class="border-0">
          <td id="L267" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="267"></td>
          <td id="LC267" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s1">conn</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_get_connection</span>() </td>
        </tr>

        <tr class="border-0">
          <td id="L268" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="268"></td>
          <td id="LC268" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-s1">db</span> <span class="pl-c1">=</span> <span class="pl-s1">conn</span>[<span class="pl-s1">self</span>.<span class="pl-s1">database_name</span>] </td>
        </tr>

        <tr class="border-0">
          <td id="L269" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="269"></td>
          <td id="LC269" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-k">if</span> <span class="pl-s1">self</span>.<span class="pl-s1">user</span> <span class="pl-c1">and</span> <span class="pl-s1">self</span>.<span class="pl-s1">password</span>: </td>
        </tr>

        <tr class="border-0">
          <td id="L270" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="270"></td>
          <td id="LC270" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">         <span class="pl-s1">source</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">options</span>.<span class="pl-en">get</span>( </td>
        </tr>

        <tr class="border-0">
          <td id="L271" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="271"></td>
          <td id="LC271" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">             <span class="pl-s">'authsource'</span>, </td>
        </tr>

        <tr class="border-0">
          <td id="L272" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="272"></td>
          <td id="LC272" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">             <span class="pl-s1">self</span>.<span class="pl-s1">database_name</span> <span class="pl-c1">or</span> <span class="pl-s">'admin'</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L273" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="273"></td>
          <td id="LC273" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">         ) </td>
        </tr>

        <tr class="border-0">
          <td id="L274" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="274"></td>
          <td id="LC274" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">         <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-s1">db</span>.<span class="pl-en">authenticate</span>(<span class="pl-s1">self</span>.<span class="pl-s1">user</span>, <span class="pl-s1">self</span>.<span class="pl-s1">password</span>, <span class="pl-s1">source</span><span class="pl-c1">=</span><span class="pl-s1">source</span>): </td>
        </tr>

        <tr class="border-0">
          <td id="L275" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="275"></td>
          <td id="LC275" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">             <span class="pl-k">raise</span> <span class="pl-v">ImproperlyConfigured</span>( </td>
        </tr>

        <tr class="border-0">
          <td id="L276" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="276"></td>
          <td id="LC276" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">                 <span class="pl-s">'Invalid MongoDB username or password.'</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L277" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="277"></td>
          <td id="LC277" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-k">return</span> <span class="pl-s1">db</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">Celery 5.1.0 will introduce official support for Python 3.9 and so we require our dependencies to support it.</p>
<h1 dir="auto">Design</h1>
<p dir="auto">Remove usage of <code class="notranslate">db.authenticate()</code> as we already authenticate when creating the <code class="notranslate">MongoClient</code> instance.</p>
<h2 dir="auto">Architectural Considerations</h2>

<p dir="auto">None as the newer pymongo versions do not drop support for MongoDB versions.</p>
<h2 dir="auto">Proposed Behavior</h2>

<p dir="auto">The backend should behave exactly the same.</p>
<h2 dir="auto">Proposed UI/UX</h2>

<p dir="auto">The same exception should be raised in case of an authentication failure.</p>
<h2 dir="auto">Diagrams</h2>

<p dir="auto">N/A</p>
<h2 dir="auto">Alternatives</h2>

<p dir="auto">None</p>