diff --git a/languages/golang/centos/files/fix_http2_erringroundtripper_handling.patch b/languages/golang/centos/files/fix_http2_erringroundtripper_handling.patch new file mode 100644 index 0000000..83a4609 --- /dev/null +++ b/languages/golang/centos/files/fix_http2_erringroundtripper_handling.patch @@ -0,0 +1,26 @@ +diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go +index e9a55f3..6ec0ea1 100644 +--- a/src/net/http/h2_bundle.go ++++ b/src/net/http/h2_bundle.go +@@ -8893,6 +8893,7 @@ func http2strSliceContains(ss []string, s string) bool { + + type http2erringRoundTripper struct{ err error } + ++func (rt http2erringRoundTripper) IsHTTP2ErringRoundtripper() {} + func (rt http2erringRoundTripper) RoundTrip(*Request) (*Response, error) { return nil, rt.err } + + // gzipReader wraps a response body so it can lazily +diff --git a/src/net/http/transport.go b/src/net/http/transport.go +index db8ec4b..e3f9553 100644 +--- a/src/net/http/transport.go ++++ b/src/net/http/transport.go +@@ -539,8 +539,7 @@ func (t *Transport) roundTrip(req *Request) (*Response, error) { + } + + // Failed. Clean up and determine whether to retry. +- +- _, isH2DialError := pconn.alt.(http2erringRoundTripper) ++ _, isH2DialError := pconn.alt.(interface{ IsHTTP2ErringRoundtripper() }) + if http2isNoCachedConnError(err) || isH2DialError { + if t.removeIdleConn(pconn) { + t.decConnsPerHost(pconn.cacheKey) diff --git a/languages/golang/centos/golang.spec b/languages/golang/centos/golang.spec index d54e40a..362de2c 100644 --- a/languages/golang/centos/golang.spec +++ b/languages/golang/centos/golang.spec @@ -181,6 +181,7 @@ Requires: go-srpm-macros Patch1: 0001-Don-t-use-the-bundled-tzdata-at-runtime-except-for-t.patch Patch2: 0002-syscall-expose-IfInfomsg.X__ifi_pad-on-s390x.patch +Patch3: fix_http2_erringroundtripper_handling.patch # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -308,6 +309,7 @@ Requires: %{name} = %{version}-%{release} %patch1 -p1 %patch2 -p1 +%patch3 -p1 cp %{SOURCE1} ./src/runtime/