Merge github.com:grpc/grpc into propagate
Conflicts:
src/core/surface/channel.c
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index 17906c8..a87b53e 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -351,6 +351,15 @@
} data;
} grpc_op;
+#define GRPC_INHERIT_DEADLINE 1
+#define GRPC_INHERIT_CENSUS_CONTEXT 2
+/* TODO(ctiller):
+#define GRPC_INHERIT_CANCELLATION 4
+*/
+
+#define GRPC_INHERIT_DEFAULTS \
+ (GRPC_INHERIT_DEADLINE | GRPC_INHERIT_CENSUS_CONTEXT)
+
/** Initialize the grpc library.
It is not safe to call any other grpc functions before calling this.
@@ -429,6 +438,8 @@
completions are sent to 'completion_queue'. 'method' and 'host' need only
live through the invocation of this function. */
grpc_call *grpc_channel_create_call(grpc_channel *channel,
+ grpc_call *parent_call,
+ gpr_uint32 inheritance_mask,
grpc_completion_queue *completion_queue,
const char *method, const char *host,
gpr_timespec deadline);
@@ -439,8 +450,9 @@
/** Create a call given a handle returned from grpc_channel_register_call */
grpc_call *grpc_channel_create_registered_call(
- grpc_channel *channel, grpc_completion_queue *completion_queue,
- void *registered_call_handle, gpr_timespec deadline);
+ grpc_channel *channel, grpc_call *parent_call, gpr_uint32 inheritance_mask,
+ grpc_completion_queue *completion_queue, void *registered_call_handle,
+ gpr_timespec deadline);
/** Start a batch of operations defined in the array ops; when complete, post a
completion of type 'tag' to the completion queue bound to the call.
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index 327a096..e0496df 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -143,6 +143,7 @@
struct grpc_call {
grpc_completion_queue *cq;
grpc_channel *channel;
+ grpc_call *parent;
grpc_mdctx *metadata_context;
/* TODO(ctiller): share with cq if possible? */
gpr_mu mu;
@@ -290,7 +291,9 @@
static void lock(grpc_call *call);
static void unlock(grpc_call *call);
-grpc_call *grpc_call_create(grpc_channel *channel, grpc_completion_queue *cq,
+grpc_call *grpc_call_create(grpc_channel *channel, grpc_call *parent_call,
+ gpr_uint32 inheritance_mask,
+ grpc_completion_queue *cq,
const void *server_transport_data,
grpc_mdelem **add_initial_metadata,
size_t add_initial_metadata_count,
@@ -309,7 +312,26 @@
if (cq) {
GRPC_CQ_INTERNAL_REF(cq, "bind");
}
+ call->parent = parent_call;
call->is_client = server_transport_data == NULL;
+ if (parent_call != NULL) {
+ GRPC_CALL_INTERNAL_REF(parent_call, "child");
+ GPR_ASSERT(call->is_client);
+ GPR_ASSERT(!parent_call->is_client);
+
+ if (inheritance_mask & GRPC_INHERIT_DEADLINE) {
+ send_deadline = gpr_time_min(
+ gpr_convert_clock_type(send_deadline,
+ parent_call->send_deadline.clock_type),
+ parent_call->send_deadline);
+ }
+ if (inheritance_mask & GRPC_INHERIT_CENSUS_CONTEXT) {
+ grpc_call_context_set(call, GRPC_CONTEXT_TRACING,
+ parent_call->context[GRPC_CONTEXT_TRACING].value,
+ NULL);
+ }
+ /* cancellation is done last */
+ }
for (i = 0; i < GRPC_IOREQ_OP_COUNT; i++) {
call->request_set[i] = REQSET_EMPTY;
}
@@ -404,6 +426,7 @@
static void destroy_call(void *call, int ignored_success) {
size_t i;
grpc_call *c = call;
+ grpc_call *parent = c->parent;
grpc_call_stack_destroy(CALL_STACK_FROM_CALL(c));
GRPC_CHANNEL_INTERNAL_UNREF(c->channel, "call");
gpr_mu_destroy(&c->mu);
@@ -436,6 +459,9 @@
GRPC_CQ_INTERNAL_UNREF(c->cq, "bind");
}
gpr_free(c);
+ if (parent) {
+ GRPC_CALL_INTERNAL_UNREF(parent, "child", 1);
+ }
}
#ifdef GRPC_CALL_REF_COUNT_DEBUG
@@ -1283,9 +1309,9 @@
}
GRPC_CALL_INTERNAL_REF(call, "alarm");
call->have_alarm = 1;
- grpc_alarm_init(&call->alarm,
- gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC),
- call_alarm, call, gpr_now(GPR_CLOCK_MONOTONIC));
+ call->send_deadline = gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC);
+ grpc_alarm_init(&call->alarm, call->send_deadline, call_alarm, call,
+ gpr_now(GPR_CLOCK_MONOTONIC));
}
/* we offset status by a small amount when storing it into transport metadata
diff --git a/src/core/surface/call.h b/src/core/surface/call.h
index 265638d..f2cc8fa 100644
--- a/src/core/surface/call.h
+++ b/src/core/surface/call.h
@@ -85,7 +85,9 @@
typedef void (*grpc_ioreq_completion_func)(grpc_call *call, int success,
void *user_data);
-grpc_call *grpc_call_create(grpc_channel *channel, grpc_completion_queue *cq,
+grpc_call *grpc_call_create(grpc_channel *channel, grpc_call *parent_call,
+ gpr_uint32 inheritance_mask,
+ grpc_completion_queue *cq,
const void *server_transport_data,
grpc_mdelem **add_initial_metadata,
size_t add_initial_metadata_count,
diff --git a/src/core/surface/channel.c b/src/core/surface/channel.c
index 81f673f..c90b479 100644
--- a/src/core/surface/channel.c
+++ b/src/core/surface/channel.c
@@ -146,7 +146,8 @@
}
static grpc_call *grpc_channel_create_call_internal(
- grpc_channel *channel, grpc_completion_queue *cq, grpc_mdelem *path_mdelem,
+ grpc_channel *channel, grpc_call *parent_call, gpr_uint32 inheritance_mask,
+ grpc_completion_queue *cq, grpc_mdelem *path_mdelem,
grpc_mdelem *authority_mdelem, gpr_timespec deadline) {
grpc_mdelem *send_metadata[2];
int num_metadata = 0;
@@ -158,16 +159,18 @@
send_metadata[num_metadata++] = authority_mdelem;
}
- return grpc_call_create(channel, cq, NULL, send_metadata,
- num_metadata, deadline);
+ return grpc_call_create(channel, parent_call, inheritance_mask, cq, NULL,
+ send_metadata, num_metadata, deadline);
}
grpc_call *grpc_channel_create_call(grpc_channel *channel,
+ grpc_call *parent_call,
+ gpr_uint32 inheritance_mask,
grpc_completion_queue *cq,
const char *method, const char *host,
gpr_timespec deadline) {
return grpc_channel_create_call_internal(
- channel, cq,
+ channel, parent_call, inheritance_mask, cq,
grpc_mdelem_from_metadata_strings(
channel->metadata_context, GRPC_MDSTR_REF(channel->path_string),
grpc_mdstr_from_string(channel->metadata_context, method, 0)),
@@ -195,11 +198,13 @@
}
grpc_call *grpc_channel_create_registered_call(
- grpc_channel *channel, grpc_completion_queue *completion_queue,
- void *registered_call_handle, gpr_timespec deadline) {
+ grpc_channel *channel, grpc_call *parent_call, gpr_uint32 inheritance_mask,
+ grpc_completion_queue *completion_queue, void *registered_call_handle,
+ gpr_timespec deadline) {
registered_call *rc = registered_call_handle;
return grpc_channel_create_call_internal(
- channel, completion_queue, GRPC_MDELEM_REF(rc->path),
+ channel, parent_call, inheritance_mask, completion_queue,
+ GRPC_MDELEM_REF(rc->path),
rc->authority ? GRPC_MDELEM_REF(rc->authority) : NULL, deadline);
}
diff --git a/src/core/surface/server.c b/src/core/surface/server.c
index c370a9b..612b338 100644
--- a/src/core/surface/server.c
+++ b/src/core/surface/server.c
@@ -623,8 +623,8 @@
const void *transport_server_data) {
channel_data *chand = cd;
/* create a call */
- grpc_call_create(chand->channel, NULL, transport_server_data, NULL, 0,
- gpr_inf_future(GPR_CLOCK_REALTIME));
+ grpc_call_create(chand->channel, NULL, 0, NULL, transport_server_data, NULL,
+ 0, gpr_inf_future(GPR_CLOCK_MONOTONIC));
}
static void channel_connectivity_changed(void *cd, int iomgr_status_ignored) {
diff --git a/src/cpp/client/channel.cc b/src/cpp/client/channel.cc
index 5df81e6..c2f9db2 100644
--- a/src/cpp/client/channel.cc
+++ b/src/cpp/client/channel.cc
@@ -58,16 +58,16 @@
Call Channel::CreateCall(const RpcMethod& method, ClientContext* context,
CompletionQueue* cq) {
- auto c_call =
- method.channel_tag() && context->authority().empty()
- ? grpc_channel_create_registered_call(c_channel_, cq->cq(),
- method.channel_tag(),
- context->raw_deadline())
- : grpc_channel_create_call(c_channel_, cq->cq(), method.name(),
- context->authority().empty()
- ? target_.c_str()
- : context->authority().c_str(),
- context->raw_deadline());
+ auto c_call = method.channel_tag() && context->authority().empty()
+ ? grpc_channel_create_registered_call(
+ c_channel_, NULL, GRPC_INHERIT_DEFAULTS, cq->cq(),
+ method.channel_tag(), context->raw_deadline())
+ : grpc_channel_create_call(
+ c_channel_, NULL, GRPC_INHERIT_DEFAULTS, cq->cq(),
+ method.name(), context->authority().empty()
+ ? target_.c_str()
+ : context->authority().c_str(),
+ context->raw_deadline());
grpc_census_call_set_context(c_call, context->census_context());
GRPC_TIMER_MARK(GRPC_PTAG_CPP_CALL_CREATED, c_call);
context->set_call(c_call, shared_from_this());
diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c
index 49a0471..425d226 100644
--- a/src/csharp/ext/grpc_csharp_ext.c
+++ b/src/csharp/ext/grpc_csharp_ext.c
@@ -379,7 +379,8 @@
grpcsharp_channel_create_call(grpc_channel *channel, grpc_completion_queue *cq,
const char *method, const char *host,
gpr_timespec deadline) {
- return grpc_channel_create_call(channel, cq, method, host, deadline);
+ return grpc_channel_create_call(channel, NULL, GRPC_INHERIT_DEFAULTS, cq,
+ method, host, deadline);
}
/* Channel args */
diff --git a/src/node/ext/call.cc b/src/node/ext/call.cc
index dc45c8d..e4451c3 100644
--- a/src/node/ext/call.cc
+++ b/src/node/ext/call.cc
@@ -511,8 +511,9 @@
double deadline = args[2]->NumberValue();
grpc_channel *wrapped_channel = channel->GetWrappedChannel();
grpc_call *wrapped_call = grpc_channel_create_call(
- wrapped_channel, CompletionQueueAsyncWorker::GetQueue(), *method,
- channel->GetHost(), MillisecondsToTimespec(deadline));
+ wrapped_channel, NULL, GRPC_INHERIT_DEFAULTS,
+ CompletionQueueAsyncWorker::GetQueue(), *method, channel->GetHost(),
+ MillisecondsToTimespec(deadline));
call = new Call(wrapped_call);
args.This()->SetHiddenValue(NanNew("channel_"), channel_object);
}
diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c
index 1f76c73..26499b7 100644
--- a/src/php/ext/grpc/call.c
+++ b/src/php/ext/grpc/call.c
@@ -240,8 +240,8 @@
(wrapped_grpc_timeval *)zend_object_store_get_object(
deadline_obj TSRMLS_CC);
call->wrapped = grpc_channel_create_call(
- channel->wrapped, completion_queue, method, channel->target,
- deadline->wrapped);
+ channel->wrapped, NULL, GRPC_INHERIT_DEFAULTS, completion_queue, method,
+ channel->target, deadline->wrapped);
}
/**
diff --git a/src/python/grpcio/grpc/_adapter/_c/types/channel.c b/src/python/grpcio/grpc/_adapter/_c/types/channel.c
index feb256c..68eaea4 100644
--- a/src/python/grpcio/grpc/_adapter/_c/types/channel.c
+++ b/src/python/grpcio/grpc/_adapter/_c/types/channel.c
@@ -128,7 +128,7 @@
}
call = pygrpc_Call_new_empty(cq);
call->c_call = grpc_channel_create_call(
- self->c_chan, cq->c_cq, method, host,
+ self->c_chan, NULL, GRPC_INHERIT_DEFAULTS, cq->c_cq, method, host,
pygrpc_cast_double_to_gpr_timespec(deadline));
return call;
}
diff --git a/src/ruby/ext/grpc/rb_channel.c b/src/ruby/ext/grpc/rb_channel.c
index 0cb6fa2..506e7cd 100644
--- a/src/ruby/ext/grpc/rb_channel.c
+++ b/src/ruby/ext/grpc/rb_channel.c
@@ -212,10 +212,10 @@
return Qnil;
}
- call =
- grpc_channel_create_call(ch, cq, method_chars, host_chars,
- grpc_rb_time_timeval(deadline,
- /* absolute time */ 0));
+ call = grpc_channel_create_call(ch, NULL, GRPC_INHERIT_DEFAULTS, cq,
+ method_chars, host_chars,
+ grpc_rb_time_timeval(deadline,
+ /* absolute time */ 0));
if (call == NULL) {
rb_raise(rb_eRuntimeError, "cannot create call with method %s",
method_chars);
diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c
index 77bea2a..e5e8df6 100644
--- a/test/core/end2end/dualstack_socket_test.c
+++ b/test/core/end2end/dualstack_socket_test.c
@@ -131,8 +131,8 @@
}
/* Send a trivial request. */
- c = grpc_channel_create_call(client, cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(client, NULL, GRPC_INHERIT_DEFAULTS, cq, "/foo",
+ "foo.test.google.fr", deadline);
GPR_ASSERT(c);
op = ops;
diff --git a/test/core/end2end/no_server_test.c b/test/core/end2end/no_server_test.c
index 6f1133c..9e1c15e 100644
--- a/test/core/end2end/no_server_test.c
+++ b/test/core/end2end/no_server_test.c
@@ -62,7 +62,8 @@
/* create a call, channel to a non existant server */
chan = grpc_insecure_channel_create("nonexistant:54321", NULL);
- call = grpc_channel_create_call(chan, cq, "/Foo", "nonexistant", deadline);
+ call = grpc_channel_create_call(chan, NULL, GRPC_INHERIT_DEFAULTS, cq, "/Foo",
+ "nonexistant", deadline);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
diff --git a/test/core/end2end/tests/bad_hostname.c b/test/core/end2end/tests/bad_hostname.c
index 2509ea0..ee4ad2d 100644
--- a/test/core/end2end/tests/bad_hostname.c
+++ b/test/core/end2end/tests/bad_hostname.c
@@ -113,8 +113,8 @@
char *details = NULL;
size_t details_capacity = 0;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "slartibartfast.local",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "slartibartfast.local", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c
index 1cc6b2d..4462e03 100644
--- a/test/core/end2end/tests/cancel_after_accept.c
+++ b/test/core/end2end/tests/cancel_after_accept.c
@@ -126,8 +126,8 @@
grpc_raw_byte_buffer_create(&response_payload_slice, 1);
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c b/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c
index 015d437..2ca12d9 100644
--- a/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c
+++ b/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c
@@ -126,8 +126,8 @@
grpc_raw_byte_buffer_create(&response_payload_slice, 1);
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c
index 414ec70..7f72fa2 100644
--- a/test/core/end2end/tests/cancel_after_invoke.c
+++ b/test/core/end2end/tests/cancel_after_invoke.c
@@ -121,8 +121,8 @@
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c
index 3cfe56e..4db2f97 100644
--- a/test/core/end2end/tests/cancel_before_invoke.c
+++ b/test/core/end2end/tests/cancel_before_invoke.c
@@ -119,8 +119,8 @@
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_cancel(c));
diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.c b/test/core/end2end/tests/cancel_in_a_vacuum.c
index 8bffc3f..c75b94d 100644
--- a/test/core/end2end/tests/cancel_in_a_vacuum.c
+++ b/test/core/end2end/tests/cancel_in_a_vacuum.c
@@ -107,8 +107,8 @@
gpr_timespec deadline = five_seconds_time();
cq_verifier *v_client = cq_verifier_create(f.cq);
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c));
diff --git a/test/core/end2end/tests/census_simple_request.c b/test/core/end2end/tests/census_simple_request.c
index b414755..2fb5e3e 100644
--- a/test/core/end2end/tests/census_simple_request.c
+++ b/test/core/end2end/tests/census_simple_request.c
@@ -111,8 +111,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo",
- "foo.test.google.fr:1234", deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/disappearing_server.c b/test/core/end2end/tests/disappearing_server.c
index a5fd74e..473e69c 100644
--- a/test/core/end2end/tests/disappearing_server.c
+++ b/test/core/end2end/tests/disappearing_server.c
@@ -97,8 +97,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f->client, f->cq, "/foo",
- "foo.test.google.fr:1234", deadline);
+ c = grpc_channel_create_call(f->client, NULL, GRPC_INHERIT_DEFAULTS, f->cq,
+ "/foo", "foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c b/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c
index adc59b4..74689db 100644
--- a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c
+++ b/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c
@@ -105,8 +105,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/empty_batch.c b/test/core/end2end/tests/empty_batch.c
index db8458d..87d0d7b 100644
--- a/test/core/end2end/tests/empty_batch.c
+++ b/test/core/end2end/tests/empty_batch.c
@@ -105,8 +105,8 @@
cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op *op = NULL;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, op, 0, tag(1)));
diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.c
index 8c1889a..f2f325d 100644
--- a/test/core/end2end/tests/graceful_server_shutdown.c
+++ b/test/core/end2end/tests/graceful_server_shutdown.c
@@ -112,8 +112,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c
index 744a9ad..060536f 100644
--- a/test/core/end2end/tests/invoke_large_request.c
+++ b/test/core/end2end/tests/invoke_large_request.c
@@ -128,8 +128,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c
index 1204c07..49dd9c7 100644
--- a/test/core/end2end/tests/max_concurrent_streams.c
+++ b/test/core/end2end/tests/max_concurrent_streams.c
@@ -113,8 +113,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo",
- "foo.test.google.fr:1234", deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -244,11 +244,11 @@
/* start two requests - ensuring that the second is not accepted until
the first completes */
deadline = n_seconds_time(1000);
- c1 = grpc_channel_create_call(f.client, f.cq, "/alpha",
- "foo.test.google.fr:1234", deadline);
+ c1 = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/alpha", "foo.test.google.fr:1234", deadline);
GPR_ASSERT(c1);
- c2 = grpc_channel_create_call(f.client, f.cq, "/beta",
- "foo.test.google.fr:1234", deadline);
+ c2 = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/beta", "foo.test.google.fr:1234", deadline);
GPR_ASSERT(c2);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c
index ea59a93..fa12737 100644
--- a/test/core/end2end/tests/max_message_length.c
+++ b/test/core/end2end/tests/max_message_length.c
@@ -128,8 +128,8 @@
f = begin_test(config, "test_max_message_length", NULL, &server_args);
cqv = cq_verifier_create(f.cq);
- c = grpc_channel_create_call(f.client, f.cq, "/foo",
- "foo.test.google.fr:1234",
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr:1234",
gpr_inf_future(GPR_CLOCK_REALTIME));
GPR_ASSERT(c);
diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c
index 8a3ec96..6efaa4b 100644
--- a/test/core/end2end/tests/ping_pong_streaming.c
+++ b/test/core/end2end/tests/ping_pong_streaming.c
@@ -124,8 +124,8 @@
gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you");
- c = grpc_channel_create_call(f.client, f.cq, "/foo",
- "foo.test.google.fr:1234", deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/registered_call.c b/test/core/end2end/tests/registered_call.c
index f44fd3a..2d5999e 100644
--- a/test/core/end2end/tests/registered_call.c
+++ b/test/core/end2end/tests/registered_call.c
@@ -115,7 +115,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_registered_call(f.client, f.cq, rc, deadline);
+ c = grpc_channel_create_registered_call(f.client, NULL, GRPC_INHERIT_DEFAULTS,
+ f.cq, rc, deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c
index 8b8a11b..c2e1850 100644
--- a/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c
+++ b/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c
@@ -143,8 +143,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/request_response_with_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_metadata_and_payload.c
index 9821d78..c0b6d14 100644
--- a/test/core/end2end/tests/request_response_with_metadata_and_payload.c
+++ b/test/core/end2end/tests/request_response_with_metadata_and_payload.c
@@ -129,8 +129,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/request_response_with_payload.c b/test/core/end2end/tests/request_response_with_payload.c
index 38d3432..7c3b004 100644
--- a/test/core/end2end/tests/request_response_with_payload.c
+++ b/test/core/end2end/tests/request_response_with_payload.c
@@ -121,8 +121,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/request_response_with_payload_and_call_creds.c b/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
index b5c743b..9337b88 100644
--- a/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
+++ b/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
@@ -130,8 +130,8 @@
grpc_end2end_test_fixture f =
begin_test(config, "test_call_creds_failure", NULL, NULL);
gpr_timespec deadline = five_seconds_time();
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
/* Try with credentials unfit to be set on a call (channel creds). */
@@ -175,8 +175,8 @@
grpc_credentials *creds = NULL;
grpc_auth_context *s_auth_context = NULL;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
creds = grpc_iam_credentials_create(iam_token, iam_selector);
GPR_ASSERT(creds != NULL);
diff --git a/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c
index a5c0851..1901a86 100644
--- a/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c
+++ b/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c
@@ -131,8 +131,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/request_with_compressed_payload.c b/test/core/end2end/tests/request_with_compressed_payload.c
index 2599f79..b6f20e8 100644
--- a/test/core/end2end/tests/request_with_compressed_payload.c
+++ b/test/core/end2end/tests/request_with_compressed_payload.c
@@ -141,8 +141,8 @@
f = begin_test(config, test_name, client_args, server_args);
cqv = cq_verifier_create(f.cq);
- c = grpc_channel_create_call(f.client, f.cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.c
index 0bfedca..a072d86 100644
--- a/test/core/end2end/tests/request_with_flags.c
+++ b/test/core/end2end/tests/request_with_flags.c
@@ -121,8 +121,8 @@
size_t details_capacity = 0;
grpc_call_error expectation;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/request_with_large_metadata.c b/test/core/end2end/tests/request_with_large_metadata.c
index ad34c69..fb33b97 100644
--- a/test/core/end2end/tests/request_with_large_metadata.c
+++ b/test/core/end2end/tests/request_with_large_metadata.c
@@ -122,8 +122,8 @@
int was_cancelled = 2;
const int large_size = 64 * 1024;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
meta.key = "key";
diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c
index 8db6457..302c7e7 100644
--- a/test/core/end2end/tests/request_with_payload.c
+++ b/test/core/end2end/tests/request_with_payload.c
@@ -120,8 +120,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/server_finishes_request.c b/test/core/end2end/tests/server_finishes_request.c
index 062a59a..a27ac51 100644
--- a/test/core/end2end/tests/server_finishes_request.c
+++ b/test/core/end2end/tests/server_finishes_request.c
@@ -115,8 +115,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo",
- "foo.test.google.fr:1234", deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.c
index 034e974..0d18ff6 100644
--- a/test/core/end2end/tests/simple_delayed_request.c
+++ b/test/core/end2end/tests/simple_delayed_request.c
@@ -107,8 +107,8 @@
config.init_client(f, client_args);
- c = grpc_channel_create_call(f->client, f->cq, "/foo", "foo.test.google.fr",
- deadline);
+ c = grpc_channel_create_call(f->client, NULL, GRPC_INHERIT_DEFAULTS, f->cq,
+ "/foo", "foo.test.google.fr", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/end2end/tests/simple_request.c b/test/core/end2end/tests/simple_request.c
index ca783af..d367ef5 100644
--- a/test/core/end2end/tests/simple_request.c
+++ b/test/core/end2end/tests/simple_request.c
@@ -116,8 +116,8 @@
int was_cancelled = 2;
char *peer;
- c = grpc_channel_create_call(f.client, f.cq, "/foo",
- "foo.test.google.fr:1234", deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
peer = grpc_call_get_peer(c);
diff --git a/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c b/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c
index 2cd638c..d5bd482 100644
--- a/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c
+++ b/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c
@@ -115,8 +115,8 @@
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.cq, "/foo",
- "foo.test.google.fr:1234", deadline);
+ c = grpc_channel_create_call(f.client, NULL, GRPC_INHERIT_DEFAULTS, f.cq,
+ "/foo", "foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
diff --git a/test/core/fling/client.c b/test/core/fling/client.c
index 5647a16..efe09bb 100644
--- a/test/core/fling/client.c
+++ b/test/core/fling/client.c
@@ -89,9 +89,9 @@
}
static void step_ping_pong_request(void) {
- call =
- grpc_channel_create_call(channel, cq, "/Reflector/reflectUnary",
- "localhost", gpr_inf_future(GPR_CLOCK_REALTIME));
+ call = grpc_channel_create_call(channel, NULL, GRPC_INHERIT_DEFAULTS, cq,
+ "/Reflector/reflectUnary", "localhost",
+ gpr_inf_future(GPR_CLOCK_REALTIME));
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_start_batch(call, ops, op - ops, (void *)1));
grpc_completion_queue_next(cq, gpr_inf_future(GPR_CLOCK_REALTIME));
@@ -101,9 +101,9 @@
}
static void init_ping_pong_stream(void) {
- call =
- grpc_channel_create_call(channel, cq, "/Reflector/reflectStream",
- "localhost", gpr_inf_future(GPR_CLOCK_REALTIME));
+ call = grpc_channel_create_call(channel, NULL, GRPC_INHERIT_DEFAULTS, cq,
+ "/Reflector/reflectStream", "localhost",
+ gpr_inf_future(GPR_CLOCK_REALTIME));
stream_init_op.op = GRPC_OP_SEND_INITIAL_METADATA;
stream_init_op.data.send_initial_metadata.count = 0;
GPR_ASSERT(GRPC_CALL_OK ==
diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c
index 3a7a3a3..fbe5f04 100644
--- a/test/core/surface/lame_client_test.c
+++ b/test/core/surface/lame_client_test.c
@@ -60,7 +60,8 @@
chan = grpc_lame_client_channel_create("lampoon:national");
GPR_ASSERT(chan);
cq = grpc_completion_queue_create();
- call = grpc_channel_create_call(chan, cq, "/Foo", "anywhere",
+ call = grpc_channel_create_call(chan, NULL, GRPC_INHERIT_DEFAULTS, cq, "/Foo",
+ "anywhere",
GRPC_TIMEOUT_SECONDS_TO_DEADLINE(100));
GPR_ASSERT(call);
cqv = cq_verifier_create(cq);