]> Cypherpunks repositories - gostls13.git/commit
net/http: deflake request-not-written path
authorDamien Neil <dneil@google.com>
Wed, 19 Jan 2022 19:26:46 +0000 (11:26 -0800)
committerBryan Mills <bcmills@google.com>
Mon, 14 Feb 2022 17:30:31 +0000 (17:30 +0000)
commit3d7f83612390d913e7e8bb4ffa3dc69c41b3078d
tree4d914ceba53ad556a3c9ba004ff6b091599411e2
parent875a6d40107d560473d1590425a096dd4cee346f
net/http: deflake request-not-written path

When we receive an error writing the first byte of a request to a
reused connection, we retry the request on a new connection. Remove
a flaky path which could cause the request to not be retried if
persistConn.roundTrip reads the error caused by closing the connection
before it reads the write error that caused the connection to be
closed.

Fixes #30938.

Change-Id: Iafd99e3239cd9dba4a4c9ddd950a877ca9815e59
Reviewed-on: https://go-review.googlesource.com/c/go/+/379554
Trust: Bryan Mills <bcmills@google.com>
Trust: Damien Neil <dneil@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/net/http/transport.go
src/net/http/transport_internal_test.go