-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Service Arch
-
ALL
-
Service Arch 2023-08-21, Service Arch 2023-09-04
-
20
An operation-fatal error that kills the opCtx (e.g., a connection failure) while running an exhaust operation can result in creating a new opCtx to cleanup exhaust resources, while the old one is still attached to the client. This triggers a tassert and terminates the connection thread before it can clean up exhaust resources. Consider the following:
- handleRequest notices that the connections is closed, so kills the operation and returns a ConnectionError.
- This translates to calling _onLoopError from here, while the original opCtx associated with WorkItem is still in scope.
- _onLoopError calls into _cleanupSession, which tries to delist the operation but is not successful in this case since it's already killed due to the connection error.
- Next, the thread will call into _cleanupExhaustResources, which attempts to make a new opCtx in order to run killExhaust.
A possible fix is to always destroy the opCtx as part of running _cleanupSession.
- duplicates
-
SERVER-80001 Delist opCtx during ClientDisconnect during getMores
- Closed