-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Service Arch
-
Fully Compatible
-
ALL
-
Service Arch 2024-03-04, Service Arch 2024-03-18
-
104
AsioReactor allows tasks to be scheduled even while/after it is stopped. Tasks scheduled during the dropping will be drained, but those scheduled after draining is complete will just never be executed.
NetworkInterfaceTL schedules work on the reactor after making it a GuaranteedExecutor, so if the above case is ever hit, an invariant will be triggered during the destruction, as the submitted task was never scheduled.
See BF-31784 for more context.
To fix this, we can check to see if the reactor has been stopped in AsioReactor::schedule, and if so execute the task with a cancellation status, rather than posting it to the io_context. This is similar to other existing task executors: https://github.com/10gen/mongo/blob/master/src/mongo/executor/network_interface_thread_pool.cpp#L113-L118
- related to
-
SERVER-78958 Setting up TLConnection concurrently with shutdown can result in leaking a ConnectionPool
- Open
-
SERVER-87564 AsioReactor doesn't drain all work
- Open