#35812: 2006 'MySQL server has gone away' error after idle period in Django app
polling Kafka
-------------------------------------+-------------------------------------
Reporter: Adithya Kaade | Owner: (none)
Arvind |
Type: Bug | Status: new
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: 2006 'MySQL server | Triage Stage:
has gone away' | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by famagusta):
As per the source code for MySQL backend, the is_usable method doesn't
check connection health
https://github.com/django/django/blob/main/django/db/backends/mysql/base.py
But the postgres backend does. I wonder why the difference.
Also, as per mysqlclient documentation, the use of ping function (in
is_usable) can take reconnection arguments
https://dev.mysql.com/doc/connector-python/en/connector-python-api-
mysqlconnection-ping.html
would this solve the issue?
--
Ticket URL: <https://code.djangoproject.com/ticket/35812#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701925604225a-b0a3290c-df35-4bf9-8c0b-2940119cf4c4-000000%40eu-central-1.amazonses.com.