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: Transport race condition by Content-Length == 0 response [1.15 backport] #42935

Closed
gopherbot opened this issue Dec 2, 2020 · 6 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

gopherbot commented Dec 2, 2020

@networkimprov requested issue #41600 (fixed by 212d385 and 854a2f8 in Go 1.16) to be considered for backport to the next 1.15 minor release.

@gopherbot please backport

The relevant CL is https://golang.org/cl/257818 - net/http: ignore connection closes once done with the connection

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Dec 2, 2020
@gopherbot gopherbot added this to the Go1.15.6 milestone Dec 2, 2020
@cagedmantis cagedmantis modified the milestones: Go1.15.6, Go1.15.7 Dec 3, 2020
@dmitshur dmitshur modified the milestones: Go1.15.7, Go1.15.8 Jan 19, 2021
@toothrot toothrot added the CherryPickApproved Used during the release process for point releases label Jan 26, 2021
@toothrot
Copy link
Contributor

This is a serious issue with no workaround. Approved.

@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Jan 26, 2021
@cagedmantis cagedmantis modified the milestones: Go1.15.8, Go1.15.9 Feb 4, 2021
@gopherbot
Copy link
Author

Change https://golang.org/cl/297909 mentions this issue: [release-branch.go1.15] net/http: ignore connection closes once done with the connection

@gopherbot
Copy link
Author

Change https://golang.org/cl/297910 mentions this issue: [release-branch.go1.15] net/http: add connections back that haven't been canceled

@dmitshur
Copy link
Contributor

dmitshur commented Mar 2, 2021

I've mailed CL 297909 and CL 297910 that will resolve this issue.

@gopherbot
Copy link
Author

Closed by merging 1c60e0d to release-branch.go1.15.

@gopherbot

This comment has been minimized.

gopherbot pushed a commit that referenced this issue Mar 2, 2021
…with the connection

Once the connection is put back into the idle pool, the request should
not take any action if the connection is closed.

For #42935.
Updates #41600.

Change-Id: I5e4ddcdc03cd44f5197ecfbe324638604961de84
Reviewed-on: https://go-review.googlesource.com/c/go/+/257818
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Trust: Damien Neil <dneil@google.com>
(cherry picked from commit 212d385)
Reviewed-on: https://go-review.googlesource.com/c/go/+/297909
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
gopherbot pushed a commit that referenced this issue Mar 2, 2021
…een canceled

Issue #41600 fixed the issue when a second request canceled a connection
while the first request was still in roundTrip.
This uncovered a second issue where a request was being canceled (in
roundtrip) but the connection was put back into the idle pool for a
subsequent request.
The fix is the similar except its now in readLoop instead of roundTrip.
A persistent connection is only added back if it successfully removed
the cancel function; otherwise we know the roundTrip has started
cancelRequest.

Fixes #42935.
Updates #42942.

Change-Id: Ia56add20880ccd0c1ab812d380d8628e45f6f44c
Reviewed-on: https://go-review.googlesource.com/c/go/+/274973
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Damien Neil <dneil@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
(cherry picked from commit 854a2f8)
Reviewed-on: https://go-review.googlesource.com/c/go/+/297910
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
@toothrot toothrot modified the milestones: Go1.15.9, Go1.15.10 Mar 10, 2021
@golang golang locked and limited conversation to collaborators Mar 10, 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