aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/surface
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-04-19 08:33:31 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-04-19 08:33:31 -0700
commitbea92ba0e11dd7ffe552eed8b0fea0970f5d0393 (patch)
treea14d42721441237376f907c0bd412e3ddd8a36c7 /src/core/lib/surface
parentb7969ce1091b5911a5ccea9e1902a9bd48700807 (diff)
Fix bins/opt/end2end_test --gtest_filter=ProxyEnd2end/ProxyEnd2endTest.RpcDeadlineExpires/1 GRPC_POLL_STRATEGY=poll
Diffstat (limited to 'src/core/lib/surface')
-rw-r--r--src/core/lib/surface/call.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c
index 3e96d09798..a42fe7ef3c 100644
--- a/src/core/lib/surface/call.c
+++ b/src/core/lib/surface/call.c
@@ -346,6 +346,8 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
gpr_timespec send_deadline =
gpr_convert_clock_type(args->send_deadline, GPR_CLOCK_MONOTONIC);
+ bool immediately_cancel = false;
+
if (args->parent_call != NULL) {
child_call *cc = call->child_call =
gpr_arena_alloc(arena, sizeof(child_call));
@@ -386,8 +388,7 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
if (args->propagation_mask & GRPC_PROPAGATE_CANCELLATION) {
call->cancellation_is_inherited = 1;
if (gpr_atm_acq_load(&args->parent_call->received_final_op_atm)) {
- cancel_with_error(exec_ctx, call, STATUS_FROM_API_OVERRIDE,
- GRPC_ERROR_CANCELLED);
+ immediately_cancel = true;
}
}
@@ -422,6 +423,10 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx,
cancel_with_error(exec_ctx, call, STATUS_FROM_SURFACE,
GRPC_ERROR_REF(error));
}
+ if (immediately_cancel) {
+ cancel_with_error(exec_ctx, call, STATUS_FROM_API_OVERRIDE,
+ GRPC_ERROR_CANCELLED);
+ }
if (args->cq != NULL) {
GPR_ASSERT(
args->pollset_set_alternative == NULL &&