maxTimeMS deadline is set after potentially blocking work

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability
    • Fully Compatible
    • ALL
    • Programmability 2025-08-04, Programmability 2025-08-18
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      There is some work that is done on the command path prior to setting the deadline on the opCtx which could potentially have non-trivial latency (e.g. mutex acquisition, see SERVER-99896 and HELP-68909). If this work takes a sufficiently long amount of time, then the user's maxTimeMS will not be respected. We should set the deadline as early as possible, ideally before acquiring any kind of mutex that might have contention on it, to ensure that our deadline is as close to what the user intended as possible.

      https://github.com/10gen/mongo/blob/9455ad301b02dbb77493ea342981e63d137f6e9e/src/mongo/s/commands/strategy.cpp#L612

              Assignee:
              Ronald Steinke
              Reporter:
              Patrick Freed
              Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: