Recently, we began experiencing more of these during rolling restarts and 
busy periods.

Sequel::DatabaseDisconnectError: Mysql2::Error::ConnectionError: Lost 
connection to MySQL server during query

Setup
* Sequel multiple databases (Primary/Replicas) are configured
* sequel gem version 5.20.0
* mysql2 gem version 0.5.2
* GCP Cloud SQL MySQL 5.7
* Using Passenger smart spawning
* Passenger concurrency method = process (single threaded)

In reviewing the sequel/passenger docs, the initial attempt to eliminate or 
reduce the errors was to add `DB.disconnect` in config.ru (pre fork) to 
avoid sharing connections between processes. The errors came back though. 
We will test further with the after fork hooks with disconnect.

However, I noticed the errors are alwas on the replica connections. The 
sequel source[1] mentions that all connections will be closed, but do the 
replica connections need to be cleaned up explicitly?

Other things to consider or test out?

https://github.com/jeremyevans/sequel/blob/master/lib/sequel/database/connecting.rb#L197

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" 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/sequel-talk/9e2bad17-5112-423b-a64c-9d6513637053%40googlegroups.com.

Reply via email to