SERVER-67732 introduced shutting down Grid::getExecutorPool() as part of server shutdown as a way to fix memory leaks. However, this can cause a race condition where sharding components that use ScopedTaskExecutor may not be shut down before the parent executor, which makes us hit this invariant as part of server shutdown.
Since having memory leaks during shutdown is more desired than crashing at shutdown, we should skip shutting down the sharding executor pool when TestProctor is enabled. This allows us to get the desired behavior in prod, while also having more manageable BF tracking for this issue since invariants are easier to track than memory leaks.
- is related to
-
SERVER-50612 ScopedTaskExecutor violates the TaskExecutor contract
- Open
-
SERVER-67732 mongod shutdown procedure doesn't shutdown the Grid::getExecutorPool()
- Closed