Skip to content
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

affected/package: net/http #55103

Closed
Shawn-Huang-Tron opened this issue Sep 16, 2022 · 1 comment
Closed

affected/package: net/http #55103

Shawn-Huang-Tron opened this issue Sep 16, 2022 · 1 comment

Comments

@Shawn-Huang-Tron
Copy link

Shawn-Huang-Tron commented Sep 16, 2022

What version of Go are you using (go version)?

$ go version
latest

Does this issue reproduce with the latest release?

not

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
darwin arm64

What did you do?

There might be a potential safety problem about the variable of err in :https://github.com/golang/go/blob/master/src/net/http/transport.go#L1707
I am not sure if it's right. This variable can be accessed in two different goroutines, but without any mutex or other concurrent protection.
I have seen the didReadResponse chan so that it can guarantee the sequence of two goroutines. But I am not sure that if err variable will and must get the result of another goroutine. Will CPU cache affect it?
According to the The Go Memory Model: https://go.dev/ref/mem. Thanks.

What did you expect to see?

Confirmed that if it has a potential safety problem.

What did you see instead?

@seankhliao
Copy link
Member

Not an issue. There's explicit synchronization in the form of channels.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2022
@golang golang locked and limited conversation to collaborators Sep 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants