-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 3.2.0
-
Component/s: Configuration
-
None
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.