Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Rails 4 - Long running sql queries are killed #9907
Rails 4, mysql2 gem (This problem not exists in rails 3.2)
If we run
ActiveRecord::Base.connection.execute("LONG RUNNING SQL")
We will get
Mysql2::Error: Lost connection to MySQL server during query: ...
It occurs in migrations mostly when we are alerting big tables.
I make some investigation and I think the problem is in class Reaper
If we add one of this options:
to database.yml it will solve problem but rails then will be not able to reconnect to database after connection lost.