Skip to content
Snippets Groups Projects
Commit abd8fb7d authored by Craig Tiller's avatar Craig Tiller Committed by GitHub
Browse files

Merge pull request #10730 from ctiller/proxy_crash

Fix cancel on call creation for propagated calls
parents 8d7efef6 bea92ba0
No related branches found
No related tags found
No related merge requests found
...@@ -346,6 +346,8 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx, ...@@ -346,6 +346,8 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
gpr_timespec send_deadline = gpr_timespec send_deadline =
gpr_convert_clock_type(args->send_deadline, GPR_CLOCK_MONOTONIC); gpr_convert_clock_type(args->send_deadline, GPR_CLOCK_MONOTONIC);
bool immediately_cancel = false;
if (args->parent_call != NULL) { if (args->parent_call != NULL) {
child_call *cc = call->child_call = child_call *cc = call->child_call =
gpr_arena_alloc(arena, sizeof(child_call)); gpr_arena_alloc(arena, sizeof(child_call));
...@@ -386,8 +388,7 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx, ...@@ -386,8 +388,7 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
if (args->propagation_mask & GRPC_PROPAGATE_CANCELLATION) { if (args->propagation_mask & GRPC_PROPAGATE_CANCELLATION) {
call->cancellation_is_inherited = 1; call->cancellation_is_inherited = 1;
if (gpr_atm_acq_load(&args->parent_call->received_final_op_atm)) { if (gpr_atm_acq_load(&args->parent_call->received_final_op_atm)) {
cancel_with_error(exec_ctx, call, STATUS_FROM_API_OVERRIDE, immediately_cancel = true;
GRPC_ERROR_CANCELLED);
} }
} }
...@@ -422,6 +423,10 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx, ...@@ -422,6 +423,10 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
cancel_with_error(exec_ctx, call, STATUS_FROM_SURFACE, cancel_with_error(exec_ctx, call, STATUS_FROM_SURFACE,
GRPC_ERROR_REF(error)); GRPC_ERROR_REF(error));
} }
if (immediately_cancel) {
cancel_with_error(exec_ctx, call, STATUS_FROM_API_OVERRIDE,
GRPC_ERROR_CANCELLED);
}
if (args->cq != NULL) { if (args->cq != NULL) {
GPR_ASSERT( GPR_ASSERT(
args->pollset_set_alternative == NULL && args->pollset_set_alternative == NULL &&
......
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