Merge pull request #13655 from yang-g/ping

Bug fix, use the last_sent ping time for next send
pull/13662/merge
Yang Gao 7 years ago committed by GitHub
commit 782676eded
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      src/core/ext/transport/chttp2/transport/writing.cc

@ -69,14 +69,15 @@ static void maybe_initiate_ping(grpc_exec_ctx* exec_ctx,
return;
}
grpc_millis now = grpc_exec_ctx_now(exec_ctx);
grpc_millis next_allowed_ping_interval =
(t->keepalive_permit_without_calls == 0 &&
grpc_chttp2_stream_map_size(&t->stream_map) == 0)
? 7200 * GPR_MS_PER_SEC
: t->ping_policy.min_sent_ping_interval_without_data;
grpc_millis next_allowed_ping =
t->ping_state.last_ping_sent_time +
t->ping_policy.min_sent_ping_interval_without_data;
if (t->keepalive_permit_without_calls == 0 &&
grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
next_allowed_ping =
t->ping_recv_state.last_ping_recv_time + 7200 * GPR_MS_PER_SEC;
}
t->ping_state.last_ping_sent_time + next_allowed_ping_interval;
if (next_allowed_ping > now) {
/* not enough elapsed time between successive pings */
if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) {

Loading…
Cancel
Save