Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Can't set Mysql timeouts

#2544

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

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

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Matt Conway
    Matt Conway

    Actually, one more to make connection timeouts persist across reconnect

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

    April 22nd, 2009 @ 09:58 PM

  2. Matt Conway
    Matt Conway
    • 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)

    April 23rd, 2009 @ 03:28 AM

  3. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from activerecord, mysql, patch, timeout to activerecord, bugmash, mysql, patch, timeout

    August 6th, 2009 @ 02:10 PM

  4. Rajesh
    Rajesh

    verified

    I am not sure how it can be tested though

    August 9th, 2009 @ 02:54 AM

  5. Rajesh
    Rajesh

    And by tested I mean, to write a test case. I tested it manually, the options work fine.

    August 9th, 2009 @ 02:54 AM

  6. Rizwan Reza
    Rizwan Reza

    verified

    This works... but a test would be great.

    August 9th, 2009 @ 05:04 PM

  7. Repository
    Repository
    • State changed from new to resolved

    (from [d3a802cee0f8cbe209af8886f8f8e8cab204d21a]) Allow connect_timeout, read_timeout and write_timeout settings for MySQL [#2544 Can't set Mysql timeouts state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com
    http://github.com/rails/rails/commit/d3a802cee0f8cbe209af8886f8f8e8...

    August 9th, 2009 @ 05:16 PM

  8. Repository
  9. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from activerecord, bugmash, mysql, patch, timeout to activerecord, mysql, patch, timeout
    • Milestone cleared.

    August 9th, 2009 @ 06:54 PM

  10. bingbing
  11. af001
    af001

    私の中で、総合評価のとっても低いアバアバクロホリスタークロ銀座店。アバクロは大好きなんですけどね。一昨日の東京駅付近での打ち合わせの後、散歩がてら久々に行ってきました。そしたらビックリ!相変わらアバクロず、踊っているだけの店員さんとかもいましたが、

    May 5th, 2011 @ 02:56 AM