For some time now we are getting deadlock; recursive locking errors.
deadlock; recursive locking
I actually even do not know if I have to 'blame' Rack for this.
But I am asking now, because I have found a simmilar issue #349 that was closed 2 months ago.
So I hoped it was solved without applying any of the mentioned gists.
Our setup is
app error: deadlock; recursive locking (ThreadError)
This is most likely caused by one of your middleware dropping the body without calling close on it. The default rails middleware stack should be fine, as should rack-cache. rack-ssl looks ok.
I honestly can't tell if rack-mini-profiler is doing the right thing by browsing the code on github. It has some huge methods with really odd mixes of tabs and spaces, and they have coupled conditional state (one conditional one place in the method should imply that other code in the method doesn't run). I would recommend having a good look in there to see if your app is being called twice in some cases.
Unfortunately your stack trace doesn't include middleware higher in the list, and it's also a problem that typically this error is thrown the request after the request that causes the problem.
We might be able to help more if you post the contents of your config.ru, and the output of rake middleware.
Please reopen if you find an issue somewhere in rack. The ML may also be able to help you track this down faster.
@raggi Just wanted to thank you for quick reply. As it seems now it works after disabling rack-mini-profiler.
I'm having the exact same problem. Here is the output from my rake middleware:
vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:81:in `block in pre_process'
vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/bin/thin:6:in `<top (required)>'
exception is raised occasionally (once in every few days). I'm running app on heroku..
Hi, I am having the same issues, it started moving from thin server to unicorn.
My application is based on Rails, and has currently a procfile that lauches both the server and Sidekiq, and it runs on Heroku.
Switching back to thin server solves the problem, so I think I will stay on thin.
I wanted to switch to unicorn to deploy on Heroku for using only one dynos for the entire application.
I have previously witnessed body close bugs in both airbrake and newrelic, you also seem to have some other unusual middleware in your app. One of these is likely the cause, not the webserver.
Yup... the bug comes from this one:
It overrides the body, and doesn't pass on close, so it is not conformant to the rack spec.