This project is archived and is in readonly mode.

#2544 ✓resolved
Matt Conway

Can't set Mysql timeouts

Reported by Matt Conway | April 22nd, 2009 @ 09:15 PM

Ran into a problem where mysql/OS ran out of memory, didn't die, but didn't actually do anything, so connections to it were still open. As a result, the mysql adapter just hung in the middle of a request to mysql, and no exception was thrown, thereby not triggering our db failover and causing our entire site to come to a screeching halt :)

Here's a patch that exposes mysql timeout config in database.yml

http://github.com/wr0ngway/rails...

If you want to test the effects of this yourself, run the following snippet through runner, with/without the timeouts set. You can simulate the mysql hang by using kill as below to stop/resume the mysql process (osx or linux)

kill -s STOP mysqld_pid kill -s CONT mysqld_pid

while true begin

puts ActiveRecord::Base.connection.execute("select 1 + 1")

rescue

puts "rescued #{$!}"

end sleep 1 end

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages