This project is archived and is in readonly mode.
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
-
Matt Conway April 22nd, 2009 @ 09:58 PM
Actually, one more to make connection timeouts persist across reconnect
-
Matt Conway April 23rd, 2009 @ 03:28 AM
- Tag changed from activerecord, mysql, timeout to activerecord, mysql, patch, timeout
discovered the contributor guide, here's the patch file against master (edge/3.0)
-
CancelProfileIsBroken August 6th, 2009 @ 02:10 PM
- Tag changed from activerecord, mysql, patch, timeout to activerecord, bugmash, mysql, patch, timeout
-
Rajesh August 9th, 2009 @ 02:54 AM
And by tested I mean, to write a test case. I tested it manually, the options work fine.
-
Repository August 9th, 2009 @ 05:16 PM
- State changed from new to resolved
(from [d3a802cee0f8cbe209af8886f8f8e8cab204d21a]) Allow connect_timeout, read_timeout and write_timeout settings for MySQL [#2544 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com
http://github.com/rails/rails/commit/d3a802cee0f8cbe209af8886f8f8e8... -
Repository August 9th, 2009 @ 05:16 PM
(from [1c9b3aabdd1ff1e5b0e2b9bf6d5149baf6f23d1b]) Allow connect_timeout, read_timeout and write_timeout settings for MySQL [#2544 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com
http://github.com/rails/rails/commit/1c9b3aabdd1ff1e5b0e2b9bf6d5149... -
CancelProfileIsBroken August 9th, 2009 @ 06:54 PM
- Tag changed from activerecord, bugmash, mysql, patch, timeout to activerecord, mysql, patch, timeout
- Milestone cleared.
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>
People watching this ticket
Attachments
Tags
Referenced by
- 2544 Can't set Mysql timeouts (from [d3a802cee0f8cbe209af8886f8f8e8cab204d21a]) Allow c...
- 2544 Can't set Mysql timeouts (from [1c9b3aabdd1ff1e5b0e2b9bf6d5149baf6f23d1b]) Allow c...