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

net/http: HTTP/2 response body Close method sometimes returns spurious context cancelation error (1.17.3 regression) [1.16 backport] #49558

Closed
gopherbot opened this issue Nov 12, 2021 · 4 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@neild requested issue #49366 to be considered for backport to the next 1.16 minor release.

@gopherbot Please open backport issues for 1.16 and 1.17

@becca-tiessen
Copy link

Hi! I've been keeping track of the original issue where the reporter mentioned the problem was introduced in version 1.17.3.
But since this backport was opened, can you confirm whether this might have been introduced in a specific minor version of 1.16?
My team is noticing a similar issue but we're on v1.16, so I'm just wanting to check if it could be impacting us. Thanks!

@neild
Copy link
Contributor

neild commented Nov 17, 2021

Yes, this will be in 1.16.10 as well.

@dmitshur dmitshur added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Dec 1, 2021
@gopherbot
Copy link
Author

Change https://golang.org/cl/368084 mentions this issue: [release-branch.go1.16] net/http: do not cancel request context on response body read

@gopherbot
Copy link
Author

Closed by merging 5a93142 to release-branch.go1.16.

gopherbot pushed a commit that referenced this issue Dec 1, 2021
…sponse body read

When sending a Request with a non-context deadline, we create a
context with a timeout. This context is canceled when closing the
response body, and also if a read from the response body returns
an error (including io.EOF).

Cancelling the context in Response.Body.Read interferes with the
HTTP/2 client cleaning up after a request is completed, and is
unnecessary: The user should always close the body, the impact
from not canceling the context is minor (the context timer leaks
until it fires).

For #49366.
Fixes #49558.

Change-Id: Ieaed866116916261d9079f71d8fea7a7b303b8fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/361919
Trust: Damien Neil <dneil@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 76fbd61)
Reviewed-on: https://go-review.googlesource.com/c/go/+/368084
Reviewed-by: Michael Knyszek <mknyszek@google.com>
@golang golang locked and limited conversation to collaborators Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

4 participants