core/runtime/v2: fix race on Windows deferredPipeConnection.c in Read#13462
Merged
mxpv merged 1 commit intoMay 27, 2026
Merged
Conversation
Read short-circuited on `if dpc.c == nil` before calling `dpc.wg.Wait()` which races with the dialer goroutine spawned in openShimLog. The dialer assigns `dpc.c = c` (and may set `dpc.conerr`) outside any lock; the only synchronization is the WaitGroup, and Read skipped it on the fast path. Signed-off-by: Austin Vazquez <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a Windows-specific data race in deferredPipeConnection.Read by ensuring the WaitGroup synchronization is always honored before accessing fields written by the dialer goroutine spawned from openShimLog.
Changes:
- Move
dpc.wg.Wait()to the start of(*deferredPipeConnection).Readto establish a proper happens-before relationship fordpc.c/dpc.conerr. - Simplify the
Readfast-path to avoid unsynchronized reads ofdpc.c.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dmcgowan
approved these changes
May 21, 2026
dcantah
approved these changes
May 25, 2026
mxpv
approved these changes
May 27, 2026
Member
Author
|
/cherry-pick release/2.3 |
|
@austinvazquez: new pull request created: #13522 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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.
Read short-circuited on
if dpc.c == nilbefore callingdpc.wg.Wait()which races with the dialer goroutine spawned in openShimLog. The dialer assignsdpc.c = c(and may setdpc.conerr) outside any lock; the only synchronization is the WaitGroup, and Read skipped it on the fast path.Redacted stack trace: