[Windows] Share muxnotes for write-first I/O sources #975
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 254 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.332
Real PR Conversation Timeline
1 comments
"Review active on #975"
general
weight: 0.35
compnerd
When a Windows write source is registered before a read source on the same handle,
_dispatch_muxnote_create()storesEVFILT_WRITE, but_dispatch_unote_muxnote_find()canonicalizes both filters toEVFILT_READ. Neither subsequent lookup can find the original writer's muxnote.For sockets this creates independent muxnotes that each call
WSAEventSelect(). A later registration replaces the socket's previous event object and mask, and cancelling one source can disable notifications for the surviving source. See the WSAEventSelect documentation.Canonicalize the filter at creation too, matching the lookup key and the existing epoll backend. Extend
dispatch_io_muxedwith a regression that waits for writer registration, then reader registration, then writer cancellation, sends one byte from the peer, and verifies that the reader receives it. The test uses registration/cancellation handlers and the existing bounded group waits; it needs no sleeps or send-buffer-size assumptions.Related: https://github.com/swiftlang/swift-corelibs-foundation/issues/5532. FoundationNetworking's curl integration uses read/write Dispatch sources, so this is relevant to the reported upload stall. This PR fixes the demonstrated Dispatch registration bug; the URLSession upload symptom has not yet been verified before/after with the rebuilt runtime.
Validation:
git diff --checkand clean application against currentmain(2078b9d).dispatch_io_muxedtest passes against system Dispatch; this does not execute the Windows backend.