Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-89694

Add synchronization to AsioSessionManager::_rejectedSessions

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc4
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Fully Compatible
    • ALL
    • v8.0
    • Service Arch 2024-04-29
    • 139

      AsioSessionManager::_rejectedSessions is currently used

      1) Inside SessionManagerCommon::startSession. A sync token is acquired (which holds SessionManagerCommon::Sessions lock for its lifetime) to access sync.size().

      2) Inside AsioSessionManager::appendStats.

      SessionManagerCommon::appendStats previously handled concurrent access to some of the members by acquiring a sync token at the beginning of the function. This means that previously we inadvertently synchronized access using a SessionManagerCommon::Sessions lock even though _rejectedSessions is outside of that class.

      During the separation of SessionManager into subclasses AsioSessionManager and GRPCSessionManager, it seems the appendStats section no longer acquires the sync token for the duration of the function, so we lost the synchronization.

       

      We can probably just make this into an atomic or make rejectedSessions a member of SessionManagerCommon::Sessions.

            Assignee:
            alex.li@mongodb.com Alex Li
            Reporter:
            alex.li@mongodb.com Alex Li
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: