[ci-fix] Needs review: dual-stack accept-reset socket test fails on Windows/Linux (refs #133778) - #133925
Draft
github-actions[bot] wants to merge 1 commit into
Draft
[ci-fix] Needs review: dual-stack accept-reset socket test fails on Windows/Linux (refs #133778)#133925github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
The AcceptDualStackResetTests test only wrapped ReceiveAsync in the SocketException catch, but on Windows and Linux the peer's immediate reset is surfaced by AcceptAsync itself (An existing connection was forcibly closed by the remote host). Move the accept inside the try so the reset from either accept or receive is tolerated and the healthy peer is accepted on a subsequent iteration. Refs #133778 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 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: @karelz, @dotnet/ncl |
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.
Workflow artifact: ci-fix
Artifact kind: help
Linked KBE: #133778
Note
This is an AI/Copilot-generated best-effort fix attempt that I could not fully validate. It is a starting point for a maintainer, not a finished change. Please review the analysis below before merging.
Root cause (best analysis)
System.Net.Sockets.Tests.AcceptDualStackResetTests.Accept_DualStackListener_PeerImmediatelyResets_ListenerStaysHealthy(useAsync: True)fails onwindows-x64/linux-x64(TestReadyToRun_Librariesand the runtime pipeline):Line 527 is the
AcceptAsync/Acceptcall, not the receive. The test (added by #131869) closes an IPv4 peer withSO_LINGER=0so the kernel sends an immediate RST, then expects the listener to still deliver the healthy IPv6 peer's byte. Thetry { ... } catch (SocketException)block only wraps theReceiveAsync; theacceptthat precedes it sits outside thetry. On Windows and Linux the reset is surfaced byacceptitself (WSAECONNRESET/ "connection forcibly closed"), which escapes the catch and fails the test, even though the very next accept iteration would return the healthy peer. macOS discards the reset at accept (which #131869 hardenedEndPoint.Createfor), so it doesn't hit this path — which is why the test passed there but not on Windows/Linux.The test comment already anticipates this ("Some platforms surface the reset connection from accept()"), but the code doesn't guard the accept accordingly.
Attempted fix
Move the
acceptinside the existingtryblock so aSocketExceptionfrom either the accept or the following receive is tolerated, and the loop retries to accept the healthy peer on the next iteration (the loop already runs up to 2 accepts). No production code changes; the listener-stays-healthy assertion is preserved. This is not a test-disable — the test still runs and still asserts the healthy peer's message is received.What is unverified / where I need help
System.Net.Sockets.Testsin this environment, so I have not confirmed the test now passes on windows-x64/linux-x64 while still catching a genuine listener regression.accept(making tolerating it here correct), or should the runtime itself suppress the reset connection from the accept loop the way macOS does? If the latter, the real fix belongs in the socket accept path rather than the test.Validation
not run because the sockets functional test suite could not be built/executed within the run budgetEvidence
Help wanted
@wfurt(authored Guard against empty remote address on macOS accept #131869 that added the test)area-System.Net.Sockets):@dotnet/nclFiled by
ci-failure-fix. Comment here or on the workflow file to suggest changes;ci-failure-scan-feedbackreads in-scope feedback daily and opens (or updates) a PR with prompt edits.Structured data:
{ "artifact_kind": "help", "linked_kbe": 133778, "workflow_artifact": "ci-fix" }