Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#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?

Change History (2)

comment:1 by Mariusz Felisiak, 3 years ago

Resolution: invalid
Status: newclosed

Django officially supports and recommends mysqlclient not PyMySQL. As far as I'm aware mysqlclient doesn't reconnect by default.

comment:2 by Yuta Okamoto, 3 years ago

Ok, thanks for correcting my misunderstanding!

Note: See TracTickets for help on using tickets.
Back to Top