diff --git a/transport/http2_client.go b/transport/http2_client.go index 17a15a00a9ba..8460ea1e056c 100644 --- a/transport/http2_client.go +++ b/transport/http2_client.go @@ -1298,9 +1298,9 @@ func (t *http2Client) keepalive() { // Check if keepalive should go dormant. t.mu.Lock() if len(t.activeStreams) < 1 && !t.kp.PermitWithoutStream { + t.mu.Unlock() // Make awakenKeepalive writable. <-t.awakenKeepalive - t.mu.Unlock() select { case <-t.awakenKeepalive: // If the control gets here a ping has been sent