'LifoQueue' object has no attribute 'mutex' when running gunicorn with eventlet and broker_pool_limit = 0
See original GitHub issueI have this bug the first time I try to post a task with Celery from an API call:
Traceback (most recent call last):
File "/home/fga/workspace/kombu_eventlet_bug/.virtualenv/lib/python3.4/site-packages/gunicorn/workers/async.py", line 56, in handle
self.handle_request(listener_name, req, client, addr)
File "/home/fga/workspace/kombu_eventlet_bug/.virtualenv/lib/python3.4/site-packages/gunicorn/workers/async.py", line 107, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/home/fga/workspace/kombu_eventlet_bug/wsgi.py", line 18, in app
add.delay(1,2)
File "/home/fga/workspace/kombu_eventlet_bug/.virtualenv/lib/python3.4/site-packages/celery/app/task.py", line 412, in delay
return self.apply_async(args, kwargs)
File "/home/fga/workspace/kombu_eventlet_bug/.virtualenv/lib/python3.4/site-packages/celery/app/task.py", line 535, in apply_async
**options
File "/home/fga/workspace/kombu_eventlet_bug/.virtualenv/lib/python3.4/site-packages/celery/app/base.py", line 734, in send_task
with self.producer_or_acquire(producer) as P:
File "/home/fga/workspace/kombu_eventlet_bug/.virtualenv/lib/python3.4/site-packages/celery/app/base.py", line 863, in producer_or_acquire
producer, self.producer_pool.acquire, block=True,
File "/home/fga/workspace/kombu_eventlet_bug/.virtualenv/lib/python3.4/site-packages/celery/app/base.py", line 1232, in producer_pool
return self.amqp.producer_pool
File "/home/fga/workspace/kombu_eventlet_bug/.virtualenv/lib/python3.4/site-packages/celery/app/amqp.py", line 610, in producer_pool
self._producer_pool.limit = self.app.pool.limit
File "/home/fga/workspace/kombu_eventlet_bug/.virtualenv/lib/python3.4/site-packages/celery/app/base.py", line 1147, in pool
pools.set_limit(limit)
File "/home/fga/workspace/kombu_eventlet_bug/.virtualenv/lib/python3.4/site-packages/kombu/pools.py", line 137, in set_limit
pool.resize(limit)
File "/home/fga/workspace/kombu_eventlet_bug/.virtualenv/lib/python3.4/site-packages/kombu/resource.py", line 188, in resize
self._shrink_down()
File "/home/fga/workspace/kombu_eventlet_bug/.virtualenv/lib/python3.4/site-packages/kombu/resource.py", line 193, in _shrink_down
with resource.mutex:
AttributeError: 'LifoQueue' object has no attribute 'mutex'
It seems to be because when gunicorn uses eventlet, the base class that is picked up is ‘eventlet.green.Queue.LifoQueue’ instead of the standard python one. It only happens if I set broker_pool_limit = 0.
I’ve set up a project to isolate and reproduce the bug: https://github.com/fgaudin/kombu_eventlet_bug
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
'LifoQueue' object has no attribute 'put' selenium webdriver ...
Solution: This error "AttributeError: 'LifoQueue' object has no attribute 'put' selenium webdriver" is caused by having in your working ...
Read more >'LifoQueue' object has no attribute 'put' selenium webdriver
Error message when running the code : The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that ......
Read more >AttributeError: 'LifoQueue' object has no attri...anycodings
Solution: This error "AttributeError: 'LifoQueue' anycodings_selenium object has no attribute 'put' selenium anycodings_selenium webdriver" ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any update on this? I’m running into the same issue.
could you please manually verify this patch https://github.com/celery/kombu/pull/916 ?