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

Spurious exception logged while ensuring minimum pool size

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.3.0
    • Component/s: Configuration
    • Labels:
      None
    • # Replies:
      9
    • Last comment by Customer:
      true
    • Sprint:
      JVM Sprint 32

      Description

      I got the following error when updated to java mongo driver 3.2.2:

      2016-02-24 07:15:20,383 ws-dashboard WARN [pool-1-thread-1] org.mongodb.driver.connection [SLF4JLogger.java:91] Exception thrown while ensuring minimum pool size
      com.mongodb.MongoInterruptedException: Interrupted acquiring a permit to retrieve an item from the pool 
      	at com.mongodb.internal.connection.ConcurrentPool.acquirePermit(ConcurrentPool.java:186) ~[mongo-java-driver-3.2.2.jar:na]
      	at com.mongodb.internal.connection.ConcurrentPool.get(ConcurrentPool.java:126) ~[mongo-java-driver-3.2.2.jar:na]
      	at com.mongodb.internal.connection.ConcurrentPool.get(ConcurrentPool.java:109) ~[mongo-java-driver-3.2.2.jar:na]
      	at com.mongodb.internal.connection.PowerOfTwoBufferPool.getBuffer(PowerOfTwoBufferPool.java:76) ~[mongo-java-driver-3.2.2.jar:na]
      	at com.mongodb.connection.SocketStream.read(SocketStream.java:81) ~[mongo-java-driver-3.2.2.jar:na]
      	at com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:503) ~[mongo-java-driver-3.2.2.jar:na]
      	at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:221) ~[mongo-java-driver-3.2.2.jar:na]
      	at com.mongodb.connection.CommandHelper.receiveReply(CommandHelper.java:134) ~[mongo-java-driver-3.2.2.jar:na]
      	at com.mongodb.connection.CommandHelper.receiveCommandResult(CommandHelper.java:121) ~[mongo-java-driver-3.2.2.jar:na]
      	at com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32) ~[mongo-java-driver-3.2.2.jar:na]
      	at com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:83) ~[mongo-java-driver-3.2.2.jar:na]
      

      Here is how I create MongoClientOptions:

      public MongoClientOptions mongoClientOptions() {
              return
                  MongoClientOptions
                      .builder()
                      .connectionsPerHost(connectionsPerHost)
                      .minConnectionsPerHost(connectionsPerHost)
                      .writeConcern(WriteConcern.SAFE)
                      .readPreference(
                          readFrom == ReadFrom.PRIMARY
                              ? ReadPreference.primary()
                              : ReadPreference.secondary()
                      )
                      .connectTimeout(connectTimeout)
                      .build();
          }
      

      If I comment out:

      .minConnectionsPerHost(connectionsPerHost)
      

      The exception goes away.

      Tested to work without issues on:
      3.0.2 works
      3.0.4 works
      3.1.1 works

      But switching to 3.2.1 or 3.2.2 causes the exception to be raised.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                1 year, 27 weeks, 2 days ago
                Date of 1st Reply: