Skip to content

WebSocket and multiple reads and writes #58202

@CarnaViire

Description

@CarnaViire

It seems that after #56282 ManagedWebSocket started to allow multiple reads and writes by ordering them inside via AsyncMutex. This seems to go against our docs that say "Exactly one send and one receive is supported on each WebSocket object in parallel." Before that PR, at least read side did the check and called ThrowIfOperationInProgress - now it's not called anywhere.

We have 2 tests called ReceiveAsync_MultipleOutstandingReceiveOperations_Throws and SendAsync_MultipleOutstandingSendOperations_Throws, but they are implemented in a way that if an exception was thrown, it checked to be an expected one. If no exceptions were thrown, the test would succeed.

We need to either re-introduce the check, or decide that we are happy with current behavior and update docs accordingly.

/cc @pavelsavara @stephentoub

Failures 6/27-8/27 (incl. PRs):

Day Run Test
7/16 4x PR #55849 - Mono wasm ReceiveAsync_MultipleOutstandingReceiveOperations_Throws
7/18 PR #55889 - Mono wasm ReceiveAsync_MultipleOutstandingReceiveOperations_Throws
7/27 Official run - Mono wasm ReceiveAsync_MultipleOutstandingReceiveOperations_Throws
8/25 PR #57745 - Mono wasm ReceiveAsync_MultipleOutstandingReceiveOperations_Throws
8/25 Official run - release/6.0 - Mono wasm ReceiveAsync_MultipleOutstandingReceiveOperations_Throws

Wasm failures are:

Assert.Equal() Failure
 Expected: Aborted
 Actual:   Closed
State immediately after ConnectAsync incorrect: Closed
Expected: True
Actual:   False
Closed state when OperationCanceledException
Expected: True
Actual:   False

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions