<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"> 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">I am using celery 4.3, and according to it's documentation, the class based tasks are not registered automatically (or autodiscovered) they have to be registered manually : <a href="https://docs.celeryproject.org/en/3.0/whatsnew-4.0.html#the-task-base-class-no-longer-automatically-register-tasks" rel="nofollow">https://docs.celeryproject.org/en/3.0/whatsnew-4.0.html#the-task-base-class-no-longer-automatically-register-tasks</a>. But I see all class based tasks are getting registered in my case automatically. And now when I upgraded to celery 5.1.*, now the class based tasks are not getting registered. So in which version exactly this feature is removed?</p>
<h1 dir="auto">Suggestions</h1>
<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://github.com/celery/celery/discussions">discussions forum</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="https://docs.celeryq.dev/en/master/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" checked=""> 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>: 5.2.7</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="redis.exceptions.ConnectionError: Connection closed by server.
[2022-08-12 14:04:04,481: WARNING/MainProcess] /usr/local/lib/python3.10/site-packages/celery/worker/consumer/consumer.py:367: CPendingDeprecationWarning: 
In Celery 5.1 we introduced an optional breaking change which
on connection loss cancels all currently executed tasks with late acknowledgement enabled.
These tasks cannot be acknowledged as the connection is gone, and the tasks are automatically redelivered back to the queue.
You can enable this behavior using the worker_cancel_long_running_tasks_on_connection_loss setting.
In Celery 5.1 it is set to False by default. The setting will be set to True by default in Celery 6.0.

  warnings.warn(CANCEL_TASKS_BY_DEFAULT, CPendingDeprecationWarning)

[2022-08-12 14:04:04,488: ERROR/MainProcess] consumer: Cannot connect to redis://192.168.10.21:6379/0: Error while reading from 192.168.10.21:6379 : (104, 'Connection reset by peer').
Trying again in 2.00 seconds... (1/100)

[2022-08-12 14:04:04,492: ERROR/MainProcess] [&quot;consumer: Cannot connect to redis://192.168.10.21:6379/0: Error while reading from 192.168.10.21:6379 : (104, 'Connection reset by peer').\nTrying again in 2.00 seconds... (1/100)\n&quot;]
[2022-08-12 14:04:04,493: WARNING/MainProcess] b'[&quot;consumer: Cannot connect to redis://192.168.10.21:6379/0: Error while reading from 192.168.10.21:6379 : (104, \'Connection reset by peer\').\\nTrying again in 2.00 seconds... (1/100)\\n&quot;]'
[2022-08-12 14:04:06,501: INFO/MainProcess] Connected to redis://192.168.10.21:6379/0
[2022-08-12 14:04:06,507: INFO/MainProcess] mingle: searching for neighbors
[2022-08-12 14:04:07,515: INFO/MainProcess] mingle: all alone
[2022-08-12 14:04:12,535: INFO/MainProcess] missed heartbeat from celery@f0e9b74e758d"><pre class="notranslate"><code class="notranslate">redis.exceptions.ConnectionError: Connection closed by server.
[2022-08-12 14:04:04,481: WARNING/MainProcess] /usr/local/lib/python3.10/site-packages/celery/worker/consumer/consumer.py:367: CPendingDeprecationWarning: 
In Celery 5.1 we introduced an optional breaking change which
on connection loss cancels all currently executed tasks with late acknowledgement enabled.
These tasks cannot be acknowledged as the connection is gone, and the tasks are automatically redelivered back to the queue.
You can enable this behavior using the worker_cancel_long_running_tasks_on_connection_loss setting.
In Celery 5.1 it is set to False by default. The setting will be set to True by default in Celery 6.0.

  warnings.warn(CANCEL_TASKS_BY_DEFAULT, CPendingDeprecationWarning)

[2022-08-12 14:04:04,488: ERROR/MainProcess] consumer: Cannot connect to redis://192.168.10.21:6379/0: Error while reading from 192.168.10.21:6379 : (104, 'Connection reset by peer').
Trying again in 2.00 seconds... (1/100)

[2022-08-12 14:04:04,492: ERROR/MainProcess] ["consumer: Cannot connect to redis://192.168.10.21:6379/0: Error while reading from 192.168.10.21:6379 : (104, 'Connection reset by peer').\nTrying again in 2.00 seconds... (1/100)\n"]
[2022-08-12 14:04:04,493: WARNING/MainProcess] b'["consumer: Cannot connect to redis://192.168.10.21:6379/0: Error while reading from 192.168.10.21:6379 : (104, \'Connection reset by peer\').\\nTrying again in 2.00 seconds... (1/100)\\n"]'
[2022-08-12 14:04:06,501: INFO/MainProcess] Connected to redis://192.168.10.21:6379/0
[2022-08-12 14:04:06,507: INFO/MainProcess] mingle: searching for neighbors
[2022-08-12 14:04:07,515: INFO/MainProcess] mingle: all alone
[2022-08-12 14:04:12,535: INFO/MainProcess] missed heartbeat from celery@f0e9b74e758d
</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>: Unknown</li>
<li><strong>Minimal Celery Version</strong>: Unknown</li>
<li><strong>Minimal Kombu Version</strong>: Unknown</li>
<li><strong>Minimal Broker Version</strong>: Unknown</li>
<li><strong>Minimal Result Backend Version</strong>:  Unknown</li>
<li><strong>Minimal OS and/or Kernel Version</strong>:  Unknown</li>
<li><strong>Minimal Broker Client Version</strong>: Unknown</li>
<li><strong>Minimal Result Backend Client Version</strong>: 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="amqp                  5.1.1
APScheduler           3.9.1
async-timeout         4.0.2
baidu-aip             4.16.7
beautifulsoup4        4.11.1
bidict                0.22.0
billiard              3.6.4.0
blinker               1.5
bs4                   0.0.1
cachelib              0.9.0
celery                5.2.7
certifi               2022.6.15
chardet               5.0.0
charset-normalizer    2.1.0
click                 8.1.3
click-didyoumean      0.3.0
click-plugins         1.1.1
click-repl            0.2.0
Deprecated            1.2.13
dill                  0.3.5.1
et-xmlfile            1.1.0
factor-analyzer       0.4.0
Flask                 2.2.1
Flask-APScheduler     1.12.4
Flask-Caching         2.0.1
Flask-Cors            3.0.10
Flask-Excel           0.0.7
hiredis               2.0.0
idna                  3.3
itsdangerous          2.1.2
Jinja2                3.1.2
joblib                1.1.0
kombu                 5.2.4
lml                   0.1.0
Logbook               1.5.3
loguru                0.6.0
lxml                  4.9.1
MarkupSafe            2.1.1
marshmallow           3.17.0
mongoengine           0.24.2
numpy                 1.23.1
openpyxl              3.0.10
packaging             21.3
pandas                1.4.3
pip                   22.2.1
prompt-toolkit        3.0.30
pyexcel               0.7.0
pyexcel-io            0.6.6
pyexcel-webio         0.1.4
pyexcel-xls           0.7.0
pyexcel-xlsx          0.6.0
pymongo               4.2.0
pyparsing             3.0.9
python-dateutil       2.8.2
python-engineio       4.3.4
python-redis-lock     3.7.0
python-socketio       5.7.1
pytz                  2022.1
pytz-deprecation-shim 0.1.0.post0
raven                 6.10.0
redis                 4.3.4
requests              2.28.1
scikit-learn          1.1.2
scipy                 1.9.0
setuptools            63.2.0
six                   1.16.0
soupsieve             2.3.2.post1
supervisor            4.2.4
TA-Lib                0.4.24
texttable             1.6.4
threadpoolctl         3.1.0
tzdata                2022.1
tzlocal               4.2
urllib3               1.26.11
uWSGI                 2.0.20
vine                  5.0.0
wcwidth               0.2.5
websocket-client      1.3.3
Werkzeug              2.2.1
wheel                 0.37.1
wrapt                 1.14.1
xlrd                  2.0.1
xlwt                  1.3.0"><pre class="notranslate"><code class="notranslate">amqp                  5.1.1
APScheduler           3.9.1
async-timeout         4.0.2
baidu-aip             4.16.7
beautifulsoup4        4.11.1
bidict                0.22.0
billiard              3.6.4.0
blinker               1.5
bs4                   0.0.1
cachelib              0.9.0
celery                5.2.7
certifi               2022.6.15
chardet               5.0.0
charset-normalizer    2.1.0
click                 8.1.3
click-didyoumean      0.3.0
click-plugins         1.1.1
click-repl            0.2.0
Deprecated            1.2.13
dill                  0.3.5.1
et-xmlfile            1.1.0
factor-analyzer       0.4.0
Flask                 2.2.1
Flask-APScheduler     1.12.4
Flask-Caching         2.0.1
Flask-Cors            3.0.10
Flask-Excel           0.0.7
hiredis               2.0.0
idna                  3.3
itsdangerous          2.1.2
Jinja2                3.1.2
joblib                1.1.0
kombu                 5.2.4
lml                   0.1.0
Logbook               1.5.3
loguru                0.6.0
lxml                  4.9.1
MarkupSafe            2.1.1
marshmallow           3.17.0
mongoengine           0.24.2
numpy                 1.23.1
openpyxl              3.0.10
packaging             21.3
pandas                1.4.3
pip                   22.2.1
prompt-toolkit        3.0.30
pyexcel               0.7.0
pyexcel-io            0.6.6
pyexcel-webio         0.1.4
pyexcel-xls           0.7.0
pyexcel-xlsx          0.6.0
pymongo               4.2.0
pyparsing             3.0.9
python-dateutil       2.8.2
python-engineio       4.3.4
python-redis-lock     3.7.0
python-socketio       5.7.1
pytz                  2022.1
pytz-deprecation-shim 0.1.0.post0
raven                 6.10.0
redis                 4.3.4
requests              2.28.1
scikit-learn          1.1.2
scipy                 1.9.0
setuptools            63.2.0
six                   1.16.0
soupsieve             2.3.2.post1
supervisor            4.2.4
TA-Lib                0.4.24
texttable             1.6.4
threadpoolctl         3.1.0
tzdata                2022.1
tzlocal               4.2
urllib3               1.26.11
uWSGI                 2.0.20
vine                  5.0.0
wcwidth               0.2.5
websocket-client      1.3.3
Werkzeug              2.2.1
wheel                 0.37.1
wrapt                 1.14.1
xlrd                  2.0.1
xlwt                  1.3.0
</code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>

<details>
<p dir="auto">
using redis as broker
</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="just restart redis-server after celery workers started.

I tested with celery 4.4.7. celery works perfectly."><pre class="notranslate"><span class="pl-s1">just</span> <span class="pl-s1">restart</span> <span class="pl-s1">redis</span><span class="pl-c1">-</span><span class="pl-s1">server</span> <span class="pl-s1">after</span> <span class="pl-s1">celery</span> <span class="pl-s1">workers</span> <span class="pl-s1">started</span>.

<span class="pl-v">I</span> <span class="pl-s1">tested</span> <span class="pl-k">with</span> <span class="pl-s1">celery</span> <span class="pl-c1">4.4</span><span class="pl-c1">.7</span>. <span class="pl-s1">celery</span> <span class="pl-s1">works</span> <span class="pl-s1">perfectly</span>.</pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>

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