Details
-
Bug
-
Resolution: Won't Do
-
Major - P3
-
None
-
None
-
None
-
None
-
ALL
-
131
Description
We must ensure that a Fetcher may be immediately destroyed after emplacing a value in the Fetcher::_completionPromise. This prevents deadlock since the Fetcher destructor calls shutdown which also acquires the Fetcher::_mutex.
Consider the following snippet:
{
|
auto fetcher = makeFetcherSharedPointer(...);
|
fetcher.onCompletion().thenRunOn(executorWhichRejectsWork).then([fetcher] {
|
// this will never run
|
});
|
}
|
An executor which rejects work (likely due to being shutdown) will never run the completion, and so the fetcher destructor will be run inline with the fulfillment of the future.
Attachments
Issue Links
- related to
-
SERVER-62185 Ensure TenantMigrationRecipentService Fetcher instance survives future completion
-
- Closed
-