|
|
@ -18,6 +18,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include <grpc/support/port_platform.h> |
|
|
|
#include <grpc/support/port_platform.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" |
|
|
|
#include "src/core/ext/transport/chttp2/transport/context_list.h" |
|
|
|
#include "src/core/ext/transport/chttp2/transport/context_list.h" |
|
|
|
#include "src/core/ext/transport/chttp2/transport/internal.h" |
|
|
|
#include "src/core/ext/transport/chttp2/transport/internal.h" |
|
|
|
|
|
|
|
|
|
|
@ -54,7 +55,8 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { |
|
|
|
if (!grpc_closure_list_empty(pq->lists[GRPC_CHTTP2_PCL_INFLIGHT])) { |
|
|
|
if (!grpc_closure_list_empty(pq->lists[GRPC_CHTTP2_PCL_INFLIGHT])) { |
|
|
|
/* ping already in-flight: wait */ |
|
|
|
/* ping already in-flight: wait */ |
|
|
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || |
|
|
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || |
|
|
|
GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) { |
|
|
|
GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || |
|
|
|
|
|
|
|
GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { |
|
|
|
gpr_log(GPR_INFO, "%s: Ping delayed [%p]: already pinging", |
|
|
|
gpr_log(GPR_INFO, "%s: Ping delayed [%p]: already pinging", |
|
|
|
t->is_client ? "CLIENT" : "SERVER", t->peer_string); |
|
|
|
t->is_client ? "CLIENT" : "SERVER", t->peer_string); |
|
|
|
} |
|
|
|
} |
|
|
@ -64,7 +66,8 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { |
|
|
|
t->ping_policy.max_pings_without_data != 0) { |
|
|
|
t->ping_policy.max_pings_without_data != 0) { |
|
|
|
/* need to receive something of substance before sending a ping again */ |
|
|
|
/* need to receive something of substance before sending a ping again */ |
|
|
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || |
|
|
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || |
|
|
|
GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) { |
|
|
|
GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || |
|
|
|
|
|
|
|
GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { |
|
|
|
gpr_log(GPR_INFO, "%s: Ping delayed [%p]: too many recent pings: %d/%d", |
|
|
|
gpr_log(GPR_INFO, "%s: Ping delayed [%p]: too many recent pings: %d/%d", |
|
|
|
t->is_client ? "CLIENT" : "SERVER", t->peer_string, |
|
|
|
t->is_client ? "CLIENT" : "SERVER", t->peer_string, |
|
|
|
t->ping_state.pings_before_data_required, |
|
|
|
t->ping_state.pings_before_data_required, |
|
|
@ -85,7 +88,8 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { |
|
|
|
if (next_allowed_ping > now) { |
|
|
|
if (next_allowed_ping > now) { |
|
|
|
/* not enough elapsed time between successive pings */ |
|
|
|
/* not enough elapsed time between successive pings */ |
|
|
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || |
|
|
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || |
|
|
|
GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) { |
|
|
|
GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || |
|
|
|
|
|
|
|
GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { |
|
|
|
gpr_log(GPR_INFO, |
|
|
|
gpr_log(GPR_INFO, |
|
|
|
"%s: Ping delayed [%p]: not enough time elapsed since last ping. " |
|
|
|
"%s: Ping delayed [%p]: not enough time elapsed since last ping. " |
|
|
|
" Last ping %f: Next ping %f: Now %f", |
|
|
|
" Last ping %f: Next ping %f: Now %f", |
|
|
@ -116,7 +120,8 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { |
|
|
|
GRPC_STATS_INC_HTTP2_PINGS_SENT(); |
|
|
|
GRPC_STATS_INC_HTTP2_PINGS_SENT(); |
|
|
|
t->ping_state.last_ping_sent_time = now; |
|
|
|
t->ping_state.last_ping_sent_time = now; |
|
|
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || |
|
|
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || |
|
|
|
GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) { |
|
|
|
GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || |
|
|
|
|
|
|
|
GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { |
|
|
|
gpr_log(GPR_INFO, "%s: Ping sent [%s]: %d/%d", |
|
|
|
gpr_log(GPR_INFO, "%s: Ping sent [%s]: %d/%d", |
|
|
|
t->is_client ? "CLIENT" : "SERVER", t->peer_string, |
|
|
|
t->is_client ? "CLIENT" : "SERVER", t->peer_string, |
|
|
|
t->ping_state.pings_before_data_required, |
|
|
|
t->ping_state.pings_before_data_required, |
|
|
|