-
Notifications
You must be signed in to change notification settings - Fork 56
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
Django OperationalError: the connection is closed #1134
Comments
I had something similar in a long-running task. After some time, the Django database connection times out, and that error occurs. I worked around this issue by calling |
Thank you for the advice, I'll try using the same approach. |
@paulzakin recently asked something on |
@nicokant Is the problem solved by |
We switched to using the database pool introduced in Django 5.1 - which seems to work well. Worth a shot for anyone else |
The release 2.13.0 (until 2.13.2) doesn't work anymore with the new connection pool of Django 5.1. connection = self.pool.getconn() raises a PoolTimeout. |
@stephane Since 2.13.0, we run a sync task in its own thread (otherwise, sync tasks would block each other in concurrency mode as all run in the main thread). Where do you initialize the |
Hello friends! Unfortunately I also stumbled upon this error. :( I have added
to my django database connection but I still get this error! It seems that when I start the worker it is fine but after some time (haven't tested how much time) it breaks and gives me error:
Is there a way to fix / improve this ? If not, is there a way to check if the connection is closed and re-open it ? TIA |
I have a django application using procrastinate with the following dependencies:
When I start the worker it works fine, but after some time I start getting this error
Logs:
I'm running the worker using the following command:
The text was updated successfully, but these errors were encountered: