Merge pull request #18583 from yang-g/pingping

Stop pinging if transport is closed
pull/18418/head^2
Yang Gao 6 years ago committed by GitHub
commit 681f1c8a98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc

@ -2603,6 +2603,9 @@ static void start_bdp_ping_locked(void* tp, grpc_error* error) {
gpr_log(GPR_INFO, "%s: Start BDP ping err=%s", t->peer_string,
grpc_error_string(error));
}
if (error != GRPC_ERROR_NONE || t->closed_with_error != GRPC_ERROR_NONE) {
return;
}
/* Reset the keepalive ping timer */
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING) {
grpc_timer_cancel(&t->keepalive_ping_timer);
@ -2616,7 +2619,7 @@ static void finish_bdp_ping_locked(void* tp, grpc_error* error) {
gpr_log(GPR_INFO, "%s: Complete BDP ping err=%s", t->peer_string,
grpc_error_string(error));
}
if (error != GRPC_ERROR_NONE) {
if (error != GRPC_ERROR_NONE || t->closed_with_error != GRPC_ERROR_NONE) {
GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
return;
}

Loading…
Cancel
Save