Skip to content

Commit 09731f9

Browse files
Choradengopherbot
authored andcommitted
http2: improve handling of lost PING in Server
This addresses inconsistencies in handling lost PINGs between Server and Transport by: 1. Always logging a message for lost PINGs, regardless of verbose mode. 2. Invoking CountError with the conn_close_lost_ping error key. Fixes golang/go#69963 Change-Id: I58fee489f7896dbb80ccc50265452cd953f7ca6b GitHub-Last-Rev: ef74c95 GitHub-Pull-Request: #229 Reviewed-on: https://go-review.googlesource.com/c/net/+/635555 Auto-Submit: Sean Liao <sean@liao.dev> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Sean Liao <sean@liao.dev> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: David Chase <drchase@google.com>
1 parent 55989e2 commit 09731f9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

http2/server.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,10 @@ func (sc *serverConn) serve(conf http2Config) {
10681068

10691069
func (sc *serverConn) handlePingTimer(lastFrameReadTime time.Time) {
10701070
if sc.pingSent {
1071-
sc.vlogf("timeout waiting for PING response")
1071+
sc.logf("timeout waiting for PING response")
1072+
if f := sc.countErrorFunc; f != nil {
1073+
f("conn_close_lost_ping")
1074+
}
10721075
sc.conn.Close()
10731076
return
10741077
}

0 commit comments

Comments
 (0)