Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Service Arch
-
Fully Compatible
-
ALL
-
Service Arch 2023-04-17
-
18
Description
There is currently a race with shutdown in SessionWorkflow::_scheduleIteration().
As part of _doOneIteration(), the opCtx for each scheduled workItem is created as part of dispatchWork(), and the opCtx is expected to be destroyed as part of acceptResponse(), which is called in a continuation of the above dispatchWork() call.
However, it's possible that we shutdown after calling dispatchWork() and before acceptResponse(), which means we enter cleanupSession() before delisting the opCtx. As part of cleanup, we eventually enter killExhaust() which will create a new opCtx to issue the killCursors command. This causes a tassert to fire since we would be trying to create a new opCtx while one is already registered.