net/http: http2 client data race to close request body when server crashes unexpectedly #73522
Labels
BugReport
Issues describing a possible bug in the Go implementation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
go version go1.24.2 linux/arm64
Output of
go env
in your module/workspace:docker.io/library/golang:1.24.2-bookworm
However, the above was run from a Macbook Pro. The actual failure occurred in a CI environment.
So the actual
GOARCH
was most likely amd64, not arm64.What did you do?
Running Antithesis tests of an application that uses connect-go, and net/http, for remote procedure calls. Right before the data race, the server was killed via Antithesis fault injection.
What did you see happen?
The client then observed the following race:
So the main "round trip" logic goroutine tries to close the request body, but so does the background goroutine that reads from the underlying
net.Conn
. The background goroutine tries to abort all in-progress operations and tries to close the request body, too, but there appears to be no synchronization. The background goroutine holds a mutex (http2Transport.mu
), but that doesn't guard the request body.What did you expect to see?
The HTTP operation was expected to fail due to the fault, but not in a way that tickles the Go race detector.
The text was updated successfully, but these errors were encountered: