-
Type:
Task
-
Resolution: Works as Designed
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Replication
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Background
IntentRegistry::killConflictingOperations (src/mongo/db/repl/intent_registry.cpp) runs the kill-and-drain work on a std::async(std::launch::async, ...) thread and returns a std::future<ReplicationStateTransitionGuard>. Evaluate replacing std::async with our internal library stdx::thread, and decide whether the differences in behavior are acceptable.
Proposed change (to be evaluated)
Replace std::async with a stdx::thread plus a std::promise<ReplicationStateTransitionGuard>. By keeping public return type std::future, callers will stay unaffected. SERVER-137356 introduced a SigAltStackController workaround, which can be removed at this point.
Acceptance Criteria
- Evaluate the behavioral differences between std::async and stdx::thread; understand(and mitigate as needed) the implications of switching to stdx::thread.
- A std::async future blocks in its destructor until the thread finishes, but stdx does not.
- std::async captures exceptions in the future, stdx would need to try/catch
- Consider having server programmability look over this change
- Run a sys-perf patch to confirm this change isn't a perf regression
- is related to
-
SERVER-137356 Allow passing fassertOnLockTimeoutForStepUpDown to replSetStepDown to override RSTL timeout
-
- Closed
-