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

Fix race in ConfirmSocketSetOptionOnResetConnections in transport_layer_asio_test.cpp

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0-rc0, 5.0.7, 5.2.2
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Service Arch
    • Fully Compatible
    • ALL
    • v5.2, v5.0
    • Service Arch 2021-12-13, Service Arch 2022-1-10
    • 34

      ConfirmSocketSetOptionOnResetConnections may have a race in it wherein an ASIO socket's connect() call may not return by the time the ASIO acceptor on the server end returns from accept(). In ConfirmSocketSetOptionOnResetConnections, this allows the server side to close the connection before connect() finishes, which causes connect() to fail and throw, failing the test. Add a synchronization mechanism to ensure that the onAccept() callback associated with the acceptor doesn't run until connect() has fully completed. 

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            tyler.seip@mongodb.com Tyler Seip (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: