删除Rack :: Lock是否安全?

时间:2015-03-16 17:03:50

标签: multithreading ruby-on-rails-3

我定期收到此错误: ThreadError:deadlock;递归锁定。我读过如果使用Unicorn(我是)不需要Rack :: Lock。我可以通过将config.middleware.delete "Rack::Lock"添加到a​​pplication.rb。

来删除它

有没有人对从我的制作应用程序中删除Rack :: Lock是否安全有意见?

供参考,共同的痕迹:

…dor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/lock.rb:14:in `lock'
…dor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/lock.rb:14:in `call'
…bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/deflater.rb:13:in `call'
…/bundle/ruby/2.0.0/gems/rack-ssl-1.3.3/lib/rack/ssl.rb:27:in `call'
…by/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
…by/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
…by/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
…by/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
…by/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
…by/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:552:in `process_client'
…icorn-worker-killer-0.4.2/lib/unicorn/worker_killer.rb:51:in `process_client'
…icorn-worker-killer-0.4.2/lib/unicorn/worker_killer.rb:124:in `process_client'
…by/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:632:in `worker_loop'
…by/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
…by/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:142:in `start'

1 个答案:

答案 0 :(得分:1)

好的,大约一周前我删除了config.middleware.delete "Rack::Lock",似乎一切正常。错误消失了,删除Rack :: Lock没有引起任何问题。