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