com.mongodb.MongoInterruptedException: Interrupted acquiring a permit to retrieve an item from the pool

Google Groups | Alex Paransky | 1 year ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Pool startup error after updating mongo-java-driver from 3.0.3 to 3.2.2

    Google Groups | 1 year ago | Alex Paransky
    com.mongodb.MongoInterruptedException: Interrupted acquiring a permit to retrieve an item from the pool
  2. 0

    I got the following error when updated to java mongo driver 3.2.2: {code} 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] {code} Here is how I create MongoClientOptions: {code} public MongoClientOptions mongoClientOptions() { return MongoClientOptions .builder() .connectionsPerHost(connectionsPerHost) .minConnectionsPerHost(connectionsPerHost) .writeConcern(WriteConcern.SAFE) .readPreference( readFrom == ReadFrom.PRIMARY ? ReadPreference.primary() : ReadPreference.secondary() ) .connectTimeout(connectTimeout) .build(); } {code} If I comment out: {code} .minConnectionsPerHost(connectionsPerHost) {code} 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.

    JIRA | 1 year ago | Alex Paransky
    com.mongodb.MongoInterruptedException: Interrupted acquiring a permit to retrieve an item from the pool
  3. 0

    I got the following error when updated to java mongo driver 3.2.2: {code} 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] {code} Here is how I create MongoClientOptions: {code} public MongoClientOptions mongoClientOptions() { return MongoClientOptions .builder() .connectionsPerHost(connectionsPerHost) .minConnectionsPerHost(connectionsPerHost) .writeConcern(WriteConcern.SAFE) .readPreference( readFrom == ReadFrom.PRIMARY ? ReadPreference.primary() : ReadPreference.secondary() ) .connectTimeout(connectTimeout) .build(); } {code} If I comment out: {code} .minConnectionsPerHost(connectionsPerHost) {code} 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.

    JIRA | 1 year ago | Alex Paransky
    com.mongodb.MongoInterruptedException: Interrupted acquiring a permit to retrieve an item from the pool
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.mongodb.MongoInterruptedException

      Interrupted acquiring a permit to retrieve an item from the pool

      at com.mongodb.internal.connection.ConcurrentPool.acquirePermit()
    2. MongoDB Java Driver
      InternalStreamConnectionInitializer.initializeConnectionDescription
      1. com.mongodb.internal.connection.ConcurrentPool.acquirePermit(ConcurrentPool.java:186)
      2. com.mongodb.internal.connection.ConcurrentPool.get(ConcurrentPool.java:126)
      3. com.mongodb.internal.connection.ConcurrentPool.get(ConcurrentPool.java:109)
      4. com.mongodb.internal.connection.PowerOfTwoBufferPool.getBuffer(PowerOfTwoBufferPool.java:76)
      5. com.mongodb.connection.SocketStream.read(SocketStream.java:81)
      6. com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:503)
      7. com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:221)
      8. com.mongodb.connection.CommandHelper.receiveReply(CommandHelper.java:134)
      9. com.mongodb.connection.CommandHelper.receiveCommandResult(CommandHelper.java:121)
      10. com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32)
      11. com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:83)
      11 frames