diff options
author | Craig Tiller <ctiller@google.com> | 2017-02-01 09:29:56 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-02-01 09:29:56 -0800 |
commit | 27ffc9b551f4df23598b8b9819012bfc57a3da88 (patch) | |
tree | 5780a612bc0947970d7bc774b11dff0175b095c8 /src/core/lib/surface | |
parent | a5b1a89779b70b9bcf99ac1087b08fd5fb6fa253 (diff) | |
parent | 4040e13cc5b46a03c67bae8506668d54d978c56d (diff) |
Merge github.com:grpc/grpc into bwest
Diffstat (limited to 'src/core/lib/surface')
-rw-r--r-- | src/core/lib/surface/call.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index 5519a1ec7e..27097faaa6 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -242,10 +242,18 @@ static void post_batch_completion(grpc_exec_ctx *exec_ctx, batch_control *bctl); static void add_batch_error(grpc_exec_ctx *exec_ctx, batch_control *bctl, grpc_error *error); +static void add_init_error(grpc_error **composite, grpc_error *new) { + if (new == GRPC_ERROR_NONE) return; + if (*composite == GRPC_ERROR_NONE) + *composite = GRPC_ERROR_CREATE("Call creation failed"); + *composite = grpc_error_add_child(*composite, new); +} + grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx, const grpc_call_create_args *args, grpc_call **out_call) { size_t i, j; + grpc_error *error = GRPC_ERROR_NONE; grpc_channel_stack *channel_stack = grpc_channel_get_channel_stack(args->channel); grpc_call *call; @@ -308,8 +316,11 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx, grpc_call_context_set( call, GRPC_CONTEXT_TRACING, args->parent_call->context[GRPC_CONTEXT_TRACING].value, NULL); - } else { - GPR_ASSERT(args->propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT); + } else if (0 == + (args->propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT)) { + add_init_error(&error, + GRPC_ERROR_CREATE("Census tracing propagation requested " + "without Census context propagation")); } if (args->propagation_mask & GRPC_PROPAGATE_CANCELLATION) { call->cancellation_is_inherited = 1; @@ -332,10 +343,11 @@ grpc_error *grpc_call_create(grpc_exec_ctx *exec_ctx, GRPC_CHANNEL_INTERNAL_REF(args->channel, "call"); /* initial refcount dropped by grpc_call_destroy */ - grpc_error *error = grpc_call_stack_init( - exec_ctx, channel_stack, 1, destroy_call, call, call->context, - args->server_transport_data, path, call->start_time, send_deadline, - CALL_STACK_FROM_CALL(call)); + add_init_error(&error, grpc_call_stack_init(exec_ctx, channel_stack, 1, + destroy_call, call, call->context, + args->server_transport_data, path, + call->start_time, send_deadline, + CALL_STACK_FROM_CALL(call))); if (error != GRPC_ERROR_NONE) { cancel_with_error(exec_ctx, call, GRPC_ERROR_REF(error)); } |