[SERVER-84083] Document thread-safety semantics for ASIOSession Created: 11/Dec/23  Updated: 12/Dec/23

Status: Needs Scheduling
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: James Bronsted Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-72605 Ensure and document thread-safety sem... Closed
Assigned Teams:
Service Arch
Participants:

 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`

Generated at Thu Feb 08 06:54:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.