Lost connection to MySQL server during query
fantik11 opened this issue · 2 comments
Hello, I have bug in my app. I use this library with threading, so I have pool of 50 connections and 1-3 threading running at the same time. After a while my app was running, my threading can't pass data to DB. I decided to look at logs and I founded this error
[Thread-21][2020-07-29 07:10:10] (2013, 'Lost connection to MySQL server during query')
I think this is happened because I didn't use connection in some long time.
How I can fix it?
I think this is commonly caused by: session killed by mysql, related variables maybe wait_timeout
.
And I think this issue is better handled in the final code, or this module should add a peroid check mechanism.
@fantik11 @wrenchonline
There a optional pre-check mechanism in the new version 0.3.5 : pre_ping=False
argument in the get_connection()
method.