Merge pull request #18196 from yashykt/logging1

Print the peer string to make debugging easier
pull/18206/head
Yash Tibrewal 6 years ago committed by GitHub
commit 7b63731b87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  2. 2
      src/core/ext/transport/chttp2/transport/writing.cc

@ -824,10 +824,10 @@ static const char* write_state_name(grpc_chttp2_write_state st) {
static void set_write_state(grpc_chttp2_transport* t, static void set_write_state(grpc_chttp2_transport* t,
grpc_chttp2_write_state st, const char* reason) { grpc_chttp2_write_state st, const char* reason) {
GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "W:%p %s state %s -> %s [%s]", t, GRPC_CHTTP2_IF_TRACING(
t->is_client ? "CLIENT" : "SERVER", gpr_log(GPR_INFO, "W:%p %s [%s] state %s -> %s [%s]", t,
write_state_name(t->write_state), t->is_client ? "CLIENT" : "SERVER", t->peer_string,
write_state_name(st), reason)); write_state_name(t->write_state), write_state_name(st), reason));
t->write_state = st; t->write_state = st;
/* If the state is being reset back to idle, it means a write was just /* If the state is being reset back to idle, it means a write was just
* finished. Make sure all the run_after_write closures are scheduled. * finished. Make sure all the run_after_write closures are scheduled.

@ -108,7 +108,7 @@ 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_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) { if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) {
gpr_log(GPR_INFO, "%s: Ping sent [%p]: %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,
t->ping_policy.max_pings_without_data); t->ping_policy.max_pings_without_data);

Loading…
Cancel
Save