Skip to content

Commit f96a436

Browse files
committed
Added extra reason for a Pooled Connection to be closed
If there is an error then the underlying connection is closed but that was being incorrectly logged.
1 parent 0a6bbfc commit f96a436

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,8 @@ public void close(final UsageTrackingInternalConnection connection) {
483483
reason = "it is past its maximum allowed life time";
484484
} else if (pastMaxIdleTime(connection)) {
485485
reason = "it is past its maximum allowed idle time";
486+
} else if (connection.isClosed()) {
487+
reason = "the underlying connection was closed";
486488
} else {
487489
reason = "the pool has been closed";
488490
}

0 commit comments

Comments
 (0)