Skip to content
Snippets Groups Projects
Commit 8fd7f652 authored by Nicolas Noble's avatar Nicolas Noble
Browse files

Merge pull request #6380 from ctiller/stress_fail

Stress test fixes
parents 1c4dfc6e 4ee1a627
No related branches found
No related tags found
No related merge requests found
......@@ -281,10 +281,9 @@ class CallOpRecvMessage {
if (message_ == nullptr) return;
if (recv_buf_) {
if (*status) {
got_message = true;
*status = SerializationTraits<R>::Deserialize(recv_buf_, message_,
max_message_size)
.ok();
got_message = *status = SerializationTraits<R>::Deserialize(
recv_buf_, message_, max_message_size)
.ok();
} else {
got_message = false;
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);
gpr_mu_lock(&t->executor.mu);
if (t->executor.pending_actions != NULL) {
hdr = t->executor.pending_actions;
t->executor.pending_actions = NULL;
if (t->executor.pending_actions_head != NULL) {
hdr = t->executor.pending_actions_head;
t->executor.pending_actions_head = t->executor.pending_actions_tail =
NULL;
gpr_mu_unlock(&t->executor.mu);
while (hdr != NULL) {
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);
continue;
}
hdr->next = t->executor.pending_actions;
t->executor.pending_actions = hdr;
hdr->next = NULL;
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");
gpr_mu_unlock(&t->executor.mu);
}
......
......@@ -323,7 +323,8 @@ struct grpc_chttp2_transport {
/** is a thread currently parsing */
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;
/** is the transport destroying itself? */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment