diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index 4536b2ff5deb1ae8a7d464107a8dac66b7da9da3..e473bb2a135d72045f9b0dab2e69384171da5e83 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -1,4 +1,4 @@
-// Code generated by golang.org/x/tools/cmd/bundle.
+// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT.
 //go:generate bundle -o h2_bundle.go -prefix http2 -underscore golang.org/x/net/http2
 
 // Package http2 implements the HTTP/2 protocol.
@@ -3536,9 +3536,13 @@ 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)
+		if ch != nil {
+			gracefulShutdownCh = make(chan struct{})
+			go sc.awaitGracefulShutdown(ch, gracefulShutdownCh)
+		}
 	}
 
 	go sc.readFrames()
@@ -3587,6 +3591,14 @@ func (sc *http2serverConn) serve() {
 	}
 }
 
+func (sc *http2serverConn) awaitGracefulShutdown(sharedCh <-chan struct{}, privateCh chan struct{}) {
+	select {
+	case <-sc.doneServing:
+	case <-sharedCh:
+		close(privateCh)
+	}
+}
+
 // readPreface reads the ClientPreface greeting from the peer
 // or returns an error on timeout or an invalid greeting.
 func (sc *http2serverConn) readPreface() error {
@@ -6003,7 +6015,6 @@ func http2commaSeparatedTrailers(req *Request) (string, error) {
 	}
 	if len(keys) > 0 {
 		sort.Strings(keys)
-
 		return strings.Join(keys, ","), nil
 	}
 	return "", nil