Skip to content

Fix for #359 MySQL-OperationalError #370

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

Merged
merged 1 commit into from
Dec 20, 2016
Merged

Fix for #359 MySQL-OperationalError #370

merged 1 commit into from
Dec 20, 2016

Conversation

trunneml
Copy link
Contributor

When the database connection dies (database server crash), the database scheduler of djcelery doesn't close the broken connection for its scheduler update calls. Every 5 seconds an OperationalError: (2006, 'MySQL server has gone away') occurs.

This patches checks the database connection when a DATABASE_ERROR occurs and closes the connection when necessary. The database scheduler reconnects automatically on the next try.

When the database connection dies (database server crash), the database scheduler of djcelery doesn't close the broken connection for its scheduler update calls. Every 5 seconds an OperationalError: (2006, 'MySQL server has gone away') occurs.

This patches checks the database connection when a DATABASE_ERROR occurs and closes the connection when necessary. The database scheduler reconnects automatically on the next try.
@auvipy
Copy link
Member

auvipy commented Aug 16, 2016

@trunneml hi, thanks for the patch, could you check the other PR's related to this issue? they are referenced here. I am going to asses which approach is better.

@trunneml
Copy link
Contributor Author

@auvipy hi, it's been along time since I worked with django-celery. But in my opinion it is best to try to close the db connection in case of an problem. Django will reconnect next time. Don't catching the exception could stop the beat which could be a problem.

My patch is based on the way how django handles such a case, so I prefer my patch. ;-)

@temoto
Copy link

temoto commented Dec 20, 2016

Is there any reason this patch was not merged?

@auvipy auvipy merged commit 00db9b7 into celery:master Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants