From cc1bb3463a3f42f61785d9e59d9523b4576dde69 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 21 Mar 2018 10:30:00 -0700 Subject: [PATCH 1/2] Fix wrong timeout value of keepalive watchdog --- src/core/ext/transport/chttp2/transport/chttp2_transport.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index a4d616d7784..bd588e3c9b6 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -2630,7 +2630,7 @@ static void start_keepalive_ping_locked(void* arg, grpc_error* error) { grpc_chttp2_transport* t = static_cast(arg); GRPC_CHTTP2_REF_TRANSPORT(t, "keepalive watchdog"); grpc_timer_init(&t->keepalive_watchdog_timer, - grpc_core::ExecCtx::Get()->Now() + t->keepalive_time, + grpc_core::ExecCtx::Get()->Now() + t->keepalive_timeout, &t->keepalive_watchdog_fired_locked); } From 236bec52579f6cd32924883b885c0f2a1f6d2087 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 21 Mar 2018 15:45:21 -0700 Subject: [PATCH 2/2] Improve keepalive_timeout test to capture the bug --- test/core/end2end/tests/keepalive_timeout.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/end2end/tests/keepalive_timeout.cc b/test/core/end2end/tests/keepalive_timeout.cc index f0dd061e339..c0771b8bd20 100644 --- a/test/core/end2end/tests/keepalive_timeout.cc +++ b/test/core/end2end/tests/keepalive_timeout.cc @@ -102,7 +102,7 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) { grpc_arg keepalive_arg_elems[3]; keepalive_arg_elems[0].type = GRPC_ARG_INTEGER; keepalive_arg_elems[0].key = const_cast(GRPC_ARG_KEEPALIVE_TIME_MS); - keepalive_arg_elems[0].value.integer = 1500; + keepalive_arg_elems[0].value.integer = 3500; keepalive_arg_elems[1].type = GRPC_ARG_INTEGER; keepalive_arg_elems[1].key = const_cast(GRPC_ARG_KEEPALIVE_TIMEOUT_MS); keepalive_arg_elems[1].value.integer = 0;