jpw
jpw

Reputation: 19247

what causes 'deadlock; recursive locking' error in a Rails app?

My rails app tracks any delayed_job errors, and we saw this one today for the first time:

deadlock; recursive locking /app/vendor/bundle/ruby/1.9.1/gems/delayed_job-3.0.5/lib/delayed/worker.r

The app has been performing flawlessly, with millions of delayed jobs handled w/o error.

Is this just "one of those random things" or is there something different we can/should do to prevent it from happening again?

I'm especially confused because we run only a single worker.

Our setup: Rails 3.2.12, Heroku app, Postgres, several web dynos but only 1 worker dyno.

Upvotes: 9

Views: 11078

Answers (2)

Ramin Mammadzada
Ramin Mammadzada

Reputation: 367

I had the same issue. The fix was to upgrade rubygems. The way I used to upgrade:

gem update --system

Ref: https://github.com/pry/pry/issues/2137#issuecomment-720775183

Upvotes: 1

Jaco Pretorius
Jaco Pretorius

Reputation: 24840

This is an issue with Rack. See similar bug reports:

  1. https://github.com/rack/rack/issues/658
  2. https://github.com/rack/rack/issues/349

Upvotes: 3

Related Questions