Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to detect and resolve database locks created by a rails application. The steps relate to MySQL but could be adapted for any other backend (e.g. Postgres).


Image Added


...


Table of Contents
stylenone
'

...


1 - Typical Symptoms

Due to long running locks (e.g.: lock while ssh-ing a compute rack which is unavailable), you may one day end up with the following error while trying to save a record:

...

This means that the record is currently locked by a MySQL process.

...

2 - Clearing the lock from the Rails console

You can perform the following in order to kill the offending process:

...