Skip to content
Snippets Groups Projects
Commit 797d8dbf authored by Craig Tiller's avatar Craig Tiller
Browse files

cleanup,debug

parent 419c9d7a
No related branches found
No related tags found
No related merge requests found
...@@ -720,6 +720,8 @@ static void maybe_start_some_streams(grpc_exec_ctx *exec_ctx, ...@@ -720,6 +720,8 @@ static void maybe_start_some_streams(grpc_exec_ctx *exec_ctx,
#define CLOSURE_BARRIER_FIRST_REF_BIT (1 << 16) #define CLOSURE_BARRIER_FIRST_REF_BIT (1 << 16)
static grpc_closure *add_closure_barrier(grpc_closure *closure) { static grpc_closure *add_closure_barrier(grpc_closure *closure) {
gpr_log(GPR_DEBUG, "add_closure_barrier[%p]: scratch=%" PRIdPTR, closure,
closure->next_data.scratch);
closure->next_data.scratch += CLOSURE_BARRIER_FIRST_REF_BIT; closure->next_data.scratch += CLOSURE_BARRIER_FIRST_REF_BIT;
return closure; return closure;
} }
...@@ -734,6 +736,8 @@ void grpc_chttp2_complete_closure_step(grpc_exec_ctx *exec_ctx, ...@@ -734,6 +736,8 @@ void grpc_chttp2_complete_closure_step(grpc_exec_ctx *exec_ctx,
GRPC_ERROR_UNREF(error); GRPC_ERROR_UNREF(error);
return; return;
} }
gpr_log(GPR_DEBUG, "complete_closure_step[%p]: scratch=%" PRIdPTR, closure,
closure->next_data.scratch);
closure->next_data.scratch -= CLOSURE_BARRIER_FIRST_REF_BIT; closure->next_data.scratch -= CLOSURE_BARRIER_FIRST_REF_BIT;
if (error != GRPC_ERROR_NONE) { if (error != GRPC_ERROR_NONE) {
if (closure->error == GRPC_ERROR_NONE) { if (closure->error == GRPC_ERROR_NONE) {
...@@ -772,6 +776,10 @@ static void add_fetched_slice_locked(grpc_exec_ctx *exec_ctx, ...@@ -772,6 +776,10 @@ static void add_fetched_slice_locked(grpc_exec_ctx *exec_ctx,
static void continue_fetching_send_locked(grpc_exec_ctx *exec_ctx, static void continue_fetching_send_locked(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport *t, grpc_chttp2_transport *t,
grpc_chttp2_stream *s) { grpc_chttp2_stream *s) {
gpr_log(GPR_DEBUG,
"continue_fetching_send_locked[%d]: fsm=%p fetched=%d tgt=%d", s->id,
s->fetching_send_message, s->fetched_send_message_length,
s->fetching_send_message->length);
if (s->fetching_send_message == NULL) { if (s->fetching_send_message == NULL) {
/* Stream was cancelled before message fetch completed */ /* Stream was cancelled before message fetch completed */
abort(); /* TODO(ctiller): what cleanup here? */ abort(); /* TODO(ctiller): what cleanup here? */
......
...@@ -77,6 +77,13 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, ...@@ -77,6 +77,13 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
GPR_TIMER_BEGIN("grpc_chttp2_begin_write", 0); GPR_TIMER_BEGIN("grpc_chttp2_begin_write", 0);
gpr_log(
GPR_DEBUG,
"grpc_chttp2_begin_write: outbuf_len0=%" PRIdPTR
" dirtied_local_settings=%d sent_local_settings=%d qbuf_len=%" PRIdPTR,
t->outbuf.length, t->dirtied_local_settings, t->sent_local_settings,
t->qbuf.length);
if (t->dirtied_local_settings && !t->sent_local_settings) { if (t->dirtied_local_settings && !t->sent_local_settings) {
gpr_slice_buffer_add( gpr_slice_buffer_add(
&t->outbuf, &t->outbuf,
...@@ -109,8 +116,13 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, ...@@ -109,8 +116,13 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
bool sent_initial_metadata = s->sent_initial_metadata; bool sent_initial_metadata = s->sent_initial_metadata;
bool now_writing = false; bool now_writing = false;
GRPC_CHTTP2_FLOW_MOVE_STREAM("write", t, s, outgoing_window, s, gpr_log(GPR_DEBUG,
outgoing_window); "grpc_chttp2_begin_write[%d]: sent_initial_metadata=%d "
"send_initial_metadata=%p announce_window=%d fcbuf_len=%" PRIdPTR
" s_win=%" PRId64 " t_win=%" PRId64 " send_trailing_metadata=%p",
s->id, sent_initial_metadata, s->send_initial_metadata,
s->announce_window, s->flow_controlled_buffer.length,
s->outgoing_window, t->outgoing_window, s->send_trailing_metadata);
/* send initial metadata if it's available */ /* send initial metadata if it's available */
if (!sent_initial_metadata && s->send_initial_metadata) { if (!sent_initial_metadata && s->send_initial_metadata) {
...@@ -123,7 +135,7 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, ...@@ -123,7 +135,7 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
now_writing = true; now_writing = true;
} }
/* send any window updates */ /* send any window updates */
if (s->announce_window > 0 && s->send_initial_metadata == NULL) { if (s->announce_window > 0 && s->sent_initial_metadata) {
uint32_t announce = s->announce_window; uint32_t announce = s->announce_window;
gpr_slice_buffer_add(&t->outbuf, gpr_slice_buffer_add(&t->outbuf,
grpc_chttp2_window_update_create( grpc_chttp2_window_update_create(
...@@ -156,7 +168,7 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, ...@@ -156,7 +168,7 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
send_bytes); send_bytes);
if (is_last_frame) { if (is_last_frame) {
s->send_trailing_metadata = NULL; s->send_trailing_metadata = NULL;
s->sent_trailing_metadata = 1; s->sent_trailing_metadata = true;
} }
s->sending_bytes += send_bytes; s->sending_bytes += send_bytes;
now_writing = true; now_writing = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment