From acb863ca3144c549438c4a90742553b514733578 Mon Sep 17 00:00:00 2001 From: yang-g Date: Tue, 10 Jul 2018 09:40:37 -0700 Subject: [PATCH] Do not start timer if transport is closed. --- src/core/ext/transport/chttp2/transport/chttp2_transport.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 0d6b72c66e4..bc6fa0d0eb0 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -2663,6 +2663,9 @@ static void init_keepalive_ping_locked(void* arg, grpc_error* error) { static void start_keepalive_ping_locked(void* arg, grpc_error* error) { grpc_chttp2_transport* t = static_cast(arg); + if (error != GRPC_ERROR_NONE) { + return; + } GRPC_CHTTP2_REF_TRANSPORT(t, "keepalive watchdog"); grpc_timer_init(&t->keepalive_watchdog_timer, grpc_core::ExecCtx::Get()->Now() + t->keepalive_timeout,