#33222: MySQL Connection respawns a closed connection before closing (?)
-------------------------------------+-------------------------------------
Reporter: Yuta | Owner: nobody
Okamoto |
Type: Bug | Status: new
Component: Database | Version: 3.1
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I found that `is_usable()` method for MySQL, which is used in
`close_if_unusable_or_obsolete()`, calls `ping()` method implemented in
PyMySQL.
-
https://github.com/django/django/blob/306607d5b99b6eca6ae2c1e726d8eb32b9b2ca1b/django/db/backends/base/base.py#L528
But it has `reconnect` as a parameter and its default is `True`, so it
seems it automatically reconnects to the DB even when the original
connection is unusable and will be closed right after the reconnection.
-
https://github.com/PyMySQL/PyMySQL/blob/78f0cf99e5d5351df0821442e4dc35c49a6390c6/pymysql/connections.py#L561
Is it the intentional behavior or not?
--
Ticket URL: <https://code.djangoproject.com/ticket/33222>
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/050.0a9b8bc40c5e05abca14e2f32a5bc119%40djangoproject.com.