#33222 closed Bug (invalid)
MySQL Connection respawns a closed connection before closing (?)
Reported by: | Yuta Okamoto | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 3.1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I found that is_usable()
method for MySQL, which is used in close_if_unusable_or_obsolete()
, calls ping()
method implemented in PyMySQL.
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.
Is it the intentional behavior or not?
Note:
See TracTickets
for help on using tickets.
Django officially supports and recommends
mysqlclient
notPyMySQL
. As far as I'm awaremysqlclient
doesn't reconnect by default.