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

Document thread-safety semantics for ASIOSession

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Service Arch

    Description

      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`

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            james.bronsted@mongodb.com James Bronsted
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: