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

Document thread-safety semantics for ASIOSession

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Service Arch

      Discussion in the PR for SERVER-72605 uncovered some ambiguities with respect to the thread-safeness of ASIOSession. While the synchronous API is guaranteed to be called from only one thread, the asynchronous API can be called from multiple threads. It appears that there is thread-unsafe behavior in the asynchronous API, specifically with respect to calling thread-unsafe methods on the `_socket` and `_sslSocket` members, whether directly or via the `getSocket` method.

      Examine all uses of the asynchronous API (particular methods of interest listed below), determine whether they might be called from multiple threads and whether they are already self-synchronizing, and resolve any thread-unsafe behavior (or file tickets requesting such changes).

      • `asyncSourceMessage`
      • `asyncSinkMessage`
      • `cancelAsyncOperations`
      • `isConnected`

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            james.bronsted@mongodb.com James Bronsted
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: