Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 705
jpw Avatar asked Jun 13 '13 19:06

jpw


2 Answers

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
like image 110
Jaco Pretorius Avatar answered Nov 09 '22 12:11

Jaco Pretorius


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

like image 45
Ramin Mammadzada Avatar answered Nov 09 '22 12:11

Ramin Mammadzada