-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Service Arch
-
ALL
-
Service Arch 2023-09-18, N&O Prioritized List
-
122
TLConnection::setup takes a callback as argument, that is produced via ConnectionPool::SpecificPool::guardCallback. That producer-function puts a shared_ptr to the SpecificPool in the lambda-capture-list for the returned callback, which means the SpecificPool lifetime will be extended to the lifetime of the callback. Similarly, since the SpecificPool owns a shared_ptr to the parent ConnectionPool, it's lifetime will likewise be extended.
That callback is scheduled here to run after the TLConnection is set-up or a timer expires. However, if the server shuts-down before this process completes, it will cancel the timer, which results in the timer failing to ready the future that results in the callback being scheduled due to an early return here . And nothing in the code insists that the final continuation of AsyncDBClient::connect from TLConnection::setup runs before process-shutdown, which means that the callback may never be scheduled and run. If the callback is therefore leaked, it leaks a shared_ptr to a SpecificPool, which in turn results in a ConnectionPool being leaked.
- is related to
-
SERVER-87037 NetworkInterfaceTL can crash during destruction
- Closed
-
SERVER-81456 Suppress leak sanitizer failures for AsioReactor
- Closed