Skip to content

os: TestRacyRead/named_overlapped_pipe failures #73630

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

Closed
gopherbot opened this issue May 7, 2025 · 2 comments
Closed

os: TestRacyRead/named_overlapped_pipe failures #73630

gopherbot opened this issue May 7, 2025 · 2 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@gopherbot
Copy link
Contributor

#!watchflakes
default <- pkg == "os" && test == "TestRacyRead/named_overlapped_pipe"

Issue created automatically to collect these failures.

Example (log):

=== RUN   TestRacyRead/named_overlapped_pipe
=== PAUSE TestRacyRead/named_overlapped_pipe
=== CONT  TestRacyRead/named_overlapped_pipe
    os_windows_test.go:1725: close \\.\pipe\go-os-test-5516-11: use of closed network connection
--- FAIL: TestRacyRead/named_overlapped_pipe (2.45s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "os" && test == "TestRacyRead/named_overlapped_pipe"
2025-05-07 18:52 gotip-windows-amd64-race go@bce8486e os.TestRacyRead/named_overlapped_pipe (log)
=== RUN   TestRacyRead/named_overlapped_pipe
=== PAUSE TestRacyRead/named_overlapped_pipe
=== CONT  TestRacyRead/named_overlapped_pipe
    os_windows_test.go:1725: close \\.\pipe\go-os-test-5516-11: use of closed network connection
--- FAIL: TestRacyRead/named_overlapped_pipe (2.45s)

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 7, 2025
@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/671455 mentions this issue: os: remove NewFile socket detection on Windows

@qmuntal qmuntal added NeedsFix The path to resolution is known, but the work has not been done. release-blocker and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels May 10, 2025
@qmuntal qmuntal added this to the Go1.25 milestone May 10, 2025
Sirherobrine23 pushed a commit to Sirherobrine23/go that referenced this issue May 24, 2025
NewFile was recently updated (in CL 668195) to detect whether the
handle is a socket or not. This special case is not really necessary,
given that socket handles can be used as if they were normal file
handles on all functions supported by os.File (see https://learn.microsoft.com/en-us/windows/win32/winsock/socket-handles-2).

Not only is not necessary, but is can also be problematic, as there is
no way to reliably detect whether a handle is a socket or not. For
example, the test failure reported in golang#73630 is caused by a named pipe
wrongly detected as a socket.

This aligns with the Unix NewFile behavior of returning an os.File that
identifies itself as a file handle even if it is a socket. This makes
os.File.Close to always return os.ErrClosed in case of multiple calls
rather than sometimes returning "use of closed network connection".

Updates golang#10350.
Fixes golang#73630.

Change-Id: Ia8329783d5c8ef6dac34ef69ed1ce9d2a9862e11
Reviewed-on: https://go-review.googlesource.com/c/go/+/671455
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Michael Knyszek <[email protected]>
Reviewed-by: Damien Neil <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
Status: Done
Development

No branches or pull requests

2 participants