-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebSocket and multiple reads and writes #58202
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsIt seems that after #56282 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.
|
I found this issue while working on improvements to WASM here #58199
Changed my mind |
From my perspective, both the docs and the ManagedWebSocket implementation are good as-is (albeit we can delete a dead function and clean up some tests). The docs are correct: only one receive and one send are supported concurrently. But there are many things that are unsupported that happen to just work sometimes. It's unsupported to use a Note that in .NET 5 it already "just worked" to have concurrent sends, again even though such use would be unsupported. The implementation had to enable concurrent sends in order to support a keep-alive timer firing ping requests, and so while unsupported, concurrent sends "just worked", as it wasn't worthwhile trying to distinguish valid use from invalid use. You can see that the cited "ThrowIfOperationInProgress" method only has one call site, on the receive side. The way the implementation was tracking an active receive in order to be able to raise that error was expensive. And it's not worth it paying that expense to flag unsupported concurrent use. Note, however, that we have supported CloseAsync and CloseOutputAsync concurrently with both ReceiveAsync and SendAsync. I don't know if anyone's depended on that, nor do I know if it's documented, but technically we made it work, both previously and now. (CloseAsync needs to both send and receive, and CloseOutputAsync needs to send.) |
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsIt seems that after #56282 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. Failures 6/27-8/27 (incl. PRs):
Wasm failure is
|
Thanks @stephentoub and @CarnaViire. |
It seems that after #56282
ManagedWebSocket
started to allow multiple reads and writes by ordering them inside viaAsyncMutex
. 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 calledThrowIfOperationInProgress
- 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):
Wasm failures are:
The text was updated successfully, but these errors were encountered: