<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"> 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" checked=""> 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" checked=""> 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" checked=""> 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" checked=""> 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="software -&gt; celery:4.4.7 (cliffs) kombu:4.6.11 py:3.7.3
            billiard:3.6.3.0 redis:3.5.3
platform -&gt; system:Darwin arch:64bit
            kernel version:19.6.0 imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:redis results:redis://127.0.0.1:6379/6"><pre class="notranslate"><code class="notranslate">software -&gt; celery:4.4.7 (cliffs) kombu:4.6.11 py:3.7.3
            billiard:3.6.3.0 redis:3.5.3
platform -&gt; system:Darwin arch:64bit
            kernel version:19.6.0 imp:CPython
loader   -&gt; celery.loaders.app.AppLoader
settings -&gt; transport:redis results:redis://127.0.0.1:6379/6
</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="aiohttp==3.6.2
aioredis==1.3.1
amqp==2.6.1
asgiref==3.3.0
async-timeout==3.0.1
asyncio==3.4.3
attrs==19.3.0
billiard==3.6.3.0
bumpversion==0.5.3
celery==4.4.7
certifi==2020.6.20
chardet==3.0.4
click==7.1.2
click-didyoumean==0.0.3
click-repl==0.1.6
contextlib2==0.5.4
coreapi==2.3.3
coreschema==0.0.4
coverage==4.5.4
deepdiff==4.2.0
Django==3.1.3
django-admin-rangefilter==0.6.3
django-autocomplete-light==3.8.1
django-braces==1.4.0
django-crispy-forms==1.9.2
django-datatable==0.2.1
django-easy-select2==1.2.5
django-endless-pagination==2.0
django-filter==2.4.0
django-ipware==1.1.6
django-jsoneditor==0.1.4
django-multiselectfield==0.1.12
django-recaptcha==1.2.1
django-rest-swagger==2.2.0
django-user-agents==0.3.0
djangorestframework==3.12.1
ecdsa==0.13
emoji==0.5.4
et-xmlfile==1.0.1
future==0.18.2
gunicorn==20.0.4
hiredis==1.1.0
httplib2==0.12.1
idna==2.10
importlib-metadata==1.2.0
itypes==1.2.0
jdcal==1.2
Jinja2==2.11.2
jsonfield==1.0.3
kombu==4.6.11
MarkupSafe==1.1.1
more-itertools==8.5.0
multidict==4.7.6
mysqlclient==1.4.2
numpy==1.19.2
oauth2client==4.1.3
oauthlib==1.1.2
openapi-codec==1.3.2
openpyxl==2.3.5
ordered-set==4.0.2
packaging==19.2
pluggy==0.13.1
prompt-toolkit==3.0.8
py==1.9.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pybitbucket==0.11.1
pyparsing==2.4.7
pytest==5.3.1
pytest-cov==2.8.1
pytest-django==3.7.0
python-dateutil==2.8.1
python-gcm==0.4
pytz==2019.3
PyYAML==3.11
raven==6.10.0
redis==3.5.3
requests==2.24.0
requests-oauthlib==0.7.0
rsa==4.0
sentry-sdk==0.14.4
simplejson==3.6.5
six==1.15.0
sqlparse==0.4.1
supervisor==4.1.0
tqdm==4.11.2
typing-extensions==3.7.4.3
tzlocal==1.3
ua-parser==0.10.0
uritemplate==0.6
urllib3==1.25.11
user-agents==2.2.0
vine==1.3.0
wcwidth==0.2.5
yarl==1.6.2
zipp==3.4.0
"><pre class="notranslate"><code class="notranslate">aiohttp==3.6.2
aioredis==1.3.1
amqp==2.6.1
asgiref==3.3.0
async-timeout==3.0.1
asyncio==3.4.3
attrs==19.3.0
billiard==3.6.3.0
bumpversion==0.5.3
celery==4.4.7
certifi==2020.6.20
chardet==3.0.4
click==7.1.2
click-didyoumean==0.0.3
click-repl==0.1.6
contextlib2==0.5.4
coreapi==2.3.3
coreschema==0.0.4
coverage==4.5.4
deepdiff==4.2.0
Django==3.1.3
django-admin-rangefilter==0.6.3
django-autocomplete-light==3.8.1
django-braces==1.4.0
django-crispy-forms==1.9.2
django-datatable==0.2.1
django-easy-select2==1.2.5
django-endless-pagination==2.0
django-filter==2.4.0
django-ipware==1.1.6
django-jsoneditor==0.1.4
django-multiselectfield==0.1.12
django-recaptcha==1.2.1
django-rest-swagger==2.2.0
django-user-agents==0.3.0
djangorestframework==3.12.1
ecdsa==0.13
emoji==0.5.4
et-xmlfile==1.0.1
future==0.18.2
gunicorn==20.0.4
hiredis==1.1.0
httplib2==0.12.1
idna==2.10
importlib-metadata==1.2.0
itypes==1.2.0
jdcal==1.2
Jinja2==2.11.2
jsonfield==1.0.3
kombu==4.6.11
MarkupSafe==1.1.1
more-itertools==8.5.0
multidict==4.7.6
mysqlclient==1.4.2
numpy==1.19.2
oauth2client==4.1.3
oauthlib==1.1.2
openapi-codec==1.3.2
openpyxl==2.3.5
ordered-set==4.0.2
packaging==19.2
pluggy==0.13.1
prompt-toolkit==3.0.8
py==1.9.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pybitbucket==0.11.1
pyparsing==2.4.7
pytest==5.3.1
pytest-cov==2.8.1
pytest-django==3.7.0
python-dateutil==2.8.1
python-gcm==0.4
pytz==2019.3
PyYAML==3.11
raven==6.10.0
redis==3.5.3
requests==2.24.0
requests-oauthlib==0.7.0
rsa==4.0
sentry-sdk==0.14.4
simplejson==3.6.5
six==1.15.0
sqlparse==0.4.1
supervisor==4.1.0
tqdm==4.11.2
typing-extensions==3.7.4.3
tzlocal==1.3
ua-parser==0.10.0
uritemplate==0.6
urllib3==1.25.11
user-agents==2.2.0
vine==1.3.0
wcwidth==0.2.5
yarl==1.6.2
zipp==3.4.0

</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>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2020-11-09 17:06:42,372: ERROR/ForkPoolWorker-5] Task push_notification.tasks.push_queue_task[11af77b3-e848-4dca-86cf-e4fed0b266bb] raised unexpected: OSError(9, 'Bad file descriptor')
Traceback (most recent call last):
  File &quot;/Users/jgtarikyayla/project/venv/lib/python3.7/site-packages/celery/app/trace.py&quot;, line 412, in trace_task
    R = retval = fun(*args, **kwargs)
  File &quot;/Users/jgtarikyayla/project/venv/lib/python3.7/site-packages/celery/app/trace.py&quot;, line 704, in __protected_call__
    return self.run(*args, **kwargs)
  File &quot;/Users/jgtarikyayla/project/push_notification/tasks.py&quot;, line 147, in push_queue_task
    loop.run_until_complete(push_main())
  File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py&quot;, line 571, in run_until_complete
    self.run_forever()
  File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py&quot;, line 539, in run_forever
    self._run_once()
  File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py&quot;, line 1739, in _run_once
    event_list = self._selector.select(timeout)
  File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/selectors.py&quot;, line 558, in select
    kev_list = self._selector.control(None, max_ev, timeout)
OSError: [Errno 9] Bad file descriptor"><pre class="notranslate"><code class="notranslate">[2020-11-09 17:06:42,372: ERROR/ForkPoolWorker-5] Task push_notification.tasks.push_queue_task[11af77b3-e848-4dca-86cf-e4fed0b266bb] raised unexpected: OSError(9, 'Bad file descriptor')
Traceback (most recent call last):
  File "/Users/jgtarikyayla/project/venv/lib/python3.7/site-packages/celery/app/trace.py", line 412, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/Users/jgtarikyayla/project/venv/lib/python3.7/site-packages/celery/app/trace.py", line 704, in __protected_call__
    return self.run(*args, **kwargs)
  File "/Users/jgtarikyayla/project/push_notification/tasks.py", line 147, in push_queue_task
    loop.run_until_complete(push_main())
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 571, in run_until_complete
    self.run_forever()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
    self._run_once()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
    event_list = self._selector.select(timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/selectors.py", line 558, in select
    kev_list = self._selector.control(None, max_ev, timeout)
OSError: [Errno 9] Bad file descriptor
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# task.py
@task
def push_queue_task():
    print(&quot;Push Service task is received&quot;)
    loop = asyncio.get_event_loop()
    loop.run_until_complete(push_main())


@celeryd_init.connect
def push_init(sender=None, conf=None, **kwargs):
    print(&quot;Push Service is running&quot;)
    push_queue_task.apply_async()
    print(&quot;Push Service is started&quot;)

async def push_main():
    sem = asyncio.Semaphore(5)
    redis_con = await aioredis.create_redis(address=(settings.REDIS_IP, settings.REDIS_PORT),
                                            db=settings.REDIS_DB,
                                            encoding='utf-8')
    while True:
        redis_pop_data = None

        try:
            with await redis_con as conn:
                queue, redis_pop_data = await conn.blpop(RedisConsts.SERVICE_PUSH)
                push_queue_data = json.loads(redis_pop_data)
                ...
        except Exception as e:
            logging.exception(str(e) + &quot; ,  Data from push queue : &quot; + str(redis_pop_data))
"><pre class="notranslate"><code class="notranslate"># task.py
@task
def push_queue_task():
    print("Push Service task is received")
    loop = asyncio.get_event_loop()
    loop.run_until_complete(push_main())


@celeryd_init.connect
def push_init(sender=None, conf=None, **kwargs):
    print("Push Service is running")
    push_queue_task.apply_async()
    print("Push Service is started")

async def push_main():
    sem = asyncio.Semaphore(5)
    redis_con = await aioredis.create_redis(address=(settings.REDIS_IP, settings.REDIS_PORT),
                                            db=settings.REDIS_DB,
                                            encoding='utf-8')
    while True:
        redis_pop_data = None

        try:
            with await redis_con as conn:
                queue, redis_pop_data = await conn.blpop(RedisConsts.SERVICE_PUSH)
                push_queue_data = json.loads(redis_pop_data)
                ...
        except Exception as e:
            logging.exception(str(e) + " ,  Data from push queue : " + str(redis_pop_data))

</code></pre></div>
<p dir="auto">Already tried to upgrade celery version, same result.</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"> 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 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"> 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 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 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"> 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 retries, ETA/Countdown &amp; rate limits disabled.</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 4.2.1</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 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>

<p dir="auto">Im using Celery with a eventlet execution pool and a redis task queue and a redis result backend but im having some trouble because i cant use AsyncResult. I isolate the problem trying to change the way i configure Celery and it is almost sure related to the Eventlet support because before that everything worked.</p>
<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>

<p dir="auto">I would like to use my result backend with celery as i was before adding Eventlet to my project.</p>
<h1 dir="auto">Actual Behavior</h1>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="meta = self._get_task_meta_for(task_id)
AttributeError: 'DisabledBackend' object has no attribute '_get_task_meta_for'"><pre class="notranslate"><code class="notranslate">meta = self._get_task_meta_for(task_id)
AttributeError: 'DisabledBackend' object has no attribute '_get_task_meta_for'
</code></pre></div>