Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1889

Connection Pool fails to release connection if openAsync fails

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.0
    • Affects Version/s: 3.0.0
    • Labels:
      None
    • Environment:
      Windows 8

      Using async mongo driver I create replica set connection to mongo DB:

      ClusterSettings:
      ClusterType.REPLICA_SET
      ClusterConnectionMode.MULTIPLE

      ConnectionPoolSettings:
      maxSize:1
      minSize:1
      maxWaitTime: 1 sec
      maxWaitQueueSize: 100

      SocketSettings:
      connectTimeout: 100 sec
      readTimeout: 50 millis

      Issue:
      When last connection from pool gets "com.mongodb.MongoSocketReadTimeoutException Timeout while receiving message" no futher connections will be created and all requests will be rejected with "com.mongodb.MongoTimeoutException Timeout waiting for a pooled item after"

      The main idea in my case, to setup read very small read time out and do not wait server response in case it is slow for the moment. But when last connection (only one for test case) gets TimeOut, ConcurrentPool doesn't release semaphore permit.

      Check attached logs

        1. case-1-timeout-first request.txt
          2 kB
        2. case-2-last-connection-timed-out.txt
          3 kB
        3. Test.java
          4 kB

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            dorlov Denis Orlov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: