Merge pull request #13599 from kpayson64/fix_flow_control_bug_local

Initialize last sent ping time
pull/13598/head^2
kpayson64 7 years ago committed by GitHub
commit d1945788c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  2. 8
      src/core/ext/transport/chttp2/transport/writing.cc

@ -549,6 +549,7 @@ static void init_transport(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t,
/* No pings allowed before receiving a header or data frame. */ /* No pings allowed before receiving a header or data frame. */
t->ping_state.pings_before_data_required = 0; t->ping_state.pings_before_data_required = 0;
t->ping_state.is_delayed_ping_timer_set = false; t->ping_state.is_delayed_ping_timer_set = false;
t->ping_state.last_ping_sent_time = GRPC_MILLIS_INF_PAST;
t->ping_recv_state.last_ping_recv_time = GRPC_MILLIS_INF_PAST; t->ping_recv_state.last_ping_recv_time = GRPC_MILLIS_INF_PAST;
t->ping_recv_state.ping_strikes = 0; t->ping_recv_state.ping_strikes = 0;

@ -81,8 +81,11 @@ static void maybe_initiate_ping(grpc_exec_ctx* exec_ctx,
/* not enough elapsed time between successive pings */ /* not enough elapsed time between successive pings */
if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) { if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) {
gpr_log(GPR_DEBUG, gpr_log(GPR_DEBUG,
"%s: Ping delayed [%p]: not enough time elapsed since last ping", "%s: Ping delayed [%p]: not enough time elapsed since last ping. "
t->is_client ? "CLIENT" : "SERVER", t->peer_string); " Last ping %f: Next ping %f: Now %f",
t->is_client ? "CLIENT" : "SERVER", t->peer_string,
(double)t->ping_state.last_ping_sent_time,
(double)next_allowed_ping, (double)now);
} }
if (!t->ping_state.is_delayed_ping_timer_set) { if (!t->ping_state.is_delayed_ping_timer_set) {
t->ping_state.is_delayed_ping_timer_set = true; t->ping_state.is_delayed_ping_timer_set = true;
@ -91,6 +94,7 @@ static void maybe_initiate_ping(grpc_exec_ctx* exec_ctx,
} }
return; return;
} }
pq->inflight_id = t->ping_ctr; pq->inflight_id = t->ping_ctr;
t->ping_ctr++; t->ping_ctr++;
GRPC_CLOSURE_LIST_SCHED(exec_ctx, &pq->lists[GRPC_CHTTP2_PCL_INITIATE]); GRPC_CLOSURE_LIST_SCHED(exec_ctx, &pq->lists[GRPC_CHTTP2_PCL_INITIATE]);

Loading…
Cancel
Save