-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: Acquire on closed pool #1839
Comments
I'm not seeing this, what are you testing this with? |
I had a bloated rabbimq (lots of stuff in /var/lib/rabbitmq...). In the rabbimq logs i had lots of:
Problem is some time later I filled all the disk and had to clean everything up. Didn't reproduce after that. I'll try later to reproduce this, maybe there a way to "drop" connections ( |
This should be fixed |
I'm experiencing this error as well. What was the fix and what version was it in? |
@alewisohn what versions are you using ? |
3.1.7 |
And billiard/kombu ? You could try to upgrade to latest version. |
I'm on the latest of both of those, 3.3.0.16/3.0.4. I will try upgrading to the latest of Celery, which looks like 3.1.10. |
I just started getting this problem today.
My machine's log in /var/log/rabbitmq is showing several of the following entries:
and
The rest are the usual INFO level reports for accepting connections. Using the following (relevant) packages: I recently started using RabbitMQ/celery (and most of what it is dependent on) so please let me know what else would be useful to list; just following the lead of others here. Edit: When running what I believe is effectively identical: |
Looks like we need to reopen. |
What result backend are you using? I'm not able to reproduce here using the rpc result backend.. Please also try to upgrade to the latest 3.1 version |
It has been a bit since I touched the code, but based on my commit history, it looks like I had disabled the results backend at the time; no "backend" argument is passed to Celery(): Will report back w/results of using latest version when I get a chance. |
I'm experiencing this issue too (Acquire on closed pool after few hours of work) with latest celery 3.1.19. -Ofair Various tasks are injected by celerybeat every minute or so, sometimes few tasks together. |
Please include the traceback! |
Sorry, here it is:
Thank you! |
Still happens in latest version 3.1.20... :-(
In other workers, after this initial exception, the exception might be the same or a bit different:
Thank you |
This issue is occurring daily for me now. Rebooting seems to fix it temporarily.
|
Please include some more information, e.g. what broker, result backend, command-line arguments used to start the worker, and worker related configuration. Even better would be a set of steps required to reproduce, as I have yet to see the issue happen in stress testing. |
Django application. Seems to be related to volume. Starting from a reboot it can take hours to reproduce, then happens repeatedly. This is running the same set of steps that work successfully earlier in the day. |
app.conf.update( |
Hi, I am facing similar errors.
This is my config file:
I run into this error every 5-6 days and I have to restart the processes again. |
This issue is keeping me from going live. I can provide webex access to look at this issue and can repeat it regularly. Just saw it scroll past in the logs now. Happens every 2-5 minutes in my current setup. |
If it's an option, you may try changing the broker+backend from RabbitMQ to Redis. |
After receiving this error, my workers get restarted. However, they do not accept any new tasks. Logs shows that heartbeat messages are received but tasks are not accepted. Some part of log:
|
I see similar problem: amqp==1.4.6 Celery: This was working fine until today. [2016-04-21 11:46:56,517: INFO/Worker-1171] deploy_uc() Valid Server. Discovery was successful |
I'm working in the dark here, as I have yet to reproduce the issue. The patch above may or may not fix the issue, but this is the place in the code where the pool is closed after fork. Either the problem is in that code, or alternatively something is keeping a reference to the pool and is that way unaffected by the after fork handling code. Hopefully knowing where to start debugging, could help you finding the source of the problem |
Closing this, as we don't have the resources to complete this task. |
I'm also experiencing this with Celery 4.1 with a RabbitMQ backend. |
@chrisspen Can you please open a new issue with the necessary details to debug this problem? |
Traceback (most recent call last): File "/home/ubuntu/django8/local/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task R = retval = fun(args, kwargs) File "/home/ubuntu/django8/local/lib/python2.7/site-packages/celery/app/trace.py", line 622, in protected_call return self.run(args, *kwargs) File "/home/ubuntu/integra/integra/sunrise/core/config/utils.py", line 59, in inner return func(args,kwargs) File "/home/ubuntu/integra/integra/sunrise/core/config/schedule.py", line 147, in inner return func(args,kwargs) File "/home/ubuntu/integra/integra/sunrise/core/config/schedule.py", line 301, in inner return func(args,kwargs) File "/home/ubuntu/integra/integra/sunrise/cashbook/bookvalues/fileimport.py", line 523, in importfiledata delete_temp_table(task_request_id,True) File "/home/ubuntu/integra/integra/sunrise/core/config/utils.py", line 199, in delete_temp_table running_tasks = i.active() File "/home/ubuntu/django8/local/lib/python2.7/site-packages/celery/app/control.py", line 94, in active return self._request('active') File "/home/ubuntu/django8/local/lib/python2.7/site-packages/celery/app/control.py", line 81, in _request timeout=self.timeout, reply=True, File "/home/ubuntu/django8/local/lib/python2.7/site-packages/celery/app/control.py", line 436, in broadcast limit, callback, channel=channel, File "/home/ubuntu/django8/local/lib/python2.7/site-packages/kombu/pidbox.py", line 315, in _broadcast serializer=serializer) File "/home/ubuntu/django8/local/lib/python2.7/site-packages/kombu/pidbox.py", line 285, in _publish with self.producer_or_acquire(producer, chan) as producer: File "/usr/lib/python2.7/contextlib.py", line 17, in enter return self.gen.next() File "/home/ubuntu/django8/local/lib/python2.7/site-packages/kombu/pidbox.py", line 247, in producer_or_acquire with self.producer_pool.acquire() as producer: File "/home/ubuntu/django8/local/lib/python2.7/site-packages/kombu/resource.py", line 74, in acquire raise RuntimeError('Acquire on closed pool') RuntimeError: Acquire on closed pool |
def delete_temp_table(request_id,old=False): |
@thedrow I fixed this by implementing my own base task that calls Django's
|
I am also having this issue w/redis as backend and broker, using json.
This only happens when we're using the This code path was even in a retry-loop, so in the end it still failed to execute. python2.7, redis, django 1.11, celery 4.0.2. |
Plenty of this happening on our systems running Celery==3.1.18 and kombu==3.0.37 and amqp==1.4.9 with RabbitMQ 3.6.15 as broker and result queue. Doesn't happen every time - just retried a job and it ran fine the second time - exactly the same job, exactly the same arguments to that job. Sometimes restarting RabbitMQ fixes things, but it's hard to tell whether this actually fixes things or whether it's just probability. Traceback out of Sentry looks something like:
Django 1.11 application with the following settings: CELERY_TASK_SERIALIZER = "yaml"
CELERY_RESULT_SERIALIZER = "yaml"
CELERY_RESULT_BACKEND = 'celery.backends.amqp:AMQPBackend'
CELERY_TASK_RESULT_EXPIRES = 300
CELERY_DISABLE_RATE_LIMITS = True
CELERY_MAX_TASKS_PER_CHILD = 1000
CELERY_SEND_EVENTS = False
CELERY_EVENT_QUEUE_EXPIRES = 60 Accompanied by these entries like these in RabbitMQ's logs:
What information or help do you need so that we can debug and fix this, @ask and @thedrow? |
that version is no longer supported. please update to 4.2 series |
continue discussion in #4410 |
The text was updated successfully, but these errors were encountered: