-
Notifications
You must be signed in to change notification settings - Fork 99
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
Scheduled tasks will not close the connection, causing losing connection to MySQL server during query #73
Comments
I have just run into this issue as well with psql jobstore for django.
I was able to replicate it on wsgi server by letting the backgroundscheduler start, confirming it had a connection entry in the psql server, then rebooting the psql server. The next job that runs throws the error above. All errors afterwards are thrown from jobstores.py trying to use the psql query backend.
|
I met this problems, too ! |
From what I can tell on, if you hit the timeout on the backend, the connection isn't reestablished on the the __reconnect() But I'm not sure if django is supposed to be re-establishing that connection after it's closed and set to None |
I removed the line that sets the connection to None and added connection.reconnect() in __reconnect() It now fails on the job the connection was broken in between and works great afterwards. I think there's a cursor that needs some reconnect logic somewhere that will fix it entirely. |
According to my observation, each scheduled task will have its own database connection, but it will not close the connection by itself after the task ends. When this number of connections reaches a certain number, the program can no longer create new connections, resulting in the inability to perform subsequent tasks.
The text was updated successfully, but these errors were encountered: