From 8d6352afd5f1a541466f3c447e1f5a51dd538434 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Mon, 29 Aug 2022 17:20:57 -0700 Subject: [PATCH] HTTP: Add logging when keepalive pings are cancelled (#30781) --- src/core/ext/transport/chttp2/transport/chttp2_transport.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 0bee5a19b48..7f61fdd0ce6 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -2676,6 +2676,11 @@ static void init_keepalive_ping_locked(void* arg, grpc_error_handle error) { } } else if (error == GRPC_ERROR_CANCELLED) { // The keepalive ping timer may be cancelled by bdp + if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || + GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { + gpr_log(GPR_INFO, "%s: Keepalive ping cancelled. Resetting timer.", + t->peer_string.c_str()); + } GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping"); GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, init_keepalive_ping, t, grpc_schedule_on_exec_ctx);