-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http, x/net/http2: http.readTrackingBody data race after received GOAWAY frame #41234
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
Labels
Comments
cc @fraenkel |
dupe of #31192 There are variations of this issue even when running this test case. |
Change https://golang.org/cl/253259 mentions this issue: |
@fraenkel thanks! |
Duplicate of #31192 |
gopherbot
pushed a commit
to golang/net
that referenced
this issue
Oct 31, 2020
When the clientConn is done with a request, if there is a request body, we must wait until the body is written otherwise there can be a race when attempting to rewind the body. Fixes golang/go#31192 Fixes golang/go#41234 Change-Id: I77606cc19372eea8bbd8995102354f092b8042be Reviewed-on: https://go-review.googlesource.com/c/net/+/253259 Reviewed-by: Damien Neil <dneil@google.com> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Go Bot <gobot@golang.org>
dteh
pushed a commit
to dteh/fhttp
that referenced
this issue
Jun 22, 2022
When the clientConn is done with a request, if there is a request body, we must wait until the body is written otherwise there can be a race when attempting to rewind the body. Fixes golang/go#31192 Fixes golang/go#41234 Change-Id: I77606cc19372eea8bbd8995102354f092b8042be Reviewed-on: https://go-review.googlesource.com/c/net/+/253259 Reviewed-by: Damien Neil <dneil@google.com> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Go Bot <gobot@golang.org>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Example codes: https://github.com/answer1991/go-workspace/blob/master/pkg/goaway/goaway_test.go , run with
go test -race
failed:Root Cause
Error timeline:
body reading goroutine
):https://github.com/golang/net/blob/62affa334b73ec65ed44a326519ac12c421905e3/http2/transport.go#L2630
body reading goroutine
is still on going and the request.Body(wrapped as http.readTrackingBody) has not been read.http.readTrackingBody.didRead
== false, then re-use the http.readTrackingBodybody reading goroutine
try to read the same http.readTrackingBody instance.The text was updated successfully, but these errors were encountered: