-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http: Server.ConnContext accidentally modifies context for all connections #35750
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
Comments
Wow, whoops. Thanks for the report! |
Change https://golang.org/cl/208318 mentions this issue: |
@rkollar, no need to convince me of its importance; I was already planning to backport this to previous releases. I'm just waiting on a test in that PR/CL. I can take the change over if you'd like. |
@bradfitz I'm already working on it, but it's my first submission and I have to go over the existing tests to learn what are the conventions. You can take over if you don't want to wait. |
@gopherbot, please backport to Go 1.13. |
Backport issue(s) opened: #35765 (for 1.13). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/208235 mentions this issue: |
…ntext for all new connections Updates #35750 Fixes #35765 Change-Id: I65d38cfc5ddd66131777e104c269cc3559b2471d GitHub-Last-Rev: 953fdfd GitHub-Pull-Request: #35751 Reviewed-on: https://go-review.googlesource.com/c/go/+/208318 Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> (cherry picked from commit bbbc658) Reviewed-on: https://go-review.googlesource.com/c/go/+/208235 Reviewed-by: Bryan C. Mills <[email protected]>
Ah we just spent many hours trying to figure out why there seemed to be a massive memory leak following the use of this feature... Good catch and can't wait for fix! |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What did you do?
Docs of ConnContext say that:
However, it assigns this new context to a variable shared between connections in the accept loop. Thus creating a growing chain of contexts.
Example code:
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: