Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9223 (new enhancement)

Opened 1 year ago

Last modified 10 months ago

[PATCH] Support opt_read_timeout for MySQL

Reported by: seangeo Assigned to: core
Priority: normal Milestone:
Component: ActiveRecord Version: edge
Severity: normal Keywords: tiny
Cc:

Description

I've added support for specifying a :read_timeout value (in seconds) in the database configuration for the MySQL adapter. This sets the opt_read_timeout option on the MySQL connection which causes the connection to timeout if it waits for longer than read_timeout seconds for a response from the server. This should be useful for catching deadlocks or database problems and failing more gracefully instead of locking up all your application servers too.

I didn't write any tests for it, since I couldn't find anywhere in the code that tested the adapter configuration anyway. I have manually tested it though and the timeout works. It doesn't break any existing tests either. If you would like a real test let me know where to put it.

Cheers

Attachments

support_read_timeout_in_mysql.patch (1.3 kB) - added by seangeo on 08/09/07 08:59:44.

Change History

08/09/07 08:59:44 changed by seangeo

  • attachment support_read_timeout_in_mysql.patch added.

09/09/07 03:01:10 changed by seangeo

  • keywords set to tiny.
  • version changed from 1.2.3 to edge.
  • milestone deleted.

So... how do I get someone to look at this?