Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-326

Couchbase client stuck indefinitely in constructor

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.1.5
    • Fix Version/s: 1.2.2
    • Component/s: Core
    • Security Level: Public
    • Labels:
    • Environment:
      Windows, Java app.

      Description

      We recently had some connectivity / responsiveness issues with our Couchbase cluster and we noticed that our automated test suite was stuck for over 12h waiting for CouchbaseClient's constructor to complete, which intern was waiting for channelLatch.await().
      I'm attaching the stack trace of the hanging thread.
      I don't understand the purpose of this latch wait, but perhaps there should be a timeout passed to the await() method, preferably user configurable.

        Issue Links

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          Hide
          dkarlinsky dmitry karlinsky added a comment -

          Another stack trace of - stuck on different countdown latch:
          java.lang.Thread.State: WAITING (parking)
          at sun.misc.Unsafe.park(Native Method)

          • parking to wait for <0x1a934078> (a java.util.concurrent.CountDownLatch$Sync)
            at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
            at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
            at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:905)
            at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1217)
            at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:207)
            at com.couchbase.client.vbucket.BucketUpdateResponseHandler.getReceivedFuture(BucketUpdateResponseHandler.java:147)
            at com.couchbase.client.vbucket.BucketUpdateResponseHandler.getLastResponse(BucketUpdateResponseHandler.java:127)
            at com.couchbase.client.vbucket.BucketMonitor.startMonitor(BucketMonitor.java:220)
            at com.couchbase.client.vbucket.BucketMonitor.startMonitor(BucketMonitor.java:177)
            at com.couchbase.client.vbucket.ConfigurationProviderHTTP.subscribe(ConfigurationProviderHTTP.java:333)
          • locked <0x1a8c4670> (a com.couchbase.client.vbucket.ConfigurationProviderHTTP)
            at com.couchbase.client.CouchbaseClient.<init>(CouchbaseClient.java:247)
            at com.couchbase.client.CouchbaseClient.<init>(CouchbaseClient.java:175)
          Show
          dkarlinsky dmitry karlinsky added a comment - Another stack trace of - stuck on different countdown latch: java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) parking to wait for <0x1a934078> (a java.util.concurrent.CountDownLatch$Sync) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158) at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:905) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1217) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:207) at com.couchbase.client.vbucket.BucketUpdateResponseHandler.getReceivedFuture(BucketUpdateResponseHandler.java:147) at com.couchbase.client.vbucket.BucketUpdateResponseHandler.getLastResponse(BucketUpdateResponseHandler.java:127) at com.couchbase.client.vbucket.BucketMonitor.startMonitor(BucketMonitor.java:220) at com.couchbase.client.vbucket.BucketMonitor.startMonitor(BucketMonitor.java:177) at com.couchbase.client.vbucket.ConfigurationProviderHTTP.subscribe(ConfigurationProviderHTTP.java:333) locked <0x1a8c4670> (a com.couchbase.client.vbucket.ConfigurationProviderHTTP) at com.couchbase.client.CouchbaseClient.<init>(CouchbaseClient.java:247) at com.couchbase.client.CouchbaseClient.<init>(CouchbaseClient.java:175)
          Hide
          daschl Michael Nitschinger added a comment -

          Closing this, because it's a duplicate - kinda - of 368.

          The latch is never counted down on failure and we are running into issues there. The fix in 368 will take care of the deadlock here.

          Show
          daschl Michael Nitschinger added a comment - Closing this, because it's a duplicate - kinda - of 368. The latch is never counted down on failure and we are running into issues there. The fix in 368 will take care of the deadlock here.

            People

            • Assignee:
              daschl Michael Nitschinger
              Reporter:
              dkarlinsky dmitry karlinsky
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes