<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" checked=""> 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" 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" checked=""> 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" checked=""> 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>: 4.4.7 (cliffs)</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="celery report

software -&gt; celery:4.4.7 (cliffs) kombu:4.6.11 py:3.8.12
            billiard:3.6.4.0 py-amqp:2.6.1
platform -&gt; system:Linux arch:64bit
            kernel version:5.10.47-linuxkit imp:CPython
loader   -&gt; celery.loaders.default.Loader
settings -&gt; transport:amqp results:disabled"><pre class="notranslate"><code class="notranslate">celery report

software -&gt; celery:4.4.7 (cliffs) kombu:4.6.11 py:3.8.12
            billiard:3.6.4.0 py-amqp:2.6.1
platform -&gt; system:Linux arch:64bit
            kernel version:5.10.47-linuxkit imp:CPython
loader   -&gt; celery.loaders.default.Loader
settings -&gt; transport:amqp results:disabled
</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="amqp==2.6.1
asgiref==3.4.1
attrs==21.2.0
Babel==2.9.1
billiard==3.6.4.0
boto3==1.14.29
botocore==1.17.63
celery==4.4.7
certifi==2021.5.30
chardet==3.0.4
click==8.0.1
Django==3.2
django-cors-headers==3.4.0
django-environ==0.4.5
django-filter==2.3.0
django-phonenumber-field==4.0.0
django-storages==1.9.1
django-tenants==3.3.0
djangorestframework==3.12.4
djangorestframework-camel-case==1.1.2
djangorestframework-simplejwt==4.6.0
docutils==0.15.2
drf-spectacular==0.14.0
gunicorn==20.0.4
h11==0.12.0
idna==2.10
inflection==0.5.1
jmespath==0.10.0
jsonschema==3.2.0
kombu==4.6.11
newrelic==5.22.0.151
phonenumbers==8.12.2
Pillow==8.1.2
psycopg2==2.8.6
PyJWT==2.1.0
pyrsistent==0.18.0
python-dateutil==2.8.2
pytz==2021.1
PyYAML==5.4.1
requests==2.24.0
s3transfer==0.3.7
six==1.16.0
sqlparse==0.4.2
uritemplate==3.0.1
urllib3==1.25.11
uvicorn==0.14.0
vine==1.3.0"><pre class="notranslate"><code class="notranslate">amqp==2.6.1
asgiref==3.4.1
attrs==21.2.0
Babel==2.9.1
billiard==3.6.4.0
boto3==1.14.29
botocore==1.17.63
celery==4.4.7
certifi==2021.5.30
chardet==3.0.4
click==8.0.1
Django==3.2
django-cors-headers==3.4.0
django-environ==0.4.5
django-filter==2.3.0
django-phonenumber-field==4.0.0
django-storages==1.9.1
django-tenants==3.3.0
djangorestframework==3.12.4
djangorestframework-camel-case==1.1.2
djangorestframework-simplejwt==4.6.0
docutils==0.15.2
drf-spectacular==0.14.0
gunicorn==20.0.4
h11==0.12.0
idna==2.10
inflection==0.5.1
jmespath==0.10.0
jsonschema==3.2.0
kombu==4.6.11
newrelic==5.22.0.151
phonenumbers==8.12.2
Pillow==8.1.2
psycopg2==2.8.6
PyJWT==2.1.0
pyrsistent==0.18.0
python-dateutil==2.8.2
pytz==2021.1
PyYAML==5.4.1
requests==2.24.0
s3transfer==0.3.7
six==1.16.0
sqlparse==0.4.2
uritemplate==3.0.1
urllib3==1.25.11
uvicorn==0.14.0
vine==1.3.0
</code></pre></div>
<p dir="auto"></p>
</details>
<h3 dir="auto">Other Dependencies</h3>

<details>
<p dir="auto">
GDAL 3.2.3
GEOS 3.9.1
Postgres 13.1
Postgis 3.1
Docker/docker-compose
</p>
</details>
<h2 dir="auto">Minimally Reproducible Test Case</h2>

<details>
<p dir="auto">
</p><p dir="auto">When using Postigs with Django, it is <a href="https://docs.djangoproject.com/en/3.2/ref/contrib/gis/install/geolibs/#geos-library-path" rel="nofollow">required to set a couple of variables in <code class="notranslate">settings.py</code></a>, so that Django can detect the required dynamic libs. When we run celery, celery calls <code class="notranslate">django.setup()</code>, but that doesn't register the defined paths, which leads to an import error in Django.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# dlibs for gis
if env.get_value(&quot;GDAL_LIBRARY_PATH&quot;, default=None):
    GDAL_LIBRARY_PATH = env(&quot;GDAL_LIBRARY_PATH&quot;)
if env.get_value(&quot;GEOS_LIBRARY_PATH&quot;, default=None):
    GEOS_LIBRARY_PATH = env(&quot;GEOS_LIBRARY_PATH&quot;)"><pre class="notranslate"><span class="pl-c"># dlibs for gis</span>
<span class="pl-k">if</span> <span class="pl-s1">env</span>.<span class="pl-en">get_value</span>(<span class="pl-s">"GDAL_LIBRARY_PATH"</span>, <span class="pl-s1">default</span><span class="pl-c1">=</span><span class="pl-c1">None</span>):
    <span class="pl-v">GDAL_LIBRARY_PATH</span> <span class="pl-c1">=</span> <span class="pl-en">env</span>(<span class="pl-s">"GDAL_LIBRARY_PATH"</span>)
<span class="pl-k">if</span> <span class="pl-s1">env</span>.<span class="pl-en">get_value</span>(<span class="pl-s">"GEOS_LIBRARY_PATH"</span>, <span class="pl-s1">default</span><span class="pl-c1">=</span><span class="pl-c1">None</span>):
    <span class="pl-v">GEOS_LIBRARY_PATH</span> <span class="pl-c1">=</span> <span class="pl-en">env</span>(<span class="pl-s">"GEOS_LIBRARY_PATH"</span>)</pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>

<p dir="auto">For settings to be configured properly and celery starts normally.</p>
<h1 dir="auto">Actual Behavior</h1>

<p dir="auto">It raises an import error while trying to import the dynamic library, the path of which has been defined in settings.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="celery_1    | Traceback (most recent call last):
celery_1    |   File &quot;/usr/local/bin/celery&quot;, line 8, in &lt;module&gt;
celery_1    |     sys.exit(main())
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/__main__.py&quot;, line 16, in main
celery_1    |     _main()
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/bin/celery.py&quot;, line 322, in main
celery_1    |     cmd.execute_from_commandline(argv)
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/bin/celery.py&quot;, line 499, in execute_from_commandline
celery_1    |     super(CeleryCommand, self).execute_from_commandline(argv)))
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/bin/base.py&quot;, line 305, in execute_from_commandline
celery_1    |     return self.handle_argv(self.prog_name, argv[1:])
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/bin/celery.py&quot;, line 491, in handle_argv
celery_1    |     return self.execute(command, argv)
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/bin/celery.py&quot;, line 415, in execute
celery_1    |     return cls(
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/bin/worker.py&quot;, line 223, in run_from_argv
celery_1    |     return self(*args, **options)
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/bin/base.py&quot;, line 253, in __call__
celery_1    |     ret = self.run(*args, **kwargs)
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/bin/worker.py&quot;, line 253, in run
celery_1    |     worker = self.app.Worker(
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/worker/worker.py&quot;, line 99, in __init__
celery_1    |     self.app.loader.init_worker()
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/loaders/base.py&quot;, line 114, in init_worker
celery_1    |     self.import_default_modules()
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/loaders/base.py&quot;, line 108, in import_default_modules
celery_1    |     raise response
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/utils/dispatch/signal.py&quot;, line 288, in send
celery_1    |     response = receiver(signal=self, sender=sender, **named)
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/fixups/django.py&quot;, line 84, in on_import_modules
celery_1    |     self.worker_fixup.validate_models()
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/fixups/django.py&quot;, line 122, in validate_models
celery_1    |     self.django_setup()
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/celery/fixups/django.py&quot;, line 118, in django_setup
celery_1    |     django.setup()
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/__init__.py&quot;, line 24, in setup
celery_1    |     apps.populate(settings.INSTALLED_APPS)
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/apps/registry.py&quot;, line 114, in populate
celery_1    |     app_config.import_models()
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/apps/config.py&quot;, line 301, in import_models
celery_1    |     self.models_module = import_module(models_module_name)
celery_1    |   File &quot;/usr/local/lib/python3.8/importlib/__init__.py&quot;, line 127, in import_module
celery_1    |     return _bootstrap._gcd_import(name[level:], package, level)
celery_1    |   File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1014, in _gcd_import
celery_1    |   File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 991, in _find_and_load
celery_1    |   File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 975, in _find_and_load_unlocked
celery_1    |   File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 671, in _load_unlocked
celery_1    |   File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 843, in exec_module
celery_1    |   File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django_tenants/models.py&quot;, line 8, in &lt;module&gt;
celery_1    |     from .postgresql_backend.base import _check_schema_name
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django_tenants/postgresql_backend/base.py&quot;, line 19, in &lt;module&gt;
celery_1    |     original_backend = import_module(ORIGINAL_BACKEND + '.base')
celery_1    |   File &quot;/usr/local/lib/python3.8/importlib/__init__.py&quot;, line 127, in import_module
celery_1    |     return _bootstrap._gcd_import(name[level:], package, level)
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/db/backends/postgis/base.py&quot;, line 6, in &lt;module&gt;
celery_1    |     from .features import DatabaseFeatures
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/db/backends/postgis/features.py&quot;, line 1, in &lt;module&gt;
celery_1    |     from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/db/backends/base/features.py&quot;, line 3, in &lt;module&gt;
celery_1    |     from django.contrib.gis.db import models
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/db/models/__init__.py&quot;, line 3, in &lt;module&gt;
celery_1    |     import django.contrib.gis.db.models.functions  # NOQA
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/db/models/functions.py&quot;, line 3, in &lt;module&gt;
celery_1    |     from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/db/models/fields.py&quot;, line 3, in &lt;module&gt;
celery_1    |     from django.contrib.gis import forms, gdal
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/forms/__init__.py&quot;, line 3, in &lt;module&gt;
celery_1    |     from .fields import (  # NOQA
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/forms/fields.py&quot;, line 2, in &lt;module&gt;
celery_1    |     from django.contrib.gis.gdal import GDALException
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/gdal/__init__.py&quot;, line 28, in &lt;module&gt;
celery_1    |     from django.contrib.gis.gdal.datasource import DataSource
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/gdal/datasource.py&quot;, line 40, in &lt;module&gt;
celery_1    |     from django.contrib.gis.gdal.driver import Driver
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/gdal/driver.py&quot;, line 5, in &lt;module&gt;
celery_1    |     from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/gdal/prototypes/ds.py&quot;, line 9, in &lt;module&gt;
celery_1    |     from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
celery_1    |   File &quot;/usr/local/lib/python3.8/site-packages/django/contrib/gis/gdal/libgdal.py&quot;, line 43, in &lt;module&gt;
celery_1    |     raise ImproperlyConfigured(
celery_1    | django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried &quot;gdal&quot;, &quot;GDAL&quot;, &quot;gdal3.1.0&quot;, &quot;gdal3.0.0&quot;, &quot;gdal2.4.0&quot;, &quot;gdal2.3.0&quot;, &quot;gdal2.2.0&quot;, &quot;gdal2.1.0&quot;, &quot;gdal2.0.0&quot;)
. Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings."><pre class="notranslate"><code class="notranslate">celery_1    | Traceback (most recent call last):
celery_1    |   File "/usr/local/bin/celery", line 8, in &lt;module&gt;
celery_1    |     sys.exit(main())
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/__main__.py", line 16, in main
celery_1    |     _main()
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/bin/celery.py", line 322, in main
celery_1    |     cmd.execute_from_commandline(argv)
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/bin/celery.py", line 499, in execute_from_commandline
celery_1    |     super(CeleryCommand, self).execute_from_commandline(argv)))
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/bin/base.py", line 305, in execute_from_commandline
celery_1    |     return self.handle_argv(self.prog_name, argv[1:])
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/bin/celery.py", line 491, in handle_argv
celery_1    |     return self.execute(command, argv)
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/bin/celery.py", line 415, in execute
celery_1    |     return cls(
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/bin/worker.py", line 223, in run_from_argv
celery_1    |     return self(*args, **options)
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/bin/base.py", line 253, in __call__
celery_1    |     ret = self.run(*args, **kwargs)
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/bin/worker.py", line 253, in run
celery_1    |     worker = self.app.Worker(
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/worker/worker.py", line 99, in __init__
celery_1    |     self.app.loader.init_worker()
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/loaders/base.py", line 114, in init_worker
celery_1    |     self.import_default_modules()
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/loaders/base.py", line 108, in import_default_modules
celery_1    |     raise response
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/utils/dispatch/signal.py", line 288, in send
celery_1    |     response = receiver(signal=self, sender=sender, **named)
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/fixups/django.py", line 84, in on_import_modules
celery_1    |     self.worker_fixup.validate_models()
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/fixups/django.py", line 122, in validate_models
celery_1    |     self.django_setup()
celery_1    |   File "/usr/local/lib/python3.8/site-packages/celery/fixups/django.py", line 118, in django_setup
celery_1    |     django.setup()
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
celery_1    |     apps.populate(settings.INSTALLED_APPS)
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/apps/registry.py", line 114, in populate
celery_1    |     app_config.import_models()
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/apps/config.py", line 301, in import_models
celery_1    |     self.models_module = import_module(models_module_name)
celery_1    |   File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
celery_1    |     return _bootstrap._gcd_import(name[level:], package, level)
celery_1    |   File "&lt;frozen importlib._bootstrap&gt;", line 1014, in _gcd_import
celery_1    |   File "&lt;frozen importlib._bootstrap&gt;", line 991, in _find_and_load
celery_1    |   File "&lt;frozen importlib._bootstrap&gt;", line 975, in _find_and_load_unlocked
celery_1    |   File "&lt;frozen importlib._bootstrap&gt;", line 671, in _load_unlocked
celery_1    |   File "&lt;frozen importlib._bootstrap_external&gt;", line 843, in exec_module
celery_1    |   File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django_tenants/models.py", line 8, in &lt;module&gt;
celery_1    |     from .postgresql_backend.base import _check_schema_name
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django_tenants/postgresql_backend/base.py", line 19, in &lt;module&gt;
celery_1    |     original_backend = import_module(ORIGINAL_BACKEND + '.base')
celery_1    |   File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
celery_1    |     return _bootstrap._gcd_import(name[level:], package, level)
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 6, in &lt;module&gt;
celery_1    |     from .features import DatabaseFeatures
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/db/backends/postgis/features.py", line 1, in &lt;module&gt;
celery_1    |     from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/db/backends/base/features.py", line 3, in &lt;module&gt;
celery_1    |     from django.contrib.gis.db import models
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/db/models/__init__.py", line 3, in &lt;module&gt;
celery_1    |     import django.contrib.gis.db.models.functions  # NOQA
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/db/models/functions.py", line 3, in &lt;module&gt;
celery_1    |     from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/db/models/fields.py", line 3, in &lt;module&gt;
celery_1    |     from django.contrib.gis import forms, gdal
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/forms/__init__.py", line 3, in &lt;module&gt;
celery_1    |     from .fields import (  # NOQA
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/forms/fields.py", line 2, in &lt;module&gt;
celery_1    |     from django.contrib.gis.gdal import GDALException
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/gdal/__init__.py", line 28, in &lt;module&gt;
celery_1    |     from django.contrib.gis.gdal.datasource import DataSource
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/gdal/datasource.py", line 40, in &lt;module&gt;
celery_1    |     from django.contrib.gis.gdal.driver import Driver
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/gdal/driver.py", line 5, in &lt;module&gt;
celery_1    |     from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/gdal/prototypes/ds.py", line 9, in &lt;module&gt;
celery_1    |     from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
celery_1    |   File "/usr/local/lib/python3.8/site-packages/django/contrib/gis/gdal/libgdal.py", line 43, in &lt;module&gt;
celery_1    |     raise ImproperlyConfigured(
celery_1    | django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal", "GDAL", "gdal3.1.0", "gdal3.0.0", "gdal2.4.0", "gdal2.3.0", "gdal2.2.0", "gdal2.1.0", "gdal2.0.0")
. Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.
</code></pre></div>
<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" checked=""> 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" 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" checked=""> 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" 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<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" checked=""> 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 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" checked=""> 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" checked=""> 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><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="536326294" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/5868" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/5868/hovercard" href="https://github.com/celery/celery/issues/5868">#5868</a></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><p dir="auto">software -&gt; celery:4.4.1 (cliffs) kombu:4.6.8 py:3.7.4<br>
billiard:3.6.3.0 py-amqp:2.5.2<br>
platform -&gt; system:Linux arch:64bit, ELF<br>
kernel version:3.10.0-957.21.3.el7.x86_64 imp:CPython<br>
loader   -&gt; celery.loaders.default.Loader<br>
settings -&gt; transport:amqp results:disabled</p>
<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>: 4.4.1</li>
<li><strong>Minimal Kombu Version</strong>: N/A or Unknown</li>
<li><strong>Minimal Broker Version</strong>: redis/3.2.12</li>
<li><strong>Minimal Result Backend Version</strong>: redis/3.2.12</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><p dir="auto">amqp==2.5.2<br>
billiard==3.6.3.0<br>
celery==4.4.1<br>
importlib-metadata==1.5.0<br>
kombu==4.6.8<br>
pytz==2019.3<br>
redis==3.4.1<br>
vine==1.3.0<br>
zipp==3.1.0</p>
<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">
app file is task_4_4.py
</p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import time
from celery import Celery
from celery.signals import task_received
from celery.contrib.abortable import AbortableTask
redis_url=&quot;redis://localhost/2&quot;
app=Celery(broker=redis_url,backend=redis_url)
@app.task(bind=True,base=AbortableTask,acks_late=False)
def add(self,x,y):
    time.sleep(x)
    return x+y
@app.task(bind=True)
def mul(self,x,y):
    return x*y"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">time</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-k">from</span> <span class="pl-s1">celery</span>.<span class="pl-s1">signals</span> <span class="pl-k">import</span> <span class="pl-s1">task_received</span>
<span class="pl-k">from</span> <span class="pl-s1">celery</span>.<span class="pl-s1">contrib</span>.<span class="pl-s1">abortable</span> <span class="pl-k">import</span> <span class="pl-v">AbortableTask</span>
<span class="pl-s1">redis_url</span><span class="pl-c1">=</span><span class="pl-s">"redis://localhost/2"</span>
<span class="pl-s1">app</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-s1">redis_url</span>,<span class="pl-s1">backend</span><span class="pl-c1">=</span><span class="pl-s1">redis_url</span>)
<span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-en">task</span>(<span class="pl-s1">bind</span><span class="pl-c1">=</span><span class="pl-c1">True</span>,<span class="pl-s1">base</span><span class="pl-c1">=</span><span class="pl-v">AbortableTask</span>,<span class="pl-s1">acks_late</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)</span>
<span class="pl-k">def</span> <span class="pl-en">add</span>(<span class="pl-s1">self</span>,<span class="pl-s1">x</span>,<span class="pl-s1">y</span>):
    <span class="pl-s1">time</span>.<span class="pl-en">sleep</span>(<span class="pl-s1">x</span>)
    <span class="pl-k">return</span> <span class="pl-s1">x</span><span class="pl-c1">+</span><span class="pl-s1">y</span>
<span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-en">task</span>(<span class="pl-s1">bind</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)</span>
<span class="pl-k">def</span> <span class="pl-en">mul</span>(<span class="pl-s1">self</span>,<span class="pl-s1">x</span>,<span class="pl-s1">y</span>):
    <span class="pl-k">return</span> <span class="pl-s1">x</span><span class="pl-c1">*</span><span class="pl-s1">y</span></pre></div>
<p dir="auto">start worker</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="celery worker -c 1 -l debug -A task_4_4"><pre class="notranslate">celery worker -c 1 -l debug -A task_4_4</pre></div>
<p dir="auto">send tasks to the worker</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from task_4_4 import add
import time
result1=add.delay(18000,11)
time.sleep(7200)
result2=add.delay(10,12)
result3=add.delay(1,13)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">task_4_4</span> <span class="pl-k">import</span> <span class="pl-s1">add</span>
<span class="pl-k">import</span> <span class="pl-s1">time</span>
<span class="pl-s1">result1</span><span class="pl-c1">=</span><span class="pl-s1">add</span>.<span class="pl-en">delay</span>(<span class="pl-c1">18000</span>,<span class="pl-c1">11</span>)
<span class="pl-s1">time</span>.<span class="pl-en">sleep</span>(<span class="pl-c1">7200</span>)
<span class="pl-s1">result2</span><span class="pl-c1">=</span><span class="pl-s1">add</span>.<span class="pl-en">delay</span>(<span class="pl-c1">10</span>,<span class="pl-c1">12</span>)
<span class="pl-s1">result3</span><span class="pl-c1">=</span><span class="pl-s1">add</span>.<span class="pl-en">delay</span>(<span class="pl-c1">1</span>,<span class="pl-c1">13</span>)</pre></div>
<p dir="auto"></p>
</details>
<h1 dir="auto">Expected Behavior</h1>

<p dir="auto">worker executes tasks normally</p>
<h1 dir="auto">Actual Behavior</h1>

<p dir="auto">celery debug output file:</p>
<details>
/root/celery/venv_4/lib/python3.7/site-packages/celery/platforms.py:801: RuntimeWarning: You're running the worker with superuser privileges: this is
absolutely not recommended!
<p dir="auto">Please specify a different user using the --uid option.</p>
<p dir="auto">User information: uid=0 euid=0 gid=0 egid=0</p>
<p dir="auto">uid=uid, euid=euid, gid=gid, egid=egid,<br>
[2020-03-04 23:38:51,487: DEBUG/MainProcess] | Worker: Preparing bootsteps.<br>
[2020-03-04 23:38:51,488: DEBUG/MainProcess] | Worker: Building graph...<br>
[2020-03-04 23:38:51,489: DEBUG/MainProcess] | Worker: New boot order: {Beat, StateDB, Timer, Hub, Pool, Autoscaler, Consumer}<br>
[2020-03-04 23:38:51,498: DEBUG/MainProcess] | Consumer: Preparing bootsteps.<br>
[2020-03-04 23:38:51,498: DEBUG/MainProcess] | Consumer: Building graph...<br>
[2020-03-04 23:38:51,515: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Events, Mingle, Gossip, Tasks, Control, Heart, Agent, event loop}<br>
[2020-03-04 23:38:51,524: DEBUG/MainProcess] | Worker: Starting Hub<br>
[2020-03-04 23:38:51,524: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-04 23:38:51,524: DEBUG/MainProcess] | Worker: Starting Pool<br>
[2020-03-04 23:38:51,537: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-04 23:38:51,537: DEBUG/MainProcess] | Worker: Starting Consumer<br>
[2020-03-04 23:38:51,538: DEBUG/MainProcess] | Consumer: Starting Connection<br>
[2020-03-04 23:38:51,554: INFO/MainProcess] Connected to redis://localhost:6379/2<br>
[2020-03-04 23:38:51,554: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-04 23:38:51,554: DEBUG/MainProcess] | Consumer: Starting Events<br>
[2020-03-04 23:38:51,560: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-04 23:38:51,560: DEBUG/MainProcess] | Consumer: Starting Mingle<br>
[2020-03-04 23:38:51,560: INFO/MainProcess] mingle: searching for neighbors<br>
[2020-03-04 23:38:52,577: INFO/MainProcess] mingle: all alone<br>
[2020-03-04 23:38:52,577: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-04 23:38:52,577: DEBUG/MainProcess] | Consumer: Starting Gossip<br>
[2020-03-04 23:38:52,580: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-04 23:38:52,580: DEBUG/MainProcess] | Consumer: Starting Tasks<br>
[2020-03-04 23:38:52,583: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-04 23:38:52,583: DEBUG/MainProcess] | Consumer: Starting Control<br>
[2020-03-04 23:38:52,585: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-04 23:38:52,586: DEBUG/MainProcess] | Consumer: Starting Heart<br>
[2020-03-04 23:38:52,587: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-04 23:38:52,587: DEBUG/MainProcess] | Consumer: Starting event loop<br>
[2020-03-04 23:38:52,587: DEBUG/MainProcess] | Worker: Hub.register Pool...<br>
[2020-03-04 23:38:52,587: INFO/MainProcess] celery@VM_0_6_centos ready.<br>
[2020-03-04 23:38:52,588: DEBUG/MainProcess] basic.qos: prefetch_count-&gt;4<br>
[2020-03-04 23:39:58,427: INFO/MainProcess] Received task: task_4_4.add[e5e6a491-febf-4bf9-8ff1-d31c0f8b45b5]<br>
[2020-03-04 23:39:58,427: DEBUG/MainProcess] TaskPool: Apply &lt;function _fast_trace_task at 0x7fcd0214b7a0&gt; (args:('task_4_4.add', 'e5e6a491-febf-4bf9-8ff1-d31c0f8b45b5', {'lang': 'py', 'task': 'task_4_4.add', 'id': 'e5e6a491-febf-4bf9-8ff1-d31c0f8b45b5', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'retries': 0, 'timelimit': [None, None], 'root_id': 'e5e6a491-febf-4bf9-8ff1-d31c0f8b45b5', 'parent_id': None, 'argsrepr': '(18000, 11)', 'kwargsrepr': '{}', 'origin': 'gen7195@VM_0_6_centos', 'reply_to': '7f0f5f08-37d3-33c0-8560-6404392956f3', 'correlation_id': 'e5e6a491-febf-4bf9-8ff1-d31c0f8b45b5', 'hostname': 'celery@VM_0_6_centos', 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'args': [18000, 11], 'kwargs': {}}, b'[[18000, 11], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]', 'application/json', 'utf-8') kwargs:{})<br>
[2020-03-04 23:39:58,429: DEBUG/MainProcess] Task accepted: task_4_4.add[e5e6a491-febf-4bf9-8ff1-d31c0f8b45b5] pid:6979<br>
[2020-03-05 01:39:58,530: INFO/MainProcess] Received task: task_4_4.add[692978f1-df60-430e-acaa-87a224624bfc]<br>
[2020-03-05 01:39:58,532: INFO/MainProcess] Received task: task_4_4.add[9dd6a5d2-1efb-41f2-91f8-7da458b6795e]<br>
[2020-03-05 02:40:22,966: INFO/MainProcess] Received task: task_4_4.add[692978f1-df60-430e-acaa-87a224624bfc]<br>
[2020-03-05 02:40:22,967: INFO/MainProcess] Received task: task_4_4.add[9dd6a5d2-1efb-41f2-91f8-7da458b6795e]</p>
<p dir="auto">Restarting celery worker (/root/celery/venv_4/bin/celery worker -c 1 -l debug -A task_4_4)<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Worker: Closing Hub...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Worker: Closing Pool...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Worker: Closing Consumer...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Worker: Stopping Consumer...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Consumer: Closing Connection...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Consumer: Closing Events...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Consumer: Closing Mingle...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Consumer: Closing Gossip...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Consumer: Closing Tasks...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Consumer: Closing Control...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Consumer: Closing Heart...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Consumer: Closing event loop...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Consumer: Stopping event loop...<br>
[2020-03-05 02:54:26,797: DEBUG/MainProcess] | Consumer: Stopping Heart...<br>
[2020-03-05 02:54:26,802: DEBUG/MainProcess] | Consumer: Stopping Control...<br>
[2020-03-05 02:54:26,803: DEBUG/MainProcess] | Consumer: Stopping Tasks...<br>
[2020-03-05 02:54:26,803: DEBUG/MainProcess] Canceling task consumer...<br>
[2020-03-05 02:54:26,803: DEBUG/MainProcess] | Consumer: Stopping Gossip...<br>
[2020-03-05 02:54:26,805: DEBUG/MainProcess] | Consumer: Stopping Mingle...<br>
[2020-03-05 02:54:26,805: DEBUG/MainProcess] | Consumer: Stopping Events...<br>
[2020-03-05 02:54:26,805: DEBUG/MainProcess] | Consumer: Stopping Connection...<br>
[2020-03-05 02:54:26,805: DEBUG/MainProcess] | Worker: Stopping Pool...<br>
[2020-03-05 02:54:27,306: ERROR/MainProcess] Process 'ForkPoolWorker-1' pid:6979 exited with 'exitcode 70'<br>
[2020-03-05 02:54:27,319: ERROR/MainProcess] Task handler raised error: WorkerLostError('Worker exited prematurely: exitcode 70.')<br>
Traceback (most recent call last):<br>
File "/root/celery/venv_4/lib/python3.7/site-packages/celery/worker/worker.py", line 205, in start<br>
self.blueprint.start(self)<br>
File "/root/celery/venv_4/lib/python3.7/site-packages/celery/bootsteps.py", line 119, in start<br>
step.start(parent)<br>
File "/root/celery/venv_4/lib/python3.7/site-packages/celery/bootsteps.py", line 369, in start<br>
return self.obj.start()<br>
File "/root/celery/venv_4/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 318, in start<br>
blueprint.start(self)<br>
File "/root/celery/venv_4/lib/python3.7/site-packages/celery/bootsteps.py", line 119, in start<br>
step.start(parent)<br>
File "/root/celery/venv_4/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 599, in start<br>
c.loop(*c.loop_args())<br>
File "/root/celery/venv_4/lib/python3.7/site-packages/celery/worker/loops.py", line 74, in asynloop<br>
state.maybe_shutdown()<br>
File "/root/celery/venv_4/lib/python3.7/site-packages/celery/worker/state.py", line 80, in maybe_shutdown<br>
raise WorkerShutdown(should_stop)<br>
celery.exceptions.WorkerShutdown: 0</p>
<p dir="auto">During handling of the above exception, another exception occurred:</p>
<p dir="auto">Traceback (most recent call last):<br>
File "/root/celery/venv_4/lib/python3.7/site-packages/billiard/pool.py", line 1267, in mark_as_worker_lost<br>
human_status(exitcode)),<br>
billiard.exceptions.WorkerLostError: Worker exited prematurely: exitcode 70.<br>
[2020-03-05 02:54:27,319: DEBUG/MainProcess] | Worker: Stopping Hub...<br>
[2020-03-05 02:54:27,319: DEBUG/MainProcess] | Consumer: Shutdown Heart...<br>
[2020-03-05 02:54:27,319: DEBUG/MainProcess] | Consumer: Shutdown Control...<br>
[2020-03-05 02:54:27,319: DEBUG/MainProcess] | Consumer: Shutdown Tasks...<br>
[2020-03-05 02:54:27,320: DEBUG/MainProcess] Canceling task consumer...<br>
[2020-03-05 02:54:27,320: DEBUG/MainProcess] Closing consumer channel...<br>
[2020-03-05 02:54:27,320: DEBUG/MainProcess] | Consumer: Shutdown Gossip...<br>
[2020-03-05 02:54:27,320: DEBUG/MainProcess] | Consumer: Shutdown Events...<br>
[2020-03-05 02:54:27,320: DEBUG/MainProcess] | Consumer: Shutdown Connection...<br>
/root/celery/venv_4/lib/python3.7/site-packages/celery/platforms.py:801: RuntimeWarning: You're running the worker with superuser privileges: this is<br>
absolutely not recommended!</p>
<p dir="auto">Please specify a different user using the --uid option.</p>
<p dir="auto">User information: uid=0 euid=0 gid=0 egid=0</p>
<p dir="auto">uid=uid, euid=euid, gid=gid, egid=egid,<br>
[2020-03-05 02:54:27,713: DEBUG/MainProcess] | Worker: Preparing bootsteps.<br>
[2020-03-05 02:54:27,714: DEBUG/MainProcess] | Worker: Building graph...<br>
[2020-03-05 02:54:27,714: DEBUG/MainProcess] | Worker: New boot order: {Beat, Timer, Hub, Pool, Autoscaler, StateDB, Consumer}<br>
[2020-03-05 02:54:27,723: DEBUG/MainProcess] | Consumer: Preparing bootsteps.<br>
[2020-03-05 02:54:27,723: DEBUG/MainProcess] | Consumer: Building graph...<br>
[2020-03-05 02:54:27,740: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Events, Mingle, Tasks, Control, Heart, Agent, Gossip, event loop}<br>
[2020-03-05 02:54:27,749: DEBUG/MainProcess] | Worker: Starting Hub<br>
[2020-03-05 02:54:27,749: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-05 02:54:27,749: DEBUG/MainProcess] | Worker: Starting Pool<br>
[2020-03-05 02:54:27,761: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-05 02:54:27,762: DEBUG/MainProcess] | Worker: Starting Consumer<br>
[2020-03-05 02:54:27,762: DEBUG/MainProcess] | Consumer: Starting Connection<br>
[2020-03-05 02:54:27,777: INFO/MainProcess] Connected to redis://localhost:6379/2<br>
[2020-03-05 02:54:27,778: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-05 02:54:27,778: DEBUG/MainProcess] | Consumer: Starting Events<br>
[2020-03-05 02:54:27,783: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-05 02:54:27,784: DEBUG/MainProcess] | Consumer: Starting Mingle<br>
[2020-03-05 02:54:27,784: INFO/MainProcess] mingle: searching for neighbors<br>
[2020-03-05 02:54:28,800: INFO/MainProcess] mingle: all alone<br>
[2020-03-05 02:54:28,800: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-05 02:54:28,800: DEBUG/MainProcess] | Consumer: Starting Tasks<br>
[2020-03-05 02:54:28,803: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-05 02:54:28,803: DEBUG/MainProcess] | Consumer: Starting Control<br>
[2020-03-05 02:54:28,806: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-05 02:54:28,806: DEBUG/MainProcess] | Consumer: Starting Heart<br>
[2020-03-05 02:54:28,807: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-05 02:54:28,807: DEBUG/MainProcess] | Consumer: Starting Gossip<br>
[2020-03-05 02:54:28,809: DEBUG/MainProcess] ^-- substep ok<br>
[2020-03-05 02:54:28,810: DEBUG/MainProcess] | Consumer: Starting event loop<br>
[2020-03-05 02:54:28,810: DEBUG/MainProcess] | Worker: Hub.register Pool...<br>
[2020-03-05 02:54:28,810: INFO/MainProcess] celery@VM_0_6_centos ready.<br>
[2020-03-05 02:54:28,810: DEBUG/MainProcess] basic.qos: prefetch_count-&gt;4<br>
[2020-03-05 02:54:29,122: INFO/MainProcess] Received task: task_4_4.add[9dd6a5d2-1efb-41f2-91f8-7da458b6795e]<br>
[2020-03-05 02:54:29,122: DEBUG/MainProcess] TaskPool: Apply &lt;function _fast_trace_task at 0x7fc064cac7a0&gt; (args:('task_4_4.add', '9dd6a5d2-1efb-41f2-91f8-7da458b6795e', {'lang': 'py', 'task': 'task_4_4.add', 'id': '9dd6a5d2-1efb-41f2-91f8-7da458b6795e', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'retries': 0, 'timelimit': [None, None], 'root_id': '9dd6a5d2-1efb-41f2-91f8-7da458b6795e', 'parent_id': None, 'argsrepr': '(1, 13)', 'kwargsrepr': '{}', 'origin': 'gen7195@VM_0_6_centos', 'redelivered': True, 'reply_to': '7f0f5f08-37d3-33c0-8560-6404392956f3', 'correlation_id': '9dd6a5d2-1efb-41f2-91f8-7da458b6795e', 'hostname': 'celery@VM_0_6_centos', 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'args': [1, 13], 'kwargs': {}}, b'[[1, 13], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]', 'application/json', 'utf-8') kwargs:{})<br>
[2020-03-05 02:54:29,124: INFO/MainProcess] Received task: task_4_4.add[692978f1-df60-430e-acaa-87a224624bfc]<br>
[2020-03-05 02:54:29,124: DEBUG/MainProcess] Task accepted: task_4_4.add[9dd6a5d2-1efb-41f2-91f8-7da458b6795e] pid:10494<br>
[2020-03-05 02:54:30,128: INFO/ForkPoolWorker-1] Task task_4_4.add[9dd6a5d2-1efb-41f2-91f8-7da458b6795e] succeeded in 1.0049351528286934s: 14<br>
[2020-03-05 02:54:30,128: DEBUG/MainProcess] TaskPool: Apply &lt;function _fast_trace_task at 0x7fc064cac7a0&gt; (args:('task_4_4.add', '692978f1-df60-430e-acaa-87a224624bfc', {'lang': 'py', 'task': 'task_4_4.add', 'id': '692978f1-df60-430e-acaa-87a224624bfc', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'retries': 0, 'timelimit': [None, None], 'root_id': '692978f1-df60-430e-acaa-87a224624bfc', 'parent_id': None, 'argsrepr': '(10, 12)', 'kwargsrepr': '{}', 'origin': 'gen7195@VM_0_6_centos', 'redelivered': True, 'reply_to': '7f0f5f08-37d3-33c0-8560-6404392956f3', 'correlation_id': '692978f1-df60-430e-acaa-87a224624bfc', 'hostname': 'celery@VM_0_6_centos', 'delivery_info': {'exchange': '', 'routing_key': 'celery', 'priority': 0, 'redelivered': None}, 'args': [10, 12], 'kwargs': {}}, b'[[10, 12], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]', 'application/json', 'utf-8') kwargs:{})<br>
[2020-03-05 02:54:30,129: DEBUG/MainProcess] Task accepted: task_4_4.add[692978f1-df60-430e-acaa-87a224624bfc] pid:10494<br>
[2020-03-05 02:54:40,139: INFO/ForkPoolWorker-1] Task task_4_4.add[692978f1-df60-430e-acaa-87a224624bfc] succeeded in 10.010058987885714s: 22</p>
</details>
As the debug output implies, celery worker shutdown 3 hours after it received the first task.