com.mongodb.MongoInterruptedException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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.
    via by Alex Paransky,
  • 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.
    via by Alex Paransky,
    • com.mongodb.MongoInterruptedException: Interrupted acquiring a permit to retrieve an item from the pool at com.mongodb.internal.connection.ConcurrentPool.acquirePermit(ConcurrentPool.java:186) at com.mongodb.internal.connection.ConcurrentPool.get(ConcurrentPool.java:126) at com.mongodb.internal.connection.ConcurrentPool.get(ConcurrentPool.java:109) at com.mongodb.internal.connection.PowerOfTwoBufferPool.getBuffer(PowerOfTwoBufferPool.java:76) at com.mongodb.connection.SocketStream.read(SocketStream.java:81) at com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:503) at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:221) at com.mongodb.connection.CommandHelper.receiveReply(CommandHelper.java:134) at com.mongodb.connection.CommandHelper.receiveCommandResult(CommandHelper.java:121) at com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32) at com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:83)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    1 more bugmates