[MongoR] Make createSession increment session count synchronously

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • ALL
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      _runningSessionCount is atomically updated to track the number of sessions currently active.

      However, it is incremented by a per-session thread created in createSession. This means after createSession returns, there may be a window where _runningSessionCount reports 0 while a session really exists.

      Increment the counter in createSession instead.

      That is, src/mongo/replay/session_handler.cpp:55

          std::thread([session = std::move(session), this] {
              ++_runningSessionCount;
      

      becomes:

          ++_runningSessionCount;
          std::thread([session = std::move(session), this] {
      

            Assignee:
            Maddie Zechar
            Reporter:
            James Harrison
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: