Repository navigation
Fix build break - #136388
Merged
Merged
Fix build break#136388
Conversation
jkotas
marked this pull request as ready for review
October 23, 2026 22:11
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
1 similar comment
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
lewing
approved these changes
Oct 23, 2026
steveisok
approved these changes
Oct 23, 2026
Member
|
Oops, sorry, I had it in mind, but forgot when I merged the 2nd PR 😞 |
EgorBo
approved these changes
Oct 23, 2026
Member
|
I think it should be safe to merge it as is to unblock others |
EgorBo
enabled auto-merge (squash)
October 23, 2026 22:38
Member
|
/ba-g fast merge build break |
lewing
disabled auto-merge
October 23, 2026 22:39
lewing
added a commit
that referenced
this pull request
Oct 26, 2026
On Unix, a zero-byte receive is implemented as a 1-byte `MSG_PEEK`. wasi-libc rejects `MSG_PEEK` with `EOPNOTSUPP`, so every zero-byte receive fails on WASI. Callers such as HTTP/2 in `SocketsHttpHandler` rely on zero-byte reads to wait for data. This was split out of #136234 at a reviewer's request. ## Fix On WASI, a zero-byte receive with no flags now does this instead: - It polls the socket for `POLLIN` with a zero timeout, and completes only when the socket is readable. - If the socket can't be polled, it does a zero-length `recv` so the real error is reported. For example, wasi-libc returns `EOPNOTSUPP` for an unconnected TCP socket, and the `recv` reports `ENOTCONN` instead. - WASI poll events don't say which direction is ready, so queued zero-byte receives re-run this check. They no longer complete on any event. Non-WASI behavior is unchanged. Not covered: a zero-byte `ReceiveFrom`/`ReceiveMessageFrom` that passes an endpoint still takes the `MSG_PEEK` path on WASI. ## Known caveat After data has been drained, one zero-byte receive can complete early, because wasmtime keeps readiness set until a read would block. wasmtime treats this as by design (bytecodealliance/wasmtime#9667). The next real read then waits correctly. ## Validation - **CoreCLR WASI, Release, wasmtime 49.0.1:** the full System.Net.Sockets functional tests ran 653 tests: 565 passed, 0 failed, 88 skipped. The baseline on main is about 645 run with 0 failed. The two new tests passed in all 4 variants that run on WASI. - **macOS, Release:** I ran the `SendReceive_*` classes (Sync, SyncForceNonBlocking, Apm, Task, Eap, SpanSync, MemoryArrayTask, MemoryNativeTask). Total was 252 with 0 failed, and both new tests passed in every variant. - `Receive0Byte_NotConnected_Throws` runs on all platforms. `Receive0Byte_Udp_CompletesWhenDatagramArrives` runs on Unix only, because on Windows a zero-byte receive consumes the datagram. - `SocketsHttpHandler`/HTTP/2 isn't enabled on WASI in main, so the motivating HTTP/2 scenario is covered in #136234 rather than here. - Building main locally needed the `fgopt.cpp` fix from #136388. That fix is not part of this PR. Related: #107981 > [!NOTE] > This PR was generated with GitHub Copilot. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Conflict between #136263 and earlier PR