-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: Connection Management
-
None
-
None
-
Java Drivers
-
None
-
None
-
None
-
None
-
None
-
None
DefaultConnectionPool.UsageTrackingInternalConnectionItemFactory.getReasonForClosing is incorrect, and returns ConnectionClosedEvent.Reason.POOL_CLOSED even when the connection is closed because of its lifetime exceeding maxLifeTimeMS.
The maxLifeTimeMS connection string option supported by our driver is non-standard (it's not present in https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.md), so naturally https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md#events does not specify a matching reason value for ConnectionClosedEvent. Given that the specification does not allow introducing driver-specific reason values (I infer this from the "valid values are" wording), we should pick a reason that suits best, which, in my opinion, is ConnectionClosedEvent.Reason.IDLE.