Skip to content

Commit cd63e16

Browse files
committed
Ensure the correct value for async pool timeout.
JAVA-3741
1 parent 69ef5be commit cd63e16

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ public void run() {
164164
PooledConnection connection = getPooledConnection(getRemainingWaitTime(), MILLISECONDS);
165165
openAsync(connection, errHandlingCallback);
166166
}
167+
} catch (MongoTimeoutException e) {
168+
Exception exception = new MongoTimeoutException(format("Timeout waiting for a pooled connection after %d %s",
169+
settings.getMaxWaitTime(MILLISECONDS), MILLISECONDS));
170+
emitCheckOutFailedEvent(exception);
171+
errHandlingCallback.onResult(null, exception);
167172
} catch (Throwable t) {
168173
emitCheckOutFailedEvent(t);
169174
errHandlingCallback.onResult(null, t);

0 commit comments

Comments
 (0)