This project is archived and is in readonly mode.
Mysql Deadlock debugging
Reported by Mike Perham | May 25th, 2008 @ 05:01 PM
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.
Comments and changes to this ticket
-
Jeremy Kemper May 25th, 2008 @ 09:38 PM
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.
-
Mike Perham May 25th, 2008 @ 11:19 PM
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
-
Jeremy Kemper May 25th, 2008 @ 11:25 PM
Thanks Mike! Check out http://rails.lighthouseapp.com/p... for the skinny.
-
Mike Perham May 26th, 2008 @ 02:22 AM
One thing I forgot, the log_innodb_status method should be moved down to the private section.
-
josh July 17th, 2008 @ 01:56 AM
- Assigned user set to Jeremy Kemper
- Tag set to activerecord, patch
-
josh October 28th, 2008 @ 04:26 PM
- State changed from new to stale
Staling out, please reopen if this is still a problem.
-
Richie Vos July 24th, 2009 @ 06:11 PM
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.
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>