Merge pull request #6380 from ctiller/stress_fail

Stress test fixes
pull/6403/head
Nicolas Noble 9 years ago
commit 8fd7f652b7
  1. 7
      include/grpc++/impl/codegen/call.h
  2. 17
      src/core/ext/transport/chttp2/transport/chttp2_transport.c
  3. 3
      src/core/ext/transport/chttp2/transport/internal.h

@ -281,10 +281,9 @@ class CallOpRecvMessage {
if (message_ == nullptr) return; if (message_ == nullptr) return;
if (recv_buf_) { if (recv_buf_) {
if (*status) { if (*status) {
got_message = true; got_message = *status = SerializationTraits<R>::Deserialize(
*status = SerializationTraits<R>::Deserialize(recv_buf_, message_, recv_buf_, message_, max_message_size)
max_message_size) .ok();
.ok();
} else { } else {
got_message = false; got_message = false;
g_core_codegen_interface->grpc_byte_buffer_destroy(recv_buf_); g_core_codegen_interface->grpc_byte_buffer_destroy(recv_buf_);

@ -629,9 +629,10 @@ static void finish_global_actions(grpc_exec_ctx *exec_ctx,
check_read_ops(exec_ctx, &t->global); check_read_ops(exec_ctx, &t->global);
gpr_mu_lock(&t->executor.mu); gpr_mu_lock(&t->executor.mu);
if (t->executor.pending_actions != NULL) { if (t->executor.pending_actions_head != NULL) {
hdr = t->executor.pending_actions; hdr = t->executor.pending_actions_head;
t->executor.pending_actions = NULL; t->executor.pending_actions_head = t->executor.pending_actions_tail =
NULL;
gpr_mu_unlock(&t->executor.mu); gpr_mu_unlock(&t->executor.mu);
while (hdr != NULL) { while (hdr != NULL) {
hdr->action(exec_ctx, t, hdr->stream, hdr->arg); hdr->action(exec_ctx, t, hdr->stream, hdr->arg);
@ -686,8 +687,14 @@ void grpc_chttp2_run_with_global_lock(grpc_exec_ctx *exec_ctx,
gpr_free(hdr); gpr_free(hdr);
continue; continue;
} }
hdr->next = t->executor.pending_actions; hdr->next = NULL;
t->executor.pending_actions = hdr; if (t->executor.pending_actions_head != NULL) {
t->executor.pending_actions_tail =
t->executor.pending_actions_tail->next = hdr;
} else {
t->executor.pending_actions_tail = t->executor.pending_actions_head =
hdr;
}
REF_TRANSPORT(t, "pending_action"); REF_TRANSPORT(t, "pending_action");
gpr_mu_unlock(&t->executor.mu); gpr_mu_unlock(&t->executor.mu);
} }

@ -323,7 +323,8 @@ struct grpc_chttp2_transport {
/** is a thread currently parsing */ /** is a thread currently parsing */
bool parsing_active; bool parsing_active;
grpc_chttp2_executor_action_header *pending_actions; grpc_chttp2_executor_action_header *pending_actions_head;
grpc_chttp2_executor_action_header *pending_actions_tail;
} executor; } executor;
/** is the transport destroying itself? */ /** is the transport destroying itself? */

Loading…
Cancel
Save