Prefix grpc_cq_polling_type enums with GRPC_CQ_

reviewable/pr9972/r1
Sree Kuchibhotla 8 years ago
parent 9f71b17707
commit 1dbd981cf8
  1. 2
      include/grpc++/impl/codegen/client_unary_call.h
  2. 2
      include/grpc++/impl/codegen/completion_queue.h
  3. 6
      include/grpc++/impl/codegen/sync_stream.h
  4. 14
      include/grpc/grpc.h
  5. 4
      src/core/lib/surface/completion_queue.c
  6. 4
      src/cpp/server/server_cc.cc
  7. 6
      test/core/bad_client/bad_client.c
  8. 2
      test/core/bad_ssl/bad_ssl_test.c
  9. 11
      test/core/bad_ssl/server_common.c
  10. 7
      test/core/client_channel/lb_policies_test.c
  11. 3
      test/core/client_channel/set_initial_connect_string_test.c
  12. 3
      test/core/end2end/bad_server_response_test.c
  13. 3
      test/core/end2end/connection_refused_test.c
  14. 6
      test/core/end2end/dualstack_socket_test.c
  15. 5
      test/core/end2end/fixtures/h2_census.c
  16. 5
      test/core/end2end/fixtures/h2_compress.c
  17. 5
      test/core/end2end/fixtures/h2_fakesec.c
  18. 5
      test/core/end2end/fixtures/h2_fd.c
  19. 5
      test/core/end2end/fixtures/h2_full+pipe.c
  20. 12
      test/core/end2end/fixtures/h2_full+trace.c
  21. 5
      test/core/end2end/fixtures/h2_full.c
  22. 5
      test/core/end2end/fixtures/h2_http_proxy.c
  23. 5
      test/core/end2end/fixtures/h2_load_reporting.c
  24. 5
      test/core/end2end/fixtures/h2_oauth2.c
  25. 5
      test/core/end2end/fixtures/h2_proxy.c
  26. 5
      test/core/end2end/fixtures/h2_sockpair+trace.c
  27. 5
      test/core/end2end/fixtures/h2_sockpair.c
  28. 5
      test/core/end2end/fixtures/h2_sockpair_1byte.c
  29. 5
      test/core/end2end/fixtures/h2_ssl.c
  30. 5
      test/core/end2end/fixtures/h2_ssl_cert.c
  31. 5
      test/core/end2end/fixtures/h2_ssl_proxy.c
  32. 12
      test/core/end2end/fixtures/h2_uds.c
  33. 3
      test/core/end2end/fixtures/proxy.c
  34. 2
      test/core/end2end/fuzzers/api_fuzzer.c
  35. 2
      test/core/end2end/fuzzers/client_fuzzer.c
  36. 2
      test/core/end2end/fuzzers/server_fuzzer.c
  37. 3
      test/core/end2end/goaway_server_test.c
  38. 4
      test/core/end2end/invalid_call_argument_test.c
  39. 7
      test/core/end2end/multiple_server_queues_test.c
  40. 3
      test/core/end2end/no_server_test.c
  41. 3
      test/core/fling/client.c
  42. 12
      test/core/fling/server.c
  43. 2
      test/core/handshake/client_ssl.c
  44. 2
      test/core/handshake/server_ssl.c
  45. 8
      test/core/memory_usage/client.c
  46. 12
      test/core/memory_usage/server.c
  47. 3
      test/core/surface/alarm_test.c
  48. 31
      test/core/surface/completion_queue_test.c
  49. 5
      test/core/surface/completion_queue_threading_test.c
  50. 7
      test/core/surface/concurrent_connectivity_test.c
  51. 3
      test/core/surface/lame_client_test.c
  52. 4
      test/core/surface/sequential_connectivity_test.c
  53. 2
      test/core/surface/server_chttp2_test.c
  54. 6
      test/core/surface/server_test.c
  55. 13
      test/cpp/grpclb/grpclb_test.cc
  56. 2
      test/cpp/microbenchmarks/bm_call_create.cc
  57. 12
      test/cpp/microbenchmarks/bm_cq.cc

@ -52,7 +52,7 @@ template <class InputMessage, class OutputMessage>
Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method, Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context, const InputMessage& request, ClientContext* context, const InputMessage& request,
OutputMessage* result) { OutputMessage* result) {
CompletionQueue cq(GRPC_CQ_PLUCK, DEFAULT_POLLING); CompletionQueue cq(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING);
Call call(channel->CreateCall(method, context, &cq)); Call call(channel->CreateCall(method, context, &cq));
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>, CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,

@ -103,7 +103,7 @@ class CompletionQueue : private GrpcLibraryCodegen {
public: public:
/// Default constructor. Implicitly creates a \a grpc_completion_queue /// Default constructor. Implicitly creates a \a grpc_completion_queue
/// instance. /// instance.
CompletionQueue() : CompletionQueue(GRPC_CQ_NEXT, DEFAULT_POLLING) {} CompletionQueue() : CompletionQueue(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING) {}
/// Wrap \a take, taking ownership of the instance. /// Wrap \a take, taking ownership of the instance.
/// ///

@ -138,7 +138,7 @@ class ClientReader final : public ClientReaderInterface<R> {
ClientReader(ChannelInterface* channel, const RpcMethod& method, ClientReader(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context, const W& request) ClientContext* context, const W& request)
: context_(context), : context_(context),
cq_(GRPC_CQ_PLUCK, DEFAULT_POLLING), cq_(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING),
call_(channel->CreateCall(method, context, &cq_)) { call_(channel->CreateCall(method, context, &cq_)) {
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpClientSendClose> CallOpClientSendClose>
@ -212,7 +212,7 @@ class ClientWriter : public ClientWriterInterface<W> {
ClientWriter(ChannelInterface* channel, const RpcMethod& method, ClientWriter(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context, R* response) ClientContext* context, R* response)
: context_(context), : context_(context),
cq_(GRPC_CQ_PLUCK, DEFAULT_POLLING), cq_(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING),
call_(channel->CreateCall(method, context, &cq_)) { call_(channel->CreateCall(method, context, &cq_)) {
finish_ops_.RecvMessage(response); finish_ops_.RecvMessage(response);
finish_ops_.AllowNoMessage(); finish_ops_.AllowNoMessage();
@ -297,7 +297,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method, ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context) ClientContext* context)
: context_(context), : context_(context),
cq_(GRPC_CQ_PLUCK, DEFAULT_POLLING), cq_(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING),
call_(channel->CreateCall(method, context, &cq_)) { call_(channel->CreateCall(method, context, &cq_)) {
CallOpSet<CallOpSendInitialMetadata> ops; CallOpSet<CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(context->send_initial_metadata_, ops.SendInitialMetadata(context->send_initial_metadata_,

@ -108,23 +108,23 @@ typedef enum {
I/O progress can only be made when grpc_completion_queue_next() or I/O progress can only be made when grpc_completion_queue_next() or
grpc_completion_queue_pluck() are called on the completion queue (unless the grpc_completion_queue_pluck() are called on the completion queue (unless the
grpc_cq_polling_type is NON_POLLING) and hence it is very important to grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important
actively call these APIs */ to actively call these APIs */
typedef enum { typedef enum {
/** The completion queue will have an associated pollset and there is no /** The completion queue will have an associated pollset and there is no
restriction on the type of file descriptors the pollset may contain */ restriction on the type of file descriptors the pollset may contain */
DEFAULT_POLLING, GRPC_CQ_DEFAULT_POLLING,
/** Similar to DEFAULT_POLLING except that the completion queues will not /** Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will
contain any 'listening file descriptors' (i.e file descriptors used to not contain any 'listening file descriptors' (i.e file descriptors used to
listen to incoming channels */ listen to incoming channels */
NON_LISTENING, GRPC_CQ_NON_LISTENING,
/** The completion queue will not have an associated pollset. Note that /** The completion queue will not have an associated pollset. Note that
grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still
be called to pop events from the completion queue; it is not required to be called to pop events from the completion queue; it is not required to
call them actively to make I/O progress */ call them actively to make I/O progress */
NON_POLLING GRPC_CQ_NON_POLLING
} grpc_cq_polling_type; } grpc_cq_polling_type;
/** Create a completion queue */ /** Create a completion queue */

@ -717,12 +717,12 @@ grpc_completion_queue *grpc_cq_from_pollset(grpc_pollset *ps) {
void grpc_cq_mark_non_listening_server_cq(grpc_completion_queue *cc) { void grpc_cq_mark_non_listening_server_cq(grpc_completion_queue *cc) {
/* TODO: sreek - use cc->polling_type field here and add a validation check /* TODO: sreek - use cc->polling_type field here and add a validation check
(i.e grpc_cq_mark_non_listening_server_cq can only be called on a cc whose (i.e grpc_cq_mark_non_listening_server_cq can only be called on a cc whose
polling_type is set to NON_LISTENING */ polling_type is set to GRPC_CQ_NON_LISTENING */
cc->is_non_listening_server_cq = 1; cc->is_non_listening_server_cq = 1;
} }
bool grpc_cq_is_non_listening_server_cq(grpc_completion_queue *cc) { bool grpc_cq_is_non_listening_server_cq(grpc_completion_queue *cc) {
/* TODO (sreek) - return (cc->polling_type == NON_LISTENING) */ /* TODO (sreek) - return (cc->polling_type == GRPC_CQ_NON_LISTENING) */
return (cc->is_non_listening_server_cq == 1); return (cc->is_non_listening_server_cq == 1);
} }

@ -154,8 +154,8 @@ class Server::SyncRequest final : public CompletionQueueTag {
} }
void SetupRequest() { void SetupRequest() {
// TODO: sreek - Double check if this should be GRPC_CQ_PLUCK cq_ = grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING,
cq_ = grpc_completion_queue_create(GRPC_CQ_PLUCK, DEFAULT_POLLING, nullptr); nullptr);
} }
void TeardownRequest() { void TeardownRequest() {

@ -125,7 +125,8 @@ void grpc_run_bad_client_test(
/* Create server, completion events */ /* Create server, completion events */
a.server = grpc_server_create(NULL, NULL); a.server = grpc_server_create(NULL, NULL);
a.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); a.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
gpr_event_init(&a.done_thd); gpr_event_init(&a.done_thd);
gpr_event_init(&a.done_write); gpr_event_init(&a.done_write);
a.validator = server_validator; a.validator = server_validator;
@ -197,7 +198,8 @@ void grpc_run_bad_client_test(
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);
} }
shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
grpc_server_shutdown_and_notify(a.server, shutdown_cq, NULL); grpc_server_shutdown_and_notify(a.server, shutdown_cq, NULL);
GPR_ASSERT(grpc_completion_queue_pluck( GPR_ASSERT(grpc_completion_queue_pluck(
shutdown_cq, NULL, grpc_timeout_seconds_to_deadline(1), NULL) shutdown_cq, NULL, grpc_timeout_seconds_to_deadline(1), NULL)

@ -62,7 +62,7 @@ static void run_test(const char *target, size_t nops) {
grpc_call_error error; grpc_call_error error;
gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5); gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
grpc_completion_queue *cq = grpc_completion_queue *cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
cq_verifier *cqv = cq_verifier_create(cq); cq_verifier *cqv = cq_verifier_create(cq);
grpc_op ops[6]; grpc_op ops[6];

@ -68,7 +68,7 @@ void bad_ssl_run(grpc_server *server) {
grpc_metadata_array request_metadata_recv; grpc_metadata_array request_metadata_recv;
grpc_completion_queue *cq = grpc_completion_queue *cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
grpc_completion_queue *shutdown_cq; grpc_completion_queue *shutdown_cq;
grpc_call_details_init(&call_details); grpc_call_details_init(&call_details);
@ -85,8 +85,8 @@ void bad_ssl_run(grpc_server *server) {
while (!shutdown_finished) { while (!shutdown_finished) {
if (got_sigint && !shutdown_started) { if (got_sigint && !shutdown_started) {
gpr_log(GPR_INFO, "Shutting down due to SIGINT"); gpr_log(GPR_INFO, "Shutting down due to SIGINT");
shutdown_cq = shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK,
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); GRPC_CQ_NON_POLLING, NULL);
grpc_server_shutdown_and_notify(server, shutdown_cq, NULL); grpc_server_shutdown_and_notify(server, shutdown_cq, NULL);
GPR_ASSERT( GPR_ASSERT(
grpc_completion_queue_pluck(shutdown_cq, NULL, grpc_completion_queue_pluck(shutdown_cq, NULL,
@ -97,8 +97,9 @@ void bad_ssl_run(grpc_server *server) {
shutdown_started = 1; shutdown_started = 1;
} }
ev = grpc_completion_queue_next( ev = grpc_completion_queue_next(
cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), cq,
gpr_time_from_micros(1000000, GPR_TIMESPAN)), gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_micros(1000000, GPR_TIMESPAN)),
NULL); NULL);
switch (ev.type) { switch (ev.type) {
case GRPC_OP_COMPLETE: case GRPC_OP_COMPLETE:

@ -67,7 +67,7 @@ typedef struct servers_fixture {
typedef struct request_sequences { typedef struct request_sequences {
size_t n; /* number of iterations */ size_t n; /* number of iterations */
int *connections; /* indexed by the interation number, value is the index of int *connections; /* indexed by the interation number, value is the index of
the server it connected to or -1 if none */ the server it connected to or -1 if none */
int *connectivity_states; /* indexed by the interation number, value is the int *connectivity_states; /* indexed by the interation number, value is the
client connectivity state */ client connectivity state */
} request_sequences; } request_sequences;
@ -197,9 +197,10 @@ static servers_fixture *setup_servers(const char *server_host,
/* Create servers. */ /* Create servers. */
f->servers = gpr_malloc(sizeof(grpc_server *) * num_servers); f->servers = gpr_malloc(sizeof(grpc_server *) * num_servers);
f->servers_hostports = gpr_malloc(sizeof(char *) * num_servers); f->servers_hostports = gpr_malloc(sizeof(char *) * num_servers);
f->cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f->cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f->shutdown_cq = f->shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
for (i = 0; i < num_servers; i++) { for (i = 0; i < num_servers; i++) {
grpc_metadata_array_init(&f->request_metadata_recv[i]); grpc_metadata_array_init(&f->request_metadata_recv[i]);
gpr_join_host_port(&f->servers_hostports[i], server_host, gpr_join_host_port(&f->servers_hostports[i], server_host,

@ -130,7 +130,8 @@ static gpr_timespec n_sec_deadline(int seconds) {
} }
static void start_rpc(int use_creds, int target_port) { static void start_rpc(int use_creds, int target_port) {
state.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); state.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
if (use_creds) { if (use_creds) {
state.creds = grpc_fake_transport_security_credentials_create(); state.creds = grpc_fake_transport_security_credentials_create();
} else { } else {

@ -178,7 +178,8 @@ static void start_rpc(int target_port, grpc_status_code expected_status,
cq_verifier *cqv; cq_verifier *cqv;
grpc_slice details; grpc_slice details;
state.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); state.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
cqv = cq_verifier_create(state.cq); cqv = cq_verifier_create(state.cq);
gpr_join_host_port(&state.target, "127.0.0.1", target_port); gpr_join_host_port(&state.target, "127.0.0.1", target_port);
state.channel = grpc_insecure_channel_create(state.target, NULL, NULL); state.channel = grpc_insecure_channel_create(state.target, NULL, NULL);

@ -69,7 +69,8 @@ static void run_test(bool wait_for_ready, bool use_service_config) {
grpc_metadata_array_init(&trailing_metadata_recv); grpc_metadata_array_init(&trailing_metadata_recv);
cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
cqv = cq_verifier_create(cq); cqv = cq_verifier_create(cq);
/* if using service config, create channel args */ /* if using service config, create channel args */

@ -108,7 +108,8 @@ void test_connect(const char *server_host, const char *client_host, int port,
grpc_call_details_init(&call_details); grpc_call_details_init(&call_details);
/* Create server. */ /* Create server. */
cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
server = grpc_server_create(NULL, NULL); server = grpc_server_create(NULL, NULL);
grpc_server_register_completion_queue(server, cq, NULL); grpc_server_register_completion_queue(server, cq, NULL);
GPR_ASSERT((got_port = grpc_server_add_insecure_http2_port( GPR_ASSERT((got_port = grpc_server_add_insecure_http2_port(
@ -260,7 +261,8 @@ void test_connect(const char *server_host, const char *client_host, int port,
grpc_channel_destroy(client); grpc_channel_destroy(client);
/* Destroy server. */ /* Destroy server. */
shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000),
grpc_timeout_seconds_to_deadline(5), grpc_timeout_seconds_to_deadline(5),

@ -65,9 +65,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }

@ -69,9 +69,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression(
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }

@ -60,9 +60,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }

@ -70,9 +70,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
grpc_end2end_test_fixture f; grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = fixture_data; f.fixture_data = fixture_data;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
create_sockets(fixture_data->fd_pair); create_sockets(fixture_data->fd_pair);

@ -70,9 +70,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }

@ -70,9 +70,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }
@ -104,9 +105,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
/* All test configurations */ /* All test configurations */
static grpc_end2end_test_config configs[] = { static grpc_end2end_test_config configs[] = {
{"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | {"chttp2/fullstack",
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
}; };

@ -64,9 +64,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }

@ -69,9 +69,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
ffd->proxy = grpc_end2end_http_proxy_create(); ffd->proxy = grpc_end2end_http_proxy_create();
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }

@ -67,9 +67,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }

@ -113,9 +113,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }

@ -79,9 +79,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args); ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }

@ -94,9 +94,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
grpc_end2end_test_fixture f; grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = sfd; f.fixture_data = sfd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
grpc_resource_quota *resource_quota = grpc_resource_quota_create("fixture"); grpc_resource_quota *resource_quota = grpc_resource_quota_create("fixture");
*sfd = grpc_iomgr_create_endpoint_pair("fixture", resource_quota, 65536); *sfd = grpc_iomgr_create_endpoint_pair("fixture", resource_quota, 65536);

@ -88,9 +88,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
grpc_end2end_test_fixture f; grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = sfd; f.fixture_data = sfd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
grpc_resource_quota *resource_quota = grpc_resource_quota_create("fixture"); grpc_resource_quota *resource_quota = grpc_resource_quota_create("fixture");
*sfd = grpc_iomgr_create_endpoint_pair("fixture", resource_quota, 65536); *sfd = grpc_iomgr_create_endpoint_pair("fixture", resource_quota, 65536);

@ -88,9 +88,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
grpc_end2end_test_fixture f; grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = sfd; f.fixture_data = sfd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
grpc_resource_quota *resource_quota = grpc_resource_quota_create("fixture"); grpc_resource_quota *resource_quota = grpc_resource_quota_create("fixture");
*sfd = grpc_iomgr_create_endpoint_pair("fixture", resource_quota, 1); *sfd = grpc_iomgr_create_endpoint_pair("fixture", resource_quota, 1);

@ -64,9 +64,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }

@ -67,9 +67,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }

@ -100,9 +100,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args); ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }

@ -70,9 +70,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
unique++); unique++);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); f.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
f.shutdown_cq = f.shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
return f; return f;
} }
@ -103,9 +104,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) {
/* All test configurations */ /* All test configurations */
static grpc_end2end_test_config configs[] = { static grpc_end2end_test_config configs[] = {
{"chttp2/fullstack_uds", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | {"chttp2/fullstack_uds",
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL |
FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER,
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, chttp2_init_server_fullstack, chttp2_tear_down_fullstack},
}; };

@ -104,7 +104,8 @@ grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def,
gpr_log(GPR_DEBUG, "PROXY ADDR:%s BACKEND:%s", proxy->proxy_port, gpr_log(GPR_DEBUG, "PROXY ADDR:%s BACKEND:%s", proxy->proxy_port,
proxy->server_port); proxy->server_port);
proxy->cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); proxy->cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
proxy->server = def->create_server(proxy->proxy_port, server_args); proxy->server = def->create_server(proxy->proxy_port, server_args);
proxy->client = def->create_client(proxy->server_port, client_args); proxy->client = def->create_client(proxy->server_port, client_args);

@ -739,7 +739,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
g_resource_quota = grpc_resource_quota_create("api_fuzzer"); g_resource_quota = grpc_resource_quota_create("api_fuzzer");
grpc_completion_queue *cq = grpc_completion_queue *cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
while (!is_eof(&inp) || g_channel != NULL || g_server != NULL || while (!is_eof(&inp) || g_channel != NULL || g_server != NULL ||
pending_channel_watches > 0 || pending_pings > 0 || pending_channel_watches > 0 || pending_pings > 0 ||

@ -66,7 +66,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
grpc_resource_quota_unref_internal(&exec_ctx, resource_quota); grpc_resource_quota_unref_internal(&exec_ctx, resource_quota);
grpc_completion_queue *cq = grpc_completion_queue *cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
grpc_transport *transport = grpc_transport *transport =
grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 1); grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 1);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);

@ -68,7 +68,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
grpc_server *server = grpc_server_create(NULL, NULL); grpc_server *server = grpc_server_create(NULL, NULL);
grpc_completion_queue *cq = grpc_completion_queue *cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
grpc_server_register_completion_queue(server, cq, NULL); grpc_server_register_completion_queue(server, cq, NULL);
// TODO(ctiller): add registered methods (one for POST, one for PUT) // TODO(ctiller): add registered methods (one for POST, one for PUT)
// void *registered_method = // void *registered_method =

@ -121,7 +121,8 @@ int main(int argc, char **argv) {
grpc_metadata_array_init(&request_metadata2); grpc_metadata_array_init(&request_metadata2);
grpc_call_details_init(&request_details2); grpc_call_details_init(&request_details2);
cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
cqv = cq_verifier_create(cq); cqv = cq_verifier_create(cq);
/* reserve two ports */ /* reserve two ports */

@ -74,7 +74,7 @@ static void prepare_test(int is_client) {
grpc_metadata_array_init(&g_state.trailing_metadata_recv); grpc_metadata_array_init(&g_state.trailing_metadata_recv);
g_state.deadline = grpc_timeout_seconds_to_deadline(2); g_state.deadline = grpc_timeout_seconds_to_deadline(2);
g_state.cq = g_state.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
g_state.cqv = cq_verifier_create(g_state.cq); g_state.cqv = cq_verifier_create(g_state.cq);
g_state.details = grpc_empty_slice(); g_state.details = grpc_empty_slice();
memset(g_state.ops, 0, sizeof(g_state.ops)); memset(g_state.ops, 0, sizeof(g_state.ops));
@ -134,7 +134,7 @@ static void cleanup_test() {
if (!g_state.is_client) { if (!g_state.is_client) {
shutdown_cq = shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
grpc_call_destroy(g_state.server_call); grpc_call_destroy(g_state.server_call);
grpc_server_shutdown_and_notify(g_state.server, shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(g_state.server, shutdown_cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000),

@ -42,9 +42,10 @@ int main(int argc, char **argv) {
grpc_test_init(argc, argv); grpc_test_init(argc, argv);
grpc_init(); grpc_init();
cq1 = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); cq1 =
cq2 = grpc_completion_queue_create(GRPC_CQ_NEXT, NON_LISTENING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
cq3 = grpc_completion_queue_create(GRPC_CQ_NEXT, NON_POLLING, NULL); cq2 = grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_NON_LISTENING, NULL);
cq3 = grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_NON_POLLING, NULL);
server = grpc_server_create(NULL, NULL); server = grpc_server_create(NULL, NULL);
grpc_server_register_completion_queue(server, cq1, NULL); grpc_server_register_completion_queue(server, cq1, NULL);

@ -59,7 +59,8 @@ int main(int argc, char **argv) {
grpc_metadata_array_init(&trailing_metadata_recv); grpc_metadata_array_init(&trailing_metadata_recv);
cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
cqv = cq_verifier_create(cq); cqv = cq_verifier_create(cq);
/* create a call, channel to a non existant server */ /* create a call, channel to a non existant server */

@ -208,7 +208,8 @@ int main(int argc, char **argv) {
} }
channel = grpc_insecure_channel_create(target, NULL, NULL); channel = grpc_insecure_channel_create(target, NULL, NULL);
cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
the_buffer = grpc_raw_byte_buffer_create(&slice, (size_t)payload_size); the_buffer = grpc_raw_byte_buffer_create(&slice, (size_t)payload_size);
histogram = gpr_histogram_create(0.01, 60e9); histogram = gpr_histogram_create(0.01, 60e9);

@ -215,7 +215,8 @@ int main(int argc, char **argv) {
} }
gpr_log(GPR_INFO, "creating server on: %s", addr); gpr_log(GPR_INFO, "creating server on: %s", addr);
cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
if (secure) { if (secure) {
grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key, grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key,
test_server1_cert}; test_server1_cert};
@ -244,8 +245,8 @@ int main(int argc, char **argv) {
if (got_sigint && !shutdown_started) { if (got_sigint && !shutdown_started) {
gpr_log(GPR_INFO, "Shutting down due to SIGINT"); gpr_log(GPR_INFO, "Shutting down due to SIGINT");
shutdown_cq = shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK,
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); GRPC_CQ_NON_POLLING, NULL);
grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000));
GPR_ASSERT( GPR_ASSERT(
@ -258,8 +259,9 @@ int main(int argc, char **argv) {
shutdown_started = 1; shutdown_started = 1;
} }
ev = grpc_completion_queue_next( ev = grpc_completion_queue_next(
cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), cq,
gpr_time_from_micros(1000000, GPR_TIMESPAN)), gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_micros(1000000, GPR_TIMESPAN)),
NULL); NULL);
s = ev.tag; s = ev.tag;
switch (ev.type) { switch (ev.type) {

@ -290,7 +290,7 @@ static bool client_ssl_test(char *server_alpn_preferred) {
int retries = 10; int retries = 10;
grpc_connectivity_state state = GRPC_CHANNEL_IDLE; grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
grpc_completion_queue *cq = grpc_completion_queue *cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
while (state != GRPC_CHANNEL_READY && retries-- > 0) { while (state != GRPC_CHANNEL_READY && retries-- > 0) {
grpc_channel_watch_connectivity_state( grpc_channel_watch_connectivity_state(

@ -105,7 +105,7 @@ static void server_thread(void *arg) {
free(addr); free(addr);
grpc_completion_queue *cq = grpc_completion_queue *cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
grpc_server_register_completion_queue(server, cq, NULL); grpc_server_register_completion_queue(server, cq, NULL);
grpc_server_start(server); grpc_server_start(server);

@ -222,7 +222,8 @@ int main(int argc, char **argv) {
calls[k].details = grpc_empty_slice(); calls[k].details = grpc_empty_slice();
} }
cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
struct grpc_memory_counters client_channel_start = struct grpc_memory_counters client_channel_start =
grpc_memory_counters_snapshot(); grpc_memory_counters_snapshot();
@ -260,8 +261,9 @@ int main(int argc, char **argv) {
do { do {
event = grpc_completion_queue_next( event = grpc_completion_queue_next(
cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), cq,
gpr_time_from_micros(10000, GPR_TIMESPAN)), gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_micros(10000, GPR_TIMESPAN)),
NULL); NULL);
} while (event.type != GRPC_QUEUE_TIMEOUT); } while (event.type != GRPC_QUEUE_TIMEOUT);

@ -189,7 +189,8 @@ int main(int argc, char **argv) {
} }
gpr_log(GPR_INFO, "creating server on: %s", addr); gpr_log(GPR_INFO, "creating server on: %s", addr);
cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
struct grpc_memory_counters before_server_create = struct grpc_memory_counters before_server_create =
grpc_memory_counters_snapshot(); grpc_memory_counters_snapshot();
@ -232,8 +233,8 @@ int main(int argc, char **argv) {
if (got_sigint && !shutdown_started) { if (got_sigint && !shutdown_started) {
gpr_log(GPR_INFO, "Shutting down due to SIGINT"); gpr_log(GPR_INFO, "Shutting down due to SIGINT");
shutdown_cq = shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK,
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); GRPC_CQ_NON_POLLING, NULL);
grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000));
GPR_ASSERT( GPR_ASSERT(
grpc_completion_queue_pluck(shutdown_cq, tag(1000), grpc_completion_queue_pluck(shutdown_cq, tag(1000),
@ -244,8 +245,9 @@ int main(int argc, char **argv) {
shutdown_started = 1; shutdown_started = 1;
} }
ev = grpc_completion_queue_next( ev = grpc_completion_queue_next(
cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), cq,
gpr_time_from_micros(1000000, GPR_TIMESPAN)), gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_micros(1000000, GPR_TIMESPAN)),
NULL); NULL);
fling_call *s = ev.tag; fling_call *s = ev.tag;
switch (ev.type) { switch (ev.type) {

@ -58,7 +58,8 @@ static void test_alarm(void) {
grpc_completion_queue *cc; grpc_completion_queue *cc;
LOG_TEST("test_alarm"); LOG_TEST("test_alarm");
cc = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); cc =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
{ {
/* regular expiry */ /* regular expiry */
grpc_event ev; grpc_event ev;

@ -76,8 +76,8 @@ static void shutdown_and_destroy(grpc_completion_queue *cc) {
/* ensure we can create and destroy a completion channel */ /* ensure we can create and destroy a completion channel */
static void test_no_op(void) { static void test_no_op(void) {
grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK}; grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK};
grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, grpc_cq_polling_type polling_types[] = {
NON_POLLING}; GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
LOG_TEST("test_no_op"); LOG_TEST("test_no_op");
for (size_t i = 0; i < GPR_ARRAY_SIZE(completion_types); i++) { for (size_t i = 0; i < GPR_ARRAY_SIZE(completion_types); i++) {
@ -90,7 +90,8 @@ static void test_no_op(void) {
static void test_pollset_conversion(void) { static void test_pollset_conversion(void) {
grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK}; grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK};
grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING}; grpc_cq_polling_type polling_types[] = {GRPC_CQ_DEFAULT_POLLING,
GRPC_CQ_NON_LISTENING};
grpc_completion_queue *cq; grpc_completion_queue *cq;
LOG_TEST("test_pollset_conversion"); LOG_TEST("test_pollset_conversion");
@ -106,8 +107,8 @@ static void test_pollset_conversion(void) {
} }
static void test_wait_empty(void) { static void test_wait_empty(void) {
grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, grpc_cq_polling_type polling_types[] = {
NON_POLLING}; GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
grpc_completion_queue *cc; grpc_completion_queue *cc;
grpc_event event; grpc_event event;
@ -128,8 +129,8 @@ static void test_cq_end_op(void) {
grpc_event ev; grpc_event ev;
grpc_completion_queue *cc; grpc_completion_queue *cc;
grpc_cq_completion completion; grpc_cq_completion completion;
grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, grpc_cq_polling_type polling_types[] = {
NON_POLLING}; GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_exec_ctx exec_ctx; grpc_exec_ctx exec_ctx;
@ -156,8 +157,8 @@ static void test_cq_end_op(void) {
} }
static void test_shutdown_then_next_polling(void) { static void test_shutdown_then_next_polling(void) {
grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, grpc_cq_polling_type polling_types[] = {
NON_POLLING}; GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
grpc_completion_queue *cc; grpc_completion_queue *cc;
grpc_event event; grpc_event event;
LOG_TEST("test_shutdown_then_next_polling"); LOG_TEST("test_shutdown_then_next_polling");
@ -173,8 +174,8 @@ static void test_shutdown_then_next_polling(void) {
} }
static void test_shutdown_then_next_with_timeout(void) { static void test_shutdown_then_next_with_timeout(void) {
grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, grpc_cq_polling_type polling_types[] = {
NON_POLLING}; GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
grpc_completion_queue *cc; grpc_completion_queue *cc;
grpc_event event; grpc_event event;
LOG_TEST("test_shutdown_then_next_with_timeout"); LOG_TEST("test_shutdown_then_next_with_timeout");
@ -195,8 +196,8 @@ static void test_pluck(void) {
grpc_completion_queue *cc; grpc_completion_queue *cc;
void *tags[128]; void *tags[128];
grpc_cq_completion completions[GPR_ARRAY_SIZE(tags)]; grpc_cq_completion completions[GPR_ARRAY_SIZE(tags)];
grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, grpc_cq_polling_type polling_types[] = {
NON_POLLING}; GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_exec_ctx exec_ctx; grpc_exec_ctx exec_ctx;
unsigned i, j; unsigned i, j;
@ -244,8 +245,8 @@ static void test_pluck(void) {
} }
static void test_pluck_after_shutdown(void) { static void test_pluck_after_shutdown(void) {
grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, grpc_cq_polling_type polling_types[] = {
NON_POLLING}; GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING};
grpc_event ev; grpc_event ev;
grpc_completion_queue *cc; grpc_completion_queue *cc;

@ -101,7 +101,8 @@ static void test_too_many_plucks(void) {
LOG_TEST("test_too_many_plucks"); LOG_TEST("test_too_many_plucks");
cc = grpc_completion_queue_create(GRPC_CQ_PLUCK, DEFAULT_POLLING, NULL); cc = grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING,
NULL);
gpr_thd_options_set_joinable(&thread_options); gpr_thd_options_set_joinable(&thread_options);
for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) {
@ -228,7 +229,7 @@ static void test_threading(size_t producers, size_t consumers) {
gpr_event phase1 = GPR_EVENT_INIT; gpr_event phase1 = GPR_EVENT_INIT;
gpr_event phase2 = GPR_EVENT_INIT; gpr_event phase2 = GPR_EVENT_INIT;
grpc_completion_queue *cc = grpc_completion_queue *cc =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
size_t i; size_t i;
size_t total_consumed = 0; size_t total_consumed = 0;
static int optid = 101; static int optid = 101;

@ -66,8 +66,8 @@ static int detag(void *p) { return (int)(uintptr_t)p; }
void create_loop_destroy(void *addr) { void create_loop_destroy(void *addr) {
for (int i = 0; i < NUM_OUTER_LOOPS; ++i) { for (int i = 0; i < NUM_OUTER_LOOPS; ++i) {
grpc_completion_queue *cq = grpc_completion_queue *cq = grpc_completion_queue_create(
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
grpc_channel *chan = grpc_insecure_channel_create((char *)addr, NULL, NULL); grpc_channel *chan = grpc_insecure_channel_create((char *)addr, NULL, NULL);
for (int j = 0; j < NUM_INNER_LOOPS; ++j) { for (int j = 0; j < NUM_INNER_LOOPS; ++j) {
@ -196,7 +196,8 @@ int main(int argc, char **argv) {
gpr_asprintf(&args.addr, "localhost:%d", port); gpr_asprintf(&args.addr, "localhost:%d", port);
args.server = grpc_server_create(NULL, NULL); args.server = grpc_server_create(NULL, NULL);
grpc_server_add_insecure_http2_port(args.server, args.addr); grpc_server_add_insecure_http2_port(args.server, args.addr);
args.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); args.cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
grpc_server_register_completion_queue(args.server, args.cq, NULL); grpc_server_register_completion_queue(args.server, args.cq, NULL);
grpc_server_start(args.server); grpc_server_start(args.server);
gpr_thd_new(&server, server_thread, &args, &options); gpr_thd_new(&server, server_thread, &args, &options);

@ -108,7 +108,8 @@ int main(int argc, char **argv) {
GPR_ASSERT(GRPC_CHANNEL_SHUTDOWN == GPR_ASSERT(GRPC_CHANNEL_SHUTDOWN ==
grpc_channel_check_connectivity_state(chan, 0)); grpc_channel_check_connectivity_state(chan, 0));
cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
grpc_slice host = grpc_slice_from_static_string("anywhere"); grpc_slice host = grpc_slice_from_static_string("anywhere");
call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq,

@ -77,7 +77,7 @@ static void run_test(const test_fixture *fixture) {
grpc_server *server = grpc_server_create(NULL, NULL); grpc_server *server = grpc_server_create(NULL, NULL);
fixture->add_server_port(server, addr); fixture->add_server_port(server, addr);
grpc_completion_queue *server_cq = grpc_completion_queue *server_cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
grpc_server_register_completion_queue(server, server_cq, NULL); grpc_server_register_completion_queue(server, server_cq, NULL);
grpc_server_start(server); grpc_server_start(server);
@ -88,7 +88,7 @@ static void run_test(const test_fixture *fixture) {
gpr_thd_new(&server_thread, server_thread_func, &sta, &thdopt); gpr_thd_new(&server_thread, server_thread_func, &sta, &thdopt);
grpc_completion_queue *cq = grpc_completion_queue *cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
grpc_channel *channels[NUM_CONNECTIONS]; grpc_channel *channels[NUM_CONNECTIONS];
for (size_t i = 0; i < NUM_CONNECTIONS; i++) { for (size_t i = 0; i < NUM_CONNECTIONS; i++) {
channels[i] = fixture->create_channel(addr); channels[i] = fixture->create_channel(addr);

@ -61,7 +61,7 @@ void test_add_same_port_twice() {
int port = grpc_pick_unused_port_or_die(); int port = grpc_pick_unused_port_or_die();
char *addr = NULL; char *addr = NULL;
grpc_completion_queue *cq = grpc_completion_queue *cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
grpc_server *server = grpc_server_create(&args, NULL); grpc_server *server = grpc_server_create(&args, NULL);
grpc_server_credentials *fake_creds = grpc_server_credentials *fake_creds =
grpc_fake_transport_security_server_credentials_create(); grpc_fake_transport_security_server_credentials_create();

@ -71,7 +71,7 @@ void test_register_method_fail(void) {
void test_request_call_on_no_server_cq(void) { void test_request_call_on_no_server_cq(void) {
grpc_completion_queue *cc = grpc_completion_queue *cc =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
grpc_server *server = grpc_server_create(NULL, NULL); grpc_server *server = grpc_server_create(NULL, NULL);
GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE == GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE ==
grpc_server_request_call(server, NULL, NULL, NULL, cc, cc, NULL)); grpc_server_request_call(server, NULL, NULL, NULL, cc, cc, NULL));
@ -93,7 +93,7 @@ void test_bind_server_twice(void) {
grpc_server *server1 = grpc_server_create(&args, NULL); grpc_server *server1 = grpc_server_create(&args, NULL);
grpc_server *server2 = grpc_server_create(&args, NULL); grpc_server *server2 = grpc_server_create(&args, NULL);
grpc_completion_queue *cq = grpc_completion_queue *cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
int port = grpc_pick_unused_port_or_die(); int port = grpc_pick_unused_port_or_die();
gpr_asprintf(&addr, "[::]:%d", port); gpr_asprintf(&addr, "[::]:%d", port);
grpc_server_register_completion_queue(server1, cq, NULL); grpc_server_register_completion_queue(server1, cq, NULL);
@ -131,7 +131,7 @@ void test_bind_server_to_addr(const char *host, bool secure) {
GPR_ASSERT(grpc_server_add_insecure_http2_port(server, addr)); GPR_ASSERT(grpc_server_add_insecure_http2_port(server, addr));
} }
grpc_completion_queue *cq = grpc_completion_queue *cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
grpc_server_register_completion_queue(server, cq, NULL); grpc_server_register_completion_queue(server, cq, NULL);
grpc_server_start(server); grpc_server_start(server);
grpc_server_shutdown_and_notify(server, cq, NULL); grpc_server_shutdown_and_notify(server, cq, NULL);

@ -354,8 +354,9 @@ static void start_backend_server(server_fixture *sf) {
} }
GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
const string expected_token = const string expected_token =
strlen(sf->lb_token_prefix) == 0 ? "" : sf->lb_token_prefix + strlen(sf->lb_token_prefix) == 0
std::to_string(sf->port); ? ""
: sf->lb_token_prefix + std::to_string(sf->port);
GPR_ASSERT(contains_metadata(&request_metadata_recv, "lb-token", GPR_ASSERT(contains_metadata(&request_metadata_recv, "lb-token",
expected_token.c_str())); expected_token.c_str()));
@ -593,7 +594,8 @@ static void setup_client(const server_fixture *lb_server,
grpc_channel_args_copy_and_add(NULL, &expected_target_arg, 1); grpc_channel_args_copy_and_add(NULL, &expected_target_arg, 1);
gpr_free(expected_target_names); gpr_free(expected_target_names);
cf->cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); cf->cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
cf->server_uri = lb_uri; cf->server_uri = lb_uri;
grpc_channel_credentials *fake_creds = grpc_channel_credentials *fake_creds =
grpc_fake_transport_security_credentials_create(); grpc_fake_transport_security_credentials_create();
@ -616,7 +618,8 @@ static void teardown_client(client_fixture *cf) {
static void setup_server(const char *host, server_fixture *sf) { static void setup_server(const char *host, server_fixture *sf) {
int assigned_port; int assigned_port;
sf->cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); sf->cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
const char *colon_idx = strchr(host, ':'); const char *colon_idx = strchr(host, ':');
if (colon_idx) { if (colon_idx) {
const char *port_str = colon_idx + 1; const char *port_str = colon_idx + 1;
@ -645,7 +648,7 @@ static void teardown_server(server_fixture *sf) {
gpr_log(GPR_INFO, "Server[%s] shutting down", sf->servers_hostport); gpr_log(GPR_INFO, "Server[%s] shutting down", sf->servers_hostport);
grpc_completion_queue *shutdown_cq = grpc_completion_queue *shutdown_cq =
grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL);
grpc_server_shutdown_and_notify(sf->server, shutdown_cq, tag(1000)); grpc_server_shutdown_and_notify(sf->server, shutdown_cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000),
grpc_timeout_seconds_to_deadline(5), grpc_timeout_seconds_to_deadline(5),

@ -91,7 +91,7 @@ template <class Fixture>
static void BM_CallCreateDestroy(benchmark::State &state) { static void BM_CallCreateDestroy(benchmark::State &state) {
Fixture fixture; Fixture fixture;
grpc_completion_queue *cq = grpc_completion_queue *cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
void *method_hdl = void *method_hdl =
grpc_channel_register_call(fixture.channel(), "/foo/bar", NULL, NULL); grpc_channel_register_call(fixture.channel(), "/foo/bar", NULL, NULL);

@ -68,8 +68,8 @@ static void BM_CreateDestroyCore(benchmark::State& state) {
while (state.KeepRunning()) { while (state.KeepRunning()) {
// TODO: sreek Make this a templatized benchmark and pass completion type // TODO: sreek Make this a templatized benchmark and pass completion type
// and polling type as parameters // and polling type as parameters
grpc_completion_queue_destroy( grpc_completion_queue_destroy(grpc_completion_queue_create(
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL)); GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL));
} }
} }
BENCHMARK(BM_CreateDestroyCore); BENCHMARK(BM_CreateDestroyCore);
@ -104,7 +104,7 @@ static void BM_Pass1Core(benchmark::State& state) {
// TODO: sreek Make this templatized benchmark and pass polling_type as a // TODO: sreek Make this templatized benchmark and pass polling_type as a
// param // param
grpc_completion_queue* cq = grpc_completion_queue* cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
while (state.KeepRunning()) { while (state.KeepRunning()) {
grpc_cq_completion completion; grpc_cq_completion completion;
@ -122,8 +122,8 @@ BENCHMARK(BM_Pass1Core);
static void BM_Pluck1Core(benchmark::State& state) { static void BM_Pluck1Core(benchmark::State& state) {
// TODO: sreek Make this templatized benchmark and pass polling_type as a // TODO: sreek Make this templatized benchmark and pass polling_type as a
// param // param
grpc_completion_queue* cq = grpc_completion_queue* cq = grpc_completion_queue_create(
grpc_completion_queue_create(GRPC_CQ_PLUCK, DEFAULT_POLLING, NULL); GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING, NULL);
gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
while (state.KeepRunning()) { while (state.KeepRunning()) {
grpc_cq_completion completion; grpc_cq_completion completion;
@ -142,7 +142,7 @@ static void BM_EmptyCore(benchmark::State& state) {
// TODO: sreek Make this a templatized benchmark and pass polling_type as a // TODO: sreek Make this a templatized benchmark and pass polling_type as a
// param // param
grpc_completion_queue* cq = grpc_completion_queue* cq =
grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL);
gpr_timespec deadline = gpr_inf_past(GPR_CLOCK_MONOTONIC); gpr_timespec deadline = gpr_inf_past(GPR_CLOCK_MONOTONIC);
while (state.KeepRunning()) { while (state.KeepRunning()) {
grpc_completion_queue_next(cq, deadline, NULL); grpc_completion_queue_next(cq, deadline, NULL);

Loading…
Cancel
Save