Skip to content

Commit 9802eb3

Browse files
committed
Release the usage connection when failing in openAsync
JAVA-1889
1 parent 62babe9 commit 9802eb3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

driver-core/src/main/com/mongodb/connection/DefaultConnectionPool.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ public void onResult(final Void result, final Throwable t) {
186186
pooledConnection.getDescription().getConnectionId(), serverId));
187187
}
188188
callback.onResult(null, t);
189+
pool.release(pooledConnection.wrapped, true);
189190
} else {
190191
if (LOGGER.isTraceEnabled()) {
191192
LOGGER.trace(String.format("Pooled connection %s to server %s is now open",

0 commit comments

Comments
 (0)