Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Done
-
None
-
None
-
ALL
-
Service Arch 2022-2-07, Service Arch 2022-2-21, Service Arch 2022-03-07, Service Arch 2022-03-21
-
6
Description
Session exposes the interface to schedule network operations on its underlying networking socket. For each operation, there are both synchronous and asynchronous variants:
virtual StatusWith<Message> sourceMessage() noexcept = 0; |
virtual Future<Message> asyncSourceMessage(const BatonHandle& handle = nullptr) noexcept = 0; |
|
virtual Status waitForData() noexcept = 0; |
virtual Future<void> asyncWaitForData() noexcept = 0; |
|
virtual Status sinkMessage(Message message) noexcept = 0; |
virtual Future<void> asyncSinkMessage(Message message, const BatonHandle& handle = nullptr) noexcept = 0; |
Currently, instances of Session do not keep track of operations scheduled on their underlying sockets. As a result, they cannot await completion or ask for interruption of these operations.
This ticket should provide the means to account for in-flight operations and demand/await their interruption as part of ending the session.
virtual void cancelAsyncOperations(const BatonHandle& handle = nullptr) = 0; |
As an example, this ticket should provide the means to account for and cancel an asynchronous read operation blocked in the following continuation (e.g., using a fail-point):
return read(asio::buffer(ptr, kHeaderSize), baton).then([headerBuffer = std::move(headerBuffer), this, baton]() mutable { |
...
|
});
|
Expected outcome:
This ticket should provide unit-tests that mimic hangs in the underlying networking layer, and verify the cancelation behavior (i.e., Session::cancelAsyncOperations()) works in presence and absence of networking batons. Furthermore, we should ensure the baton is not running anything on behalf of the session after the session is canceled.
Attachments
Issue Links
- is related to
-
SERVER-63282 Refactor and simplify `BatonASIO`
-
- Closed
-
- related to
-
SERVER-47229 Make TransportSessionASIO cancelation level triggered
-
- Closed
-
-
SERVER-63185 Add unit-tests for the networking baton
-
- Closed
-
- split to
-
SERVER-64191 Ensure `Session::cancelAsyncOperations` complies with the contract
-
- Closed
-
-
SERVER-64174 Ensure timers/sessions added to `BatonASIO` are cancelable
-
- Open
-