Files
kubernetes/build/build-image/cross/go_181_performance_fix.patch
Wojciech Tyczynski 3a1bb09ea9 Patch golang
2017-05-16 21:29:22 +02:00

25 lines
652 B
Diff

diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index 4536b2ff5d..84e78534a9 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -3536,9 +3536,17 @@ func (sc *http2serverConn) serve() {
sc.idleTimerCh = sc.idleTimer.C
}
- var gracefulShutdownCh <-chan struct{}
+ var gracefulShutdownCh chan struct{}
if sc.hs != nil {
- gracefulShutdownCh = http2h1ServerShutdownChan(sc.hs)
+ ch := http2h1ServerShutdownChan(sc.hs)
+ gracefulShutdownCh = make(chan struct{})
+ go func() {
+ select {
+ case <-sc.doneServing:
+ case <-ch:
+ close(gracefulShutdownCh)
+ }
+ }()
}
go sc.readFrames()