Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-348

Possible Deadlock for the Ruby Driver in JRuby under high load



    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
    • Environment:
      JRuby (1.6.2 and 1.6.4)


      The full environment is as follows:

      MongoDB 1.8.2 in a replica set config with 2 machines and one arb.
      A threaded ruby app using JRuby 1.6.4 and connecting to mongo with the 1.4 driver.

      When receiving a high load, the app starts getting occasionally a Mongo::ConnectionFailureError in some threads, then at some point every remaining thread hangs up with a ConnectionFailureError, and then the app is deadlocked. No further request can continue and the app has to be completely restarted.

      A thread dump reveals a lot of threads waiting on synchronize_do blocks. This can be reproduced with enough last. Incrementing the pool size seems only to delay the problem, but not fix it.

      This is a problem with both the 1.4.0 and 1.4.1 versions, in a live environment and in a test system. The 1.3.1 driver does not have this problem.


        1. trace
          76 kB



            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: