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.

Mysql Deadlock debugging

#250

Deadlocks and lock timeouts can be difficult to debug. This patch updates MysqlAdapter.execute to catch lock errors and print the results of SHOW INNODB STATUS which can help determine the problem.

You can pull the patch from:

http://github.com/mperham/rails/...

Commit c5582f0b82f842af712ae8b9a5efc713bbd736c3

A unit test is included.

Reported by Mike Perham · May 25th, 2008 @ 05:01 PM

State: stale
Milestone: none
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Jeremy Kemper
    Jeremy Kemper

    This command is only available to mysql superusers so log_innodb_status should check for errors.

    Also, could you attach a patch created with git-format-patch? It's much simpler than adding a remote, fetching, cherrypicking a single commit, etc.

    May 25th, 2008 @ 09:38 PM

  2. Mike Perham
    Mike Perham

    Jeremy, sorry I'm not terribly git-fluent. I've pushed a new commit with the error handling you requested to my fork but I don't know the exact patch command to do what you want. tim pope's "how to contribute to rails with git" page doesn't help either. Can you send me the command to emit a patch for a given commit? This prints out nothing:

    git format-patch cb6aa8e8516cef55b81f6a061a3e87c6208cd553

    May 25th, 2008 @ 11:19 PM

  3. Jeremy Kemper
  4. Mike Perham
    Mike Perham

    Thanks for the pointer, Jeremy. Patch attached.

    May 26th, 2008 @ 02:11 AM

  5. Mike Perham
    Mike Perham

    One thing I forgot, the log_innodb_status method should be moved down to the private section.

    May 26th, 2008 @ 02:22 AM

  6. josh
    josh
    • Assigned user set to Jeremy Kemper
    • Tag set to activerecord, patch

    July 17th, 2008 @ 01:56 AM

  7. josh
    josh
    • State changed from new to stale

    Staling out, please reopen if this is still a problem.

    October 28th, 2008 @ 04:26 PM

  8. Richie Vos
    Richie Vos

    I personally still would like this to be included. We're using this patch in production servers as a plugin, but it seems like it's useful enough to be part of Rails core.

    July 24th, 2009 @ 06:11 PM