aboutsummaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorDmitri Shuralyov <dmitshur@golang.org>2024-04-05 18:22:10 -0400
committerGopher Robot <gobot@golang.org>2024-04-08 20:51:17 +0000
commit8008998b14a6e704b38244f7dff878753d5d179b (patch)
treeca47ecd6c21360d8a5ea9eaf05617dde576071ff /src/net
parent50a5059056e2233c5112e1dbb65c19bfc79ebb5d (diff)
downloadgo-8008998b14a6e704b38244f7dff878753d5d179b.tar.gz
go-8008998b14a6e704b38244f7dff878753d5d179b.zip
all: update vendored golang.org/x/net
Pull in CL 576895: ec05fdcd http2: don't retry the first request on a connection on GOAWAY error For #66668. Fixes #60636. Change-Id: I9903607e3d432a5db0325da82eb7f4b378fbddde Reviewed-on: https://go-review.googlesource.com/c/go/+/576976 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Damien Neil <dneil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/net')
-rw-r--r--src/net/http/h2_bundle.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index 683d538dbc..5f97a27ac2 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -8338,7 +8338,20 @@ func (cc *http2ClientConn) setGoAway(f *http2GoAwayFrame) {
}
last := f.LastStreamID
for streamID, cs := range cc.streams {
- if streamID > last {
+ if streamID <= last {
+ // The server's GOAWAY indicates that it received this stream.
+ // It will either finish processing it, or close the connection
+ // without doing so. Either way, leave the stream alone for now.
+ continue
+ }
+ if streamID == 1 && cc.goAway.ErrCode != http2ErrCodeNo {
+ // Don't retry the first stream on a connection if we get a non-NO error.
+ // If the server is sending an error on a new connection,
+ // retrying the request on a new one probably isn't going to work.
+ cs.abortStreamLocked(fmt.Errorf("http2: Transport received GOAWAY from server ErrCode:%v", cc.goAway.ErrCode))
+ } else {
+ // Aborting the stream with errClentConnGotGoAway indicates that
+ // the request should be retried on a new connection.
cs.abortStreamLocked(http2errClientConnGotGoAway)
}
}