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

Possible Deadlock for the Ruby Driver in JRuby under high load

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: 1.4.0
    • Component/s: None
    • 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
          Mario Fernandez

            Assignee:
            kbanker Kyle Banker
            Reporter:
            sirech Mario Fernandez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: