From 988db272756058bf1c09691a41c8322fe52afe21 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 24 Feb 2015 22:21:02 -0800 Subject: [PATCH 01/71] Spam cleanup --- src/core/debug/trace.c | 2 ++ src/core/debug/trace.h | 3 ++- src/core/tsi/ssl_transport_security.c | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/debug/trace.c b/src/core/debug/trace.c index b8eb755bffc..6f84ee2c305 100644 --- a/src/core/debug/trace.c +++ b/src/core/debug/trace.c @@ -83,6 +83,8 @@ static void parse(const char *s) { grpc_trace_bits |= GRPC_TRACE_SECURE_ENDPOINT; } else if (0 == strcmp(s, "http")) { grpc_trace_bits |= GRPC_TRACE_HTTP; + } else if (0 == strcmp(s, "ssl")) { + grpc_trace_bits |= GRPC_TRACE_SSL; } else if (0 == strcmp(s, "all")) { grpc_trace_bits = -1; } else { diff --git a/src/core/debug/trace.h b/src/core/debug/trace.h index bf9b8a3642c..a653fad2bbb 100644 --- a/src/core/debug/trace.h +++ b/src/core/debug/trace.h @@ -46,7 +46,8 @@ typedef enum { GRPC_TRACE_CHANNEL = 1 << 1, GRPC_TRACE_TCP = 1 << 2, GRPC_TRACE_SECURE_ENDPOINT = 1 << 3, - GRPC_TRACE_HTTP = 1 << 4 + GRPC_TRACE_HTTP = 1 << 4, + GRPC_TRACE_SSL = 1 << 5 } grpc_trace_bit_value; #if GRPC_ENABLE_TRACING diff --git a/src/core/tsi/ssl_transport_security.c b/src/core/tsi/ssl_transport_security.c index 9ca8e6ddc98..c13b2d5ea18 100644 --- a/src/core/tsi/ssl_transport_security.c +++ b/src/core/tsi/ssl_transport_security.c @@ -39,6 +39,7 @@ #include #include #include +#include "src/core/debug/trace.h" #include "src/core/tsi/transport_security.h" #include @@ -162,7 +163,7 @@ static const char* ssl_error_string(int error) { /* TODO(jboeuf): Remove when we are past the debugging phase with this code. */ static void ssl_log_where_info(const SSL* ssl, int where, int flag, const char* msg) { - if (where & flag) { + if ((where & flag) && (grpc_trace_bits & GRPC_TRACE_SSL)) { gpr_log(GPR_INFO, "%20.20s - %30.30s - %5.10s", msg, SSL_state_string_long(ssl), SSL_state_string(ssl)); } From dea740f3297ea78af9d5b76f89aedee869a74963 Mon Sep 17 00:00:00 2001 From: vjpai Date: Thu, 26 Feb 2015 16:35:35 -0800 Subject: [PATCH 02/71] New multithreaded async C++ tests. The server is architected the way that it should be with multiple threads waiting on a single completion queue. The client currently uses a separate completion queue per-thread, as trying to do a single unified queue was leading to crashes for me. I need to figure that out. --- test/cpp/qps/client_async.cc | 340 +++++++++++++++++++++++++++++++++++ test/cpp/qps/server_async.cc | 296 ++++++++++++++++++++++++++++++ 2 files changed, 636 insertions(+) create mode 100644 test/cpp/qps/client_async.cc create mode 100644 test/cpp/qps/server_async.cc diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc new file mode 100644 index 00000000000..13db4febae5 --- /dev/null +++ b/test/cpp/qps/client_async.cc @@ -0,0 +1,340 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include "test/core/util/grpc_profiler.h" +#include "test/cpp/util/create_test_channel.h" +#include "test/cpp/qps/qpstest.pb.h" + +DEFINE_bool(enable_ssl, false, "Whether to use ssl/tls."); +DEFINE_int32(server_port, 0, "Server port."); +DEFINE_string(server_host, "127.0.0.1", "Server host."); +DEFINE_int32(client_threads, 4, "Number of client threads."); + +// We have a configurable number of channels for sending RPCs. +// RPCs are sent round-robin on the available channels by the +// various threads. Interesting cases are 1 global channel or +// 1 per-thread channel, but we can support any number. +// The channels are assigned round-robin on an RPC by RPC basis +// rather than just at initialization time in order to also measure the +// impact of cache thrashing caused by channel changes. This is an issue +// if you are not in one of the above "interesting cases" +DEFINE_int32(client_channels, 4, "Number of client channels."); + +DEFINE_int32(num_rpcs, 1000, "Number of RPCs per thread."); +DEFINE_int32(payload_size, 1, "Payload size in bytes"); + +// Alternatively, specify parameters for test as a workload so that multiple +// tests are initiated back-to-back. This is convenient for keeping a borg +// allocation consistent. This is a space-separated list of +// [threads channels num_rpcs payload_size ]* +DEFINE_string(workload, "", "Workload parameters"); + +using grpc::ChannelInterface; +using grpc::CreateTestChannel; +using grpc::testing::ServerStats; +using grpc::testing::SimpleRequest; +using grpc::testing::SimpleResponse; +using grpc::testing::StatsRequest; +using grpc::testing::TestService; + +// In some distros, gflags is in the namespace google, and in some others, +// in gflags. This hack is enabling us to find both. +namespace google { } +namespace gflags { } +using namespace google; +using namespace gflags; + +static double now() { + gpr_timespec tv = gpr_now(); + return 1e9 * tv.tv_sec + tv.tv_nsec; +} + + class ClientRpcContext { + public: + ClientRpcContext() {} + virtual ~ClientRpcContext() {} + virtual bool operator()() = 0; // do next state, return false if steps done + static void *tag(ClientRpcContext *c) {return reinterpret_cast(c);} + static ClientRpcContext *detag(void *t) { + return reinterpret_cast(t); + } + virtual void report_stats(gpr_histogram *hist) = 0; + }; + template + class ClientRpcContextUnaryImpl : public ClientRpcContext { + public: + ClientRpcContextUnaryImpl(const RequestType& req, + std::function *(grpc::ClientContext *, + const RequestType&, void *)> start_req, + std::function on_done): + context_(), req_(req), response_(), + next_state_(&ClientRpcContextUnaryImpl::ReqSent), + callback_(on_done), + start_(now()), + response_reader_(start_req(&context_, req_, + ClientRpcContext::tag(this))) { + } + ~ClientRpcContextUnaryImpl() override {} + bool operator()() override {return (this->*next_state_)();} + void report_stats(gpr_histogram *hist) override { + gpr_histogram_add(hist, now()-start_); + } + private: + bool ReqSent() { + next_state_ = &ClientRpcContextUnaryImpl::RespDone; + response_reader_->Finish(&response_, &status_, ClientRpcContext::tag(this)); + return true; + } + bool RespDone() { + next_state_ = &ClientRpcContextUnaryImpl::DoCallBack; + return false; + } + bool DoCallBack() { + callback_(status_, &response_); + return false; + } + grpc::ClientContext context_; + RequestType req_; + ResponseType response_; + bool (ClientRpcContextUnaryImpl::*next_state_)(); + std::function callback_; + grpc::Status status_; + double start_; + std::unique_ptr> response_reader_; + }; + +static void RunTest(const int client_threads, const int client_channels, + const int num_rpcs, const int payload_size) { + gpr_log(GPR_INFO, + "QPS test with parameters\n" + "enable_ssl = %d\n" + "client_channels = %d\n" + "client_threads = %d\n" + "num_rpcs = %d\n" + "payload_size = %d\n" + "server_host:server_port = %s:%d\n\n", + FLAGS_enable_ssl, client_channels, client_threads, num_rpcs, + payload_size, FLAGS_server_host.c_str(), FLAGS_server_port); + + std::ostringstream oss; + oss << FLAGS_server_host << ":" << FLAGS_server_port; + + class ClientChannelInfo { + public: + explicit ClientChannelInfo(const grpc::string &server) + : channel_(CreateTestChannel(server, FLAGS_enable_ssl)), + stub_(TestService::NewStub(channel_)) {} + ChannelInterface *get_channel() { return channel_.get(); } + TestService::Stub *get_stub() { return stub_.get(); } + + private: + std::shared_ptr channel_; + std::unique_ptr stub_; + }; + + std::vector channels; + for (int i = 0; i < client_channels; i++) { + channels.push_back(ClientChannelInfo(oss.str())); + } + + std::vector threads; // Will add threads when ready to execute + std::vector<::gpr_histogram *> thread_stats(client_threads); + + TestService::Stub *stub_stats = channels[0].get_stub(); + grpc::ClientContext context_stats_begin; + StatsRequest stats_request; + ServerStats server_stats_begin; + stats_request.set_test_num(0); + grpc::Status status_beg = stub_stats->CollectServerStats( + &context_stats_begin, stats_request, &server_stats_begin); + + grpc_profiler_start("qps_client_async.prof"); + + auto CheckDone = [=](grpc::Status s, SimpleResponse *response) { + GPR_ASSERT(s.IsOk() && + (response->payload().type() == + grpc::testing::PayloadType::COMPRESSABLE) && + (response->payload().body().length() == + static_cast(payload_size))); + }; + + for (int i = 0; i < client_threads; i++) { + gpr_histogram *hist = gpr_histogram_create(0.01, 60e9); + GPR_ASSERT(hist != NULL); + thread_stats[i] = hist; + + threads.push_back( + std::thread([hist, client_threads, client_channels, num_rpcs, + payload_size, &channels, &CheckDone](int channel_num) { + using namespace std::placeholders; + SimpleRequest request; + request.set_response_type( + grpc::testing::PayloadType::COMPRESSABLE); + request.set_response_size(payload_size); + + grpc::CompletionQueue cli_cq; + + int rpcs_sent=0; + while (rpcs_sent < num_rpcs) { + rpcs_sent++; + TestService::Stub *stub = + channels[channel_num].get_stub(); + grpc::ClientContext context; + auto start_req = std::bind(static_cast*(TestService::Stub::*)(grpc::ClientContext *,const SimpleRequest &,grpc::CompletionQueue *,void *)> + (&TestService::Stub::UnaryCall), + stub, _1, _2, &cli_cq, _3); + new ClientRpcContextUnaryImpl(request, + start_req, + CheckDone); + void *got_tag; + bool ok; + + // Need to call 2 next for every 1 RPC (1 for req done, 1 for resp done) + cli_cq.Next(&got_tag,&ok); + if (!ok) + break; + ClientRpcContext *ctx = ClientRpcContext::detag(got_tag); + if ((*ctx)() == false) { + // call the callback and then delete it + (*ctx)(); + delete ctx; + } + cli_cq.Next(&got_tag,&ok); + if (!ok) + break; + ctx = ClientRpcContext::detag(got_tag); + if ((*ctx)() == false) { + // call the callback and then delete it + ctx->report_stats(hist); + (*ctx)(); + delete ctx; + } + // Now do runtime round-robin assignment of the next + // channel number + channel_num += client_threads; + channel_num %= client_channels; + } + }, + i % client_channels)); + } + + gpr_histogram *hist = gpr_histogram_create(0.01, 60e9); + GPR_ASSERT(hist != NULL); + for (auto &t : threads) { + t.join(); + } + + grpc_profiler_stop(); + + for (int i = 0; i < client_threads; i++) { + gpr_histogram *h = thread_stats[i]; + gpr_log(GPR_INFO, "latency at thread %d (50/90/95/99/99.9): %f/%f/%f/%f/%f", + i, gpr_histogram_percentile(h, 50), gpr_histogram_percentile(h, 90), + gpr_histogram_percentile(h, 95), gpr_histogram_percentile(h, 99), + gpr_histogram_percentile(h, 99.9)); + gpr_histogram_merge(hist, h); + gpr_histogram_destroy(h); + } + + gpr_log( + GPR_INFO, + "latency across %d threads with %d channels and %d payload " + "(50/90/95/99/99.9): %f / %f / %f / %f / %f", + client_threads, client_channels, payload_size, + gpr_histogram_percentile(hist, 50), gpr_histogram_percentile(hist, 90), + gpr_histogram_percentile(hist, 95), gpr_histogram_percentile(hist, 99), + gpr_histogram_percentile(hist, 99.9)); + gpr_histogram_destroy(hist); + + grpc::ClientContext context_stats_end; + ServerStats server_stats_end; + grpc::Status status_end = stub_stats->CollectServerStats( + &context_stats_end, stats_request, &server_stats_end); + + double elapsed = server_stats_end.time_now() - server_stats_begin.time_now(); + int total_rpcs = client_threads * num_rpcs; + double utime = server_stats_end.time_user() - server_stats_begin.time_user(); + double stime = + server_stats_end.time_system() - server_stats_begin.time_system(); + gpr_log(GPR_INFO, + "Elapsed time: %.3f\n" + "RPC Count: %d\n" + "QPS: %.3f\n" + "System time: %.3f\n" + "User time: %.3f\n" + "Resource usage: %.1f%%\n", + elapsed, total_rpcs, total_rpcs / elapsed, stime, utime, + (stime + utime) / elapsed * 100.0); +} + +int main(int argc, char **argv) { + grpc_init(); + ParseCommandLineFlags(&argc, &argv, true); + + GPR_ASSERT(FLAGS_server_port); + + if (FLAGS_workload.length() == 0) { + RunTest(FLAGS_client_threads, FLAGS_client_channels, FLAGS_num_rpcs, + FLAGS_payload_size); + } else { + std::istringstream workload(FLAGS_workload); + int client_threads, client_channels, num_rpcs, payload_size; + workload >> client_threads; + while (!workload.eof()) { + workload >> client_channels >> num_rpcs >> payload_size; + RunTest(client_threads, client_channels, num_rpcs, payload_size); + workload >> client_threads; + } + gpr_log(GPR_INFO, "Done with specified workload."); + } + + grpc_shutdown(); + return 0; +} diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc new file mode 100644 index 00000000000..fec17ea79fa --- /dev/null +++ b/test/cpp/qps/server_async.cc @@ -0,0 +1,296 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "src/cpp/server/thread_pool.h" +#include "test/core/util/grpc_profiler.h" +#include "test/cpp/qps/qpstest.pb.h" + +#include +#include + +DEFINE_bool(enable_ssl, false, "Whether to use ssl/tls."); +DEFINE_int32(port, 0, "Server port."); +DEFINE_int32(server_threads, 4, "Number of server threads."); + +using grpc::CompletionQueue; +using grpc::Server; +using grpc::ServerBuilder; +using grpc::ServerContext; +using grpc::ThreadPool; +using grpc::testing::Payload; +using grpc::testing::PayloadType; +using grpc::testing::ServerStats; +using grpc::testing::SimpleRequest; +using grpc::testing::SimpleResponse; +using grpc::testing::StatsRequest; +using grpc::testing::TestService; +using grpc::Status; + +// In some distros, gflags is in the namespace google, and in some others, +// in gflags. This hack is enabling us to find both. +namespace google {} +namespace gflags {} +using namespace google; +using namespace gflags; + +static bool got_sigint = false; + +static void sigint_handler(int x) { got_sigint = 1; } + +static double time_double(struct timeval *tv) { + return tv->tv_sec + 1e-6 * tv->tv_usec; +} + +static bool SetPayload(PayloadType type, int size, Payload *payload) { + PayloadType response_type = type; + // TODO(yangg): Support UNCOMPRESSABLE payload. + if (type != PayloadType::COMPRESSABLE) { + return false; + } + payload->set_type(response_type); + std::unique_ptr body(new char[size]()); + payload->set_body(body.get(), size); + return true; +} + +namespace { + +class AsyncQpsServerTest { + public: + AsyncQpsServerTest() : srv_cq_(), async_service_(&srv_cq_), server_(nullptr) { + char *server_address = NULL; + gpr_join_host_port(&server_address, "::", FLAGS_port); + + ServerBuilder builder; + builder.AddPort(server_address); + + builder.RegisterAsyncService(&async_service_); + + server_ = builder.BuildAndStart(); + gpr_log(GPR_INFO, "Server listening on %s\n", server_address); + gpr_free(server_address); + + using namespace std::placeholders; + request_unary_ = std::bind(&TestService::AsyncService::RequestUnaryCall, + &async_service_, _1, _2, _3, &srv_cq_, _4); + request_stats_ = + std::bind(&TestService::AsyncService::RequestCollectServerStats, + &async_service_, _1, _2, _3, &srv_cq_, _4); + for (int i = 0; i < 100; i++) { + contexts_.push_front(new ServerRpcContextUnaryImpl(request_unary_, UnaryCall)); + contexts_.push_front(new ServerRpcContextUnaryImpl(request_stats_, CollectServerStats)); + } + } + ~AsyncQpsServerTest() { + server_->Shutdown(); + void *ignored_tag; + bool ignored_ok; + srv_cq_.Shutdown(); + while (srv_cq_.Next(&ignored_tag, &ignored_ok)) { + } + while (!contexts_.empty()) { + delete contexts_.front(); + contexts_.pop_front(); + } + } + void ServeRpcs(int num_threads) { + std::vector threads; + for (int i = 0; i < num_threads; i++) { + threads.push_back(std::thread([=]() { + // Wait until work is available or we are shutting down + bool ok; + void *got_tag; + while (srv_cq_.Next(&got_tag, &ok)) { + EXPECT_EQ(ok, true); + ServerRpcContext *ctx = detag(got_tag); + // The tag is a pointer to an RPC context to invoke + if ((*ctx)() == false) { + // this RPC context is done, so refresh it + ctx->refresh(); + } + } + return; + })); + } + while (!got_sigint) { + std::this_thread::sleep_for(std::chrono::seconds(5)); + } + } + private: + class ServerRpcContext { + public: + ServerRpcContext() {} + virtual ~ServerRpcContext() {}; + virtual bool operator()() = 0; // do next state, return false if all done + virtual void refresh() = 0; // start this back at a clean state + }; + static void *tag(ServerRpcContext *func) { + return reinterpret_cast(func); + } + static ServerRpcContext *detag(void *tag) { + return reinterpret_cast(tag); + } + + template + class ServerRpcContextUnaryImpl : public ServerRpcContext { + public: + ServerRpcContextUnaryImpl( + std::function *, + void *)> request_method, + std::function + invoke_method) + : next_state_(&ServerRpcContextUnaryImpl::invoker), + request_method_(request_method), + invoke_method_(invoke_method), + response_writer_(&srv_ctx_) { + request_method_(&srv_ctx_, &req_, &response_writer_, + AsyncQpsServerTest::tag(this)); + } + ~ServerRpcContextUnaryImpl() override {} + bool operator()() override {return (this->*next_state_)();} + void refresh() override { + srv_ctx_ = ServerContext(); + req_ = RequestType(); + response_writer_ = + grpc::ServerAsyncResponseWriter(&srv_ctx_); + + // Then request the method + next_state_ = &ServerRpcContextUnaryImpl::invoker; + request_method_(&srv_ctx_, &req_, &response_writer_, + AsyncQpsServerTest::tag(this)); + } + private: + bool finisher() {return false;} + bool invoker() { + ResponseType response; + + // Call the RPC processing function + grpc::Status status = invoke_method_(&req_, &response); + + // Have the response writer work and invoke on_finish when done + next_state_ = &ServerRpcContextUnaryImpl::finisher; + response_writer_.Finish(response, status, + AsyncQpsServerTest::tag(this)); + return true; + } + ServerContext srv_ctx_; + RequestType req_; + bool (ServerRpcContextUnaryImpl::*next_state_)(); + std::function *, void *)> + request_method_; + std::function + invoke_method_; + grpc::ServerAsyncResponseWriter response_writer_; + }; + + static Status CollectServerStats(const StatsRequest *, + ServerStats *response) { + struct rusage usage; + struct timeval tv; + gettimeofday(&tv, NULL); + getrusage(RUSAGE_SELF, &usage); + response->set_time_now(time_double(&tv)); + response->set_time_user(time_double(&usage.ru_utime)); + response->set_time_system(time_double(&usage.ru_stime)); + return Status::OK; + } + static Status UnaryCall(const SimpleRequest *request, + SimpleResponse *response) { + if (request->has_response_size() && request->response_size() > 0) { + if (!SetPayload(request->response_type(), request->response_size(), + response->mutable_payload())) { + return Status(grpc::StatusCode::INTERNAL, "Error creating payload."); + } + } + return Status::OK; + } + CompletionQueue srv_cq_; + TestService::AsyncService async_service_; + std::unique_ptr server_; + std::function *, void *)> + request_unary_; + std::function *, void *)> + request_stats_; + std::forward_list contexts_; +}; + +} // namespace + +static void RunServer() { + AsyncQpsServerTest server; + + grpc_profiler_start("qps_server_async.prof"); + + server.ServeRpcs(FLAGS_server_threads); + + grpc_profiler_stop(); +} + +int main(int argc, char **argv) { + grpc_init(); + ParseCommandLineFlags(&argc, &argv, true); + GPR_ASSERT(FLAGS_port != 0); + GPR_ASSERT(!FLAGS_enable_ssl); + + signal(SIGINT, sigint_handler); + + RunServer(); + + grpc_shutdown(); + google::protobuf::ShutdownProtobufLibrary(); + + return 0; +} From 95a34efc3881d23a394dd7d5227da904634a0472 Mon Sep 17 00:00:00 2001 From: vjpai Date: Thu, 26 Feb 2015 16:42:24 -0800 Subject: [PATCH 03/71] Add async multithreaded tests to build scripts --- Makefile | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++- build.json | 36 ++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 310f0dc5d95..805e837456e 100644 --- a/Makefile +++ b/Makefile @@ -524,7 +524,9 @@ pubsub_client: $(BINDIR)/$(CONFIG)/pubsub_client pubsub_publisher_test: $(BINDIR)/$(CONFIG)/pubsub_publisher_test pubsub_subscriber_test: $(BINDIR)/$(CONFIG)/pubsub_subscriber_test qps_client: $(BINDIR)/$(CONFIG)/qps_client +qps_client_async: $(BINDIR)/$(CONFIG)/qps_client_async qps_server: $(BINDIR)/$(CONFIG)/qps_server +qps_server_async: $(BINDIR)/$(CONFIG)/qps_server_async status_test: $(BINDIR)/$(CONFIG)/status_test thread_pool_test: $(BINDIR)/$(CONFIG)/thread_pool_test chttp2_fake_security_cancel_after_accept_test: $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test @@ -933,7 +935,7 @@ buildtests: buildtests_c buildtests_cxx buildtests_c: privatelibs_c $(BINDIR)/$(CONFIG)/alarm_heap_test $(BINDIR)/$(CONFIG)/alarm_list_test $(BINDIR)/$(CONFIG)/alarm_test $(BINDIR)/$(CONFIG)/alpn_test $(BINDIR)/$(CONFIG)/bin_encoder_test $(BINDIR)/$(CONFIG)/census_hash_table_test $(BINDIR)/$(CONFIG)/census_statistics_multiple_writers_circular_buffer_test $(BINDIR)/$(CONFIG)/census_statistics_multiple_writers_test $(BINDIR)/$(CONFIG)/census_statistics_performance_test $(BINDIR)/$(CONFIG)/census_statistics_quick_test $(BINDIR)/$(CONFIG)/census_statistics_small_log_test $(BINDIR)/$(CONFIG)/census_stub_test $(BINDIR)/$(CONFIG)/census_window_stats_test $(BINDIR)/$(CONFIG)/chttp2_status_conversion_test $(BINDIR)/$(CONFIG)/chttp2_stream_encoder_test $(BINDIR)/$(CONFIG)/chttp2_stream_map_test $(BINDIR)/$(CONFIG)/chttp2_transport_end2end_test $(BINDIR)/$(CONFIG)/dualstack_socket_test $(BINDIR)/$(CONFIG)/echo_client $(BINDIR)/$(CONFIG)/echo_server $(BINDIR)/$(CONFIG)/echo_test $(BINDIR)/$(CONFIG)/fd_posix_test $(BINDIR)/$(CONFIG)/fling_client $(BINDIR)/$(CONFIG)/fling_server $(BINDIR)/$(CONFIG)/fling_stream_test $(BINDIR)/$(CONFIG)/fling_test $(BINDIR)/$(CONFIG)/gpr_cancellable_test $(BINDIR)/$(CONFIG)/gpr_cmdline_test $(BINDIR)/$(CONFIG)/gpr_env_test $(BINDIR)/$(CONFIG)/gpr_file_test $(BINDIR)/$(CONFIG)/gpr_histogram_test $(BINDIR)/$(CONFIG)/gpr_host_port_test $(BINDIR)/$(CONFIG)/gpr_log_test $(BINDIR)/$(CONFIG)/gpr_slice_buffer_test $(BINDIR)/$(CONFIG)/gpr_slice_test $(BINDIR)/$(CONFIG)/gpr_string_test $(BINDIR)/$(CONFIG)/gpr_sync_test $(BINDIR)/$(CONFIG)/gpr_thd_test $(BINDIR)/$(CONFIG)/gpr_time_test $(BINDIR)/$(CONFIG)/gpr_useful_test $(BINDIR)/$(CONFIG)/grpc_base64_test $(BINDIR)/$(CONFIG)/grpc_byte_buffer_reader_test $(BINDIR)/$(CONFIG)/grpc_channel_stack_test $(BINDIR)/$(CONFIG)/grpc_completion_queue_test $(BINDIR)/$(CONFIG)/grpc_credentials_test $(BINDIR)/$(CONFIG)/grpc_json_token_test $(BINDIR)/$(CONFIG)/grpc_stream_op_test $(BINDIR)/$(CONFIG)/hpack_parser_test $(BINDIR)/$(CONFIG)/hpack_table_test $(BINDIR)/$(CONFIG)/httpcli_format_request_test $(BINDIR)/$(CONFIG)/httpcli_parser_test $(BINDIR)/$(CONFIG)/httpcli_test $(BINDIR)/$(CONFIG)/json_rewrite $(BINDIR)/$(CONFIG)/json_rewrite_test $(BINDIR)/$(CONFIG)/json_test $(BINDIR)/$(CONFIG)/lame_client_test $(BINDIR)/$(CONFIG)/message_compress_test $(BINDIR)/$(CONFIG)/metadata_buffer_test $(BINDIR)/$(CONFIG)/multi_init_test $(BINDIR)/$(CONFIG)/murmur_hash_test $(BINDIR)/$(CONFIG)/no_server_test $(BINDIR)/$(CONFIG)/poll_kick_posix_test $(BINDIR)/$(CONFIG)/resolve_address_test $(BINDIR)/$(CONFIG)/secure_endpoint_test $(BINDIR)/$(CONFIG)/sockaddr_utils_test $(BINDIR)/$(CONFIG)/tcp_client_posix_test $(BINDIR)/$(CONFIG)/tcp_posix_test $(BINDIR)/$(CONFIG)/tcp_server_posix_test $(BINDIR)/$(CONFIG)/time_averaged_stats_test $(BINDIR)/$(CONFIG)/time_test $(BINDIR)/$(CONFIG)/timeout_encoding_test $(BINDIR)/$(CONFIG)/transport_metadata_test $(BINDIR)/$(CONFIG)/transport_security_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_writes_done_hangs_with_pending_read_legacy_test -buildtests_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/async_end2end_test $(BINDIR)/$(CONFIG)/channel_arguments_test $(BINDIR)/$(CONFIG)/credentials_test $(BINDIR)/$(CONFIG)/end2end_test $(BINDIR)/$(CONFIG)/interop_client $(BINDIR)/$(CONFIG)/interop_server $(BINDIR)/$(CONFIG)/interop_test $(BINDIR)/$(CONFIG)/pubsub_client $(BINDIR)/$(CONFIG)/pubsub_publisher_test $(BINDIR)/$(CONFIG)/pubsub_subscriber_test $(BINDIR)/$(CONFIG)/qps_client $(BINDIR)/$(CONFIG)/qps_server $(BINDIR)/$(CONFIG)/status_test $(BINDIR)/$(CONFIG)/thread_pool_test +buildtests_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/async_end2end_test $(BINDIR)/$(CONFIG)/channel_arguments_test $(BINDIR)/$(CONFIG)/credentials_test $(BINDIR)/$(CONFIG)/end2end_test $(BINDIR)/$(CONFIG)/interop_client $(BINDIR)/$(CONFIG)/interop_server $(BINDIR)/$(CONFIG)/interop_test $(BINDIR)/$(CONFIG)/pubsub_client $(BINDIR)/$(CONFIG)/pubsub_publisher_test $(BINDIR)/$(CONFIG)/pubsub_subscriber_test $(BINDIR)/$(CONFIG)/qps_client $(BINDIR)/$(CONFIG)/qps_client_async $(BINDIR)/$(CONFIG)/qps_server $(BINDIR)/$(CONFIG)/qps_server_async $(BINDIR)/$(CONFIG)/status_test $(BINDIR)/$(CONFIG)/thread_pool_test test: test_c test_cxx @@ -7914,6 +7916,39 @@ endif endif +QPS_CLIENT_ASYNC_SRC = \ + $(GENDIR)/test/cpp/qps/qpstest.pb.cc \ + test/cpp/qps/client_async.cc \ + +QPS_CLIENT_ASYNC_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(QPS_CLIENT_ASYNC_SRC)))) + +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL with ALPN. + +$(BINDIR)/$(CONFIG)/qps_client_async: openssl_dep_error + +else + +$(BINDIR)/$(CONFIG)/qps_client_async: $(QPS_CLIENT_ASYNC_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(QPS_CLIENT_ASYNC_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/qps_client_async + +endif + +$(OBJDIR)/$(CONFIG)/test/cpp/qps/qpstest.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_qps_client_async: $(QPS_CLIENT_ASYNC_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(QPS_CLIENT_ASYNC_OBJS:.o=.dep) +endif +endif + + QPS_SERVER_SRC = \ $(GENDIR)/test/cpp/qps/qpstest.pb.cc \ test/cpp/qps/server.cc \ @@ -7947,6 +7982,39 @@ endif endif +QPS_SERVER_ASYNC_SRC = \ + $(GENDIR)/test/cpp/qps/qpstest.pb.cc \ + test/cpp/qps/server_async.cc \ + +QPS_SERVER_ASYNC_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(QPS_SERVER_ASYNC_SRC)))) + +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL with ALPN. + +$(BINDIR)/$(CONFIG)/qps_server_async: openssl_dep_error + +else + +$(BINDIR)/$(CONFIG)/qps_server_async: $(QPS_SERVER_ASYNC_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(QPS_SERVER_ASYNC_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/qps_server_async + +endif + +$(OBJDIR)/$(CONFIG)/test/cpp/qps/qpstest.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_async.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_qps_server_async: $(QPS_SERVER_ASYNC_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(QPS_SERVER_ASYNC_OBJS:.o=.dep) +endif +endif + + STATUS_TEST_SRC = \ test/cpp/util/status_test.cc \ diff --git a/build.json b/build.json index 96437d0a66f..75181f119be 100644 --- a/build.json +++ b/build.json @@ -1815,6 +1815,24 @@ "gpr" ] }, + { + "name": "qps_client_async", + "build": "test", + "run": false, + "language": "c++", + "src": [ + "test/cpp/qps/qpstest.proto", + "test/cpp/qps/client_async.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, { "name": "qps_server", "build": "test", @@ -1833,6 +1851,24 @@ "gpr" ] }, + { + "name": "qps_server_async", + "build": "test", + "run": false, + "language": "c++", + "src": [ + "test/cpp/qps/qpstest.proto", + "test/cpp/qps/server_async.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, { "name": "status_test", "build": "test", From 56c5129629a07ecf86f3381a51d7e80395ce41b2 Mon Sep 17 00:00:00 2001 From: vjpai Date: Thu, 26 Feb 2015 17:01:35 -0800 Subject: [PATCH 04/71] Rename Async methods from generator to avoid naming conflicts to bind and other functions --- src/compiler/cpp_generator.cc | 16 ++++++++-------- test/cpp/end2end/async_end2end_test.cc | 16 ++++++++-------- test/cpp/qps/client_async.cc | 9 ++++----- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index 891032343b5..7710df681c6 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -186,7 +186,7 @@ void PrintHeaderClientMethod(google::protobuf::io::Printer *printer, printer->Print( *vars, "std::unique_ptr< ::grpc::ClientAsyncResponseReader< $Response$>> " - "$Method$(::grpc::ClientContext* context, " + "Async$Method$(::grpc::ClientContext* context, " "const $Request$& request, " "::grpc::CompletionQueue* cq, void* tag);\n"); } else if (ClientOnlyStreaming(method)) { @@ -196,7 +196,7 @@ void PrintHeaderClientMethod(google::protobuf::io::Printer *printer, "::grpc::ClientContext* context, $Response$* response);\n"); printer->Print( *vars, - "std::unique_ptr< ::grpc::ClientAsyncWriter< $Request$>> $Method$(" + "std::unique_ptr< ::grpc::ClientAsyncWriter< $Request$>> Async$Method$(" "::grpc::ClientContext* context, $Response$* response, " "::grpc::CompletionQueue* cq, void* tag);\n"); } else if (ServerOnlyStreaming(method)) { @@ -206,7 +206,7 @@ void PrintHeaderClientMethod(google::protobuf::io::Printer *printer, "::grpc::ClientContext* context, const $Request$& request);\n"); printer->Print( *vars, - "std::unique_ptr< ::grpc::ClientAsyncReader< $Response$>> $Method$(" + "std::unique_ptr< ::grpc::ClientAsyncReader< $Response$>> Async$Method$(" "::grpc::ClientContext* context, const $Request$& request, " "::grpc::CompletionQueue* cq, void* tag);\n"); } else if (BidiStreaming(method)) { @@ -217,7 +217,7 @@ void PrintHeaderClientMethod(google::protobuf::io::Printer *printer, printer->Print(*vars, "std::unique_ptr< ::grpc::ClientAsyncReaderWriter< " "$Request$, $Response$>> " - "$Method$(::grpc::ClientContext* context, " + "Async$Method$(::grpc::ClientContext* context, " "::grpc::CompletionQueue* cq, void* tag);\n"); } } @@ -390,7 +390,7 @@ void PrintSourceClientMethod(google::protobuf::io::Printer *printer, printer->Print( *vars, "std::unique_ptr< ::grpc::ClientAsyncResponseReader< $Response$>> " - "$Service$::Stub::$Method$(::grpc::ClientContext* context, " + "$Service$::Stub::Async$Method$(::grpc::ClientContext* context, " "const $Request$& request, " "::grpc::CompletionQueue* cq, void* tag) {\n"); printer->Print(*vars, @@ -416,7 +416,7 @@ void PrintSourceClientMethod(google::protobuf::io::Printer *printer, "}\n\n"); printer->Print(*vars, "std::unique_ptr< ::grpc::ClientAsyncWriter< $Request$>> " - "$Service$::Stub::$Method$(" + "$Service$::Stub::Async$Method$(" "::grpc::ClientContext* context, $Response$* response, " "::grpc::CompletionQueue* cq, void* tag) {\n"); printer->Print(*vars, @@ -443,7 +443,7 @@ void PrintSourceClientMethod(google::protobuf::io::Printer *printer, "}\n\n"); printer->Print(*vars, "std::unique_ptr< ::grpc::ClientAsyncReader< $Response$>> " - "$Service$::Stub::$Method$(" + "$Service$::Stub::Async$Method$(" "::grpc::ClientContext* context, const $Request$& request, " "::grpc::CompletionQueue* cq, void* tag) {\n"); printer->Print(*vars, @@ -471,7 +471,7 @@ void PrintSourceClientMethod(google::protobuf::io::Printer *printer, printer->Print(*vars, "std::unique_ptr< ::grpc::ClientAsyncReaderWriter< " "$Request$, $Response$>> " - "$Service$::Stub::$Method$(::grpc::ClientContext* context, " + "$Service$::Stub::Async$Method$(::grpc::ClientContext* context, " "::grpc::CompletionQueue* cq, void* tag) {\n"); printer->Print(*vars, " return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< " diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 9e25a5308df..7698e86cf41 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -136,7 +136,7 @@ class AsyncEnd2endTest : public ::testing::Test { send_request.set_message("Hello"); std::unique_ptr > - response_reader(stub_->Echo( + response_reader(stub_->AsyncEcho( &cli_ctx, send_request, &cli_cq_, tag(1))); service_.RequestEcho( @@ -191,7 +191,7 @@ TEST_F(AsyncEnd2endTest, SimpleClientStreaming) { send_request.set_message("Hello"); std::unique_ptr > cli_stream( - stub_->RequestStream(&cli_ctx, &recv_response, &cli_cq_, tag(1))); + stub_->AsyncRequestStream(&cli_ctx, &recv_response, &cli_cq_, tag(1))); service_.RequestRequestStream( &srv_ctx, &srv_stream, &srv_cq_, tag(2)); @@ -245,7 +245,7 @@ TEST_F(AsyncEnd2endTest, SimpleServerStreaming) { send_request.set_message("Hello"); std::unique_ptr > cli_stream( - stub_->ResponseStream(&cli_ctx, send_request, &cli_cq_, tag(1))); + stub_->AsyncResponseStream(&cli_ctx, send_request, &cli_cq_, tag(1))); service_.RequestResponseStream( &srv_ctx, &recv_request, &srv_stream, &srv_cq_, tag(2)); @@ -296,7 +296,7 @@ TEST_F(AsyncEnd2endTest, SimpleBidiStreaming) { send_request.set_message("Hello"); std::unique_ptr > - cli_stream(stub_->BidiStream(&cli_ctx, &cli_cq_, tag(1))); + cli_stream(stub_->AsyncBidiStream(&cli_ctx, &cli_cq_, tag(1))); service_.RequestBidiStream( &srv_ctx, &srv_stream, &srv_cq_, tag(2)); @@ -355,7 +355,7 @@ TEST_F(AsyncEnd2endTest, ClientInitialMetadataRpc) { cli_ctx.AddMetadata(meta2.first, meta2.second); std::unique_ptr > response_reader( - stub_->Echo(&cli_ctx, send_request, &cli_cq_, tag(1))); + stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); service_.RequestEcho( &srv_ctx, &recv_request, &response_writer, &srv_cq_, tag(2)); @@ -397,7 +397,7 @@ TEST_F(AsyncEnd2endTest, ServerInitialMetadataRpc) { std::pair meta2("key2", "val2"); std::unique_ptr > response_reader( - stub_->Echo(&cli_ctx, send_request, &cli_cq_, tag(1))); + stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); service_.RequestEcho( &srv_ctx, &recv_request, &response_writer, &srv_cq_, tag(2)); @@ -445,7 +445,7 @@ TEST_F(AsyncEnd2endTest, ServerTrailingMetadataRpc) { std::pair meta2("key2", "val2"); std::unique_ptr > response_reader( - stub_->Echo(&cli_ctx, send_request, &cli_cq_, tag(1))); + stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); service_.RequestEcho( &srv_ctx, &recv_request, &response_writer, &srv_cq_, tag(2)); @@ -501,7 +501,7 @@ TEST_F(AsyncEnd2endTest, MetadataRpc) { cli_ctx.AddMetadata(meta2.first, meta2.second); std::unique_ptr > response_reader( - stub_->Echo(&cli_ctx, send_request, &cli_cq_, tag(1))); + stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); service_.RequestEcho( &srv_ctx, &recv_request, &response_writer, &srv_cq_, tag(2)); diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index 13db4febae5..40344914dc0 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -109,9 +109,9 @@ static double now() { class ClientRpcContextUnaryImpl : public ClientRpcContext { public: ClientRpcContextUnaryImpl(const RequestType& req, - std::function *(grpc::ClientContext *, - const RequestType&, void *)> start_req, + std::function>(grpc::ClientContext *, + const RequestType&, void *)> start_req, std::function on_done): context_(), req_(req), response_(), next_state_(&ClientRpcContextUnaryImpl::ReqSent), @@ -226,8 +226,7 @@ static void RunTest(const int client_threads, const int client_channels, TestService::Stub *stub = channels[channel_num].get_stub(); grpc::ClientContext context; - auto start_req = std::bind(static_cast*(TestService::Stub::*)(grpc::ClientContext *,const SimpleRequest &,grpc::CompletionQueue *,void *)> - (&TestService::Stub::UnaryCall), + auto start_req = std::bind(&TestService::Stub::AsyncUnaryCall, stub, _1, _2, &cli_cq, _3); new ClientRpcContextUnaryImpl(request, From 64ac47f389d21d2ee0d9db295aa771dc79d940e0 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 26 Feb 2015 17:59:51 -0800 Subject: [PATCH 05/71] clang-format all these files --- test/cpp/end2end/async_end2end_test.cc | 63 +++---- test/cpp/qps/client_async.cc | 230 ++++++++++++------------- test/cpp/qps/server_async.cc | 43 ++--- 3 files changed, 162 insertions(+), 174 deletions(-) diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 7698e86cf41..f03aa9fbd00 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -65,9 +65,7 @@ namespace testing { namespace { -void* tag(int i) { - return (void*)(gpr_intptr)i; -} +void* tag(int i) { return (void*)(gpr_intptr)i; } void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { bool ok; @@ -109,18 +107,10 @@ class AsyncEnd2endTest : public ::testing::Test { stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel)); } - void server_ok(int i) { - verify_ok(&srv_cq_, i, true); - } - void client_ok(int i) { - verify_ok(&cli_cq_, i , true); - } - void server_fail(int i) { - verify_ok(&srv_cq_, i, false); - } - void client_fail(int i) { - verify_ok(&cli_cq_, i, false); - } + void server_ok(int i) { verify_ok(&srv_cq_, i, true); } + void client_ok(int i) { verify_ok(&cli_cq_, i, true); } + void server_fail(int i) { verify_ok(&srv_cq_, i, false); } + void client_fail(int i) { verify_ok(&cli_cq_, i, false); } void SendRpc(int num_rpcs) { for (int i = 0; i < num_rpcs; i++) { @@ -135,12 +125,11 @@ class AsyncEnd2endTest : public ::testing::Test { grpc::ServerAsyncResponseWriter response_writer(&srv_ctx); send_request.set_message("Hello"); - std::unique_ptr > - response_reader(stub_->AsyncEcho( - &cli_ctx, send_request, &cli_cq_, tag(1))); + std::unique_ptr > response_reader( + stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); - service_.RequestEcho( - &srv_ctx, &recv_request, &response_writer, &srv_cq_, tag(2)); + service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, + tag(2)); server_ok(2); EXPECT_EQ(send_request.message(), recv_request.message()); @@ -193,8 +182,7 @@ TEST_F(AsyncEnd2endTest, SimpleClientStreaming) { std::unique_ptr > cli_stream( stub_->AsyncRequestStream(&cli_ctx, &recv_response, &cli_cq_, tag(1))); - service_.RequestRequestStream( - &srv_ctx, &srv_stream, &srv_cq_, tag(2)); + service_.RequestRequestStream(&srv_ctx, &srv_stream, &srv_cq_, tag(2)); server_ok(2); client_ok(1); @@ -247,8 +235,8 @@ TEST_F(AsyncEnd2endTest, SimpleServerStreaming) { std::unique_ptr > cli_stream( stub_->AsyncResponseStream(&cli_ctx, send_request, &cli_cq_, tag(1))); - service_.RequestResponseStream( - &srv_ctx, &recv_request, &srv_stream, &srv_cq_, tag(2)); + service_.RequestResponseStream(&srv_ctx, &recv_request, &srv_stream, &srv_cq_, + tag(2)); server_ok(2); client_ok(1); @@ -298,8 +286,7 @@ TEST_F(AsyncEnd2endTest, SimpleBidiStreaming) { std::unique_ptr > cli_stream(stub_->AsyncBidiStream(&cli_ctx, &cli_cq_, tag(1))); - service_.RequestBidiStream( - &srv_ctx, &srv_stream, &srv_cq_, tag(2)); + service_.RequestBidiStream(&srv_ctx, &srv_stream, &srv_cq_, tag(2)); server_ok(2); client_ok(1); @@ -357,8 +344,8 @@ TEST_F(AsyncEnd2endTest, ClientInitialMetadataRpc) { std::unique_ptr > response_reader( stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); - service_.RequestEcho( - &srv_ctx, &recv_request, &response_writer, &srv_cq_, tag(2)); + service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, + tag(2)); server_ok(2); EXPECT_EQ(send_request.message(), recv_request.message()); auto client_initial_metadata = srv_ctx.client_metadata(); @@ -399,8 +386,8 @@ TEST_F(AsyncEnd2endTest, ServerInitialMetadataRpc) { std::unique_ptr > response_reader( stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); - service_.RequestEcho( - &srv_ctx, &recv_request, &response_writer, &srv_cq_, tag(2)); + service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, + tag(2)); server_ok(2); EXPECT_EQ(send_request.message(), recv_request.message()); srv_ctx.AddInitialMetadata(meta1.first, meta1.second); @@ -447,8 +434,8 @@ TEST_F(AsyncEnd2endTest, ServerTrailingMetadataRpc) { std::unique_ptr > response_reader( stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); - service_.RequestEcho( - &srv_ctx, &recv_request, &response_writer, &srv_cq_, tag(2)); + service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, + tag(2)); server_ok(2); EXPECT_EQ(send_request.message(), recv_request.message()); response_writer.SendInitialMetadata(tag(3)); @@ -462,7 +449,6 @@ TEST_F(AsyncEnd2endTest, ServerTrailingMetadataRpc) { server_ok(4); - response_reader->Finish(&recv_response, &recv_status, tag(5)); client_ok(5); EXPECT_EQ(send_response.message(), recv_response.message()); @@ -491,10 +477,12 @@ TEST_F(AsyncEnd2endTest, MetadataRpc) { std::pair meta2( "key2-bin", {"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc", 13}); std::pair meta3("key3", "val3"); - std::pair meta6("key4-bin", + std::pair meta6( + "key4-bin", {"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d", 14}); std::pair meta5("key5", "val5"); - std::pair meta4("key6-bin", + std::pair meta4( + "key6-bin", {"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee", 15}); cli_ctx.AddMetadata(meta1.first, meta1.second); @@ -503,8 +491,8 @@ TEST_F(AsyncEnd2endTest, MetadataRpc) { std::unique_ptr > response_reader( stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); - service_.RequestEcho( - &srv_ctx, &recv_request, &response_writer, &srv_cq_, tag(2)); + service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, + tag(2)); server_ok(2); EXPECT_EQ(send_request.message(), recv_request.message()); auto client_initial_metadata = srv_ctx.client_metadata(); @@ -531,7 +519,6 @@ TEST_F(AsyncEnd2endTest, MetadataRpc) { server_ok(5); - response_reader->Finish(&recv_response, &recv_status, tag(6)); client_ok(6); EXPECT_EQ(send_response.message(), recv_response.message()); diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index 40344914dc0..0c48f08ea02 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -84,8 +84,8 @@ using grpc::testing::TestService; // In some distros, gflags is in the namespace google, and in some others, // in gflags. This hack is enabling us to find both. -namespace google { } -namespace gflags { } +namespace google {} +namespace gflags {} using namespace google; using namespace gflags; @@ -94,63 +94,67 @@ static double now() { return 1e9 * tv.tv_sec + tv.tv_nsec; } - class ClientRpcContext { - public: - ClientRpcContext() {} - virtual ~ClientRpcContext() {} - virtual bool operator()() = 0; // do next state, return false if steps done - static void *tag(ClientRpcContext *c) {return reinterpret_cast(c);} - static ClientRpcContext *detag(void *t) { - return reinterpret_cast(t); - } - virtual void report_stats(gpr_histogram *hist) = 0; - }; - template - class ClientRpcContextUnaryImpl : public ClientRpcContext { - public: - ClientRpcContextUnaryImpl(const RequestType& req, - std::function>(grpc::ClientContext *, - const RequestType&, void *)> start_req, - std::function on_done): - context_(), req_(req), response_(), - next_state_(&ClientRpcContextUnaryImpl::ReqSent), - callback_(on_done), - start_(now()), - response_reader_(start_req(&context_, req_, - ClientRpcContext::tag(this))) { - } - ~ClientRpcContextUnaryImpl() override {} - bool operator()() override {return (this->*next_state_)();} - void report_stats(gpr_histogram *hist) override { - gpr_histogram_add(hist, now()-start_); - } - private: - bool ReqSent() { - next_state_ = &ClientRpcContextUnaryImpl::RespDone; - response_reader_->Finish(&response_, &status_, ClientRpcContext::tag(this)); - return true; - } - bool RespDone() { - next_state_ = &ClientRpcContextUnaryImpl::DoCallBack; - return false; - } - bool DoCallBack() { - callback_(status_, &response_); - return false; - } - grpc::ClientContext context_; - RequestType req_; - ResponseType response_; - bool (ClientRpcContextUnaryImpl::*next_state_)(); - std::function callback_; - grpc::Status status_; - double start_; - std::unique_ptr> response_reader_; - }; +class ClientRpcContext { + public: + ClientRpcContext() {} + virtual ~ClientRpcContext() {} + virtual bool operator()() = 0; // do next state, return false if steps done + static void *tag(ClientRpcContext *c) { return reinterpret_cast(c); } + static ClientRpcContext *detag(void *t) { + return reinterpret_cast(t); + } + virtual void report_stats(gpr_histogram *hist) = 0; +}; +template +class ClientRpcContextUnaryImpl : public ClientRpcContext { + public: + ClientRpcContextUnaryImpl( + const RequestType &req, + std::function< + std::unique_ptr>( + grpc::ClientContext *, const RequestType &, void *)> start_req, + std::function on_done) + : context_(), + req_(req), + response_(), + next_state_(&ClientRpcContextUnaryImpl::ReqSent), + callback_(on_done), + start_(now()), + response_reader_( + start_req(&context_, req_, ClientRpcContext::tag(this))) {} + ~ClientRpcContextUnaryImpl() override {} + bool operator()() override { return (this->*next_state_)(); } + void report_stats(gpr_histogram *hist) override { + gpr_histogram_add(hist, now() - start_); + } + + private: + bool ReqSent() { + next_state_ = &ClientRpcContextUnaryImpl::RespDone; + response_reader_->Finish(&response_, &status_, ClientRpcContext::tag(this)); + return true; + } + bool RespDone() { + next_state_ = &ClientRpcContextUnaryImpl::DoCallBack; + return false; + } + bool DoCallBack() { + callback_(status_, &response_); + return false; + } + grpc::ClientContext context_; + RequestType req_; + ResponseType response_; + bool (ClientRpcContextUnaryImpl::*next_state_)(); + std::function callback_; + grpc::Status status_; + double start_; + std::unique_ptr> + response_reader_; +}; static void RunTest(const int client_threads, const int client_channels, - const int num_rpcs, const int payload_size) { + const int num_rpcs, const int payload_size) { gpr_log(GPR_INFO, "QPS test with parameters\n" "enable_ssl = %d\n" @@ -197,71 +201,65 @@ static void RunTest(const int client_threads, const int client_channels, grpc_profiler_start("qps_client_async.prof"); auto CheckDone = [=](grpc::Status s, SimpleResponse *response) { - GPR_ASSERT(s.IsOk() && - (response->payload().type() == - grpc::testing::PayloadType::COMPRESSABLE) && - (response->payload().body().length() == - static_cast(payload_size))); + GPR_ASSERT(s.IsOk() && (response->payload().type() == + grpc::testing::PayloadType::COMPRESSABLE) && + (response->payload().body().length() == + static_cast(payload_size))); }; - + for (int i = 0; i < client_threads; i++) { gpr_histogram *hist = gpr_histogram_create(0.01, 60e9); GPR_ASSERT(hist != NULL); thread_stats[i] = hist; - threads.push_back( - std::thread([hist, client_threads, client_channels, num_rpcs, - payload_size, &channels, &CheckDone](int channel_num) { - using namespace std::placeholders; - SimpleRequest request; - request.set_response_type( - grpc::testing::PayloadType::COMPRESSABLE); - request.set_response_size(payload_size); - - grpc::CompletionQueue cli_cq; - - int rpcs_sent=0; - while (rpcs_sent < num_rpcs) { - rpcs_sent++; - TestService::Stub *stub = - channels[channel_num].get_stub(); - grpc::ClientContext context; - auto start_req = std::bind(&TestService::Stub::AsyncUnaryCall, - stub, _1, _2, &cli_cq, _3); - new ClientRpcContextUnaryImpl(request, - start_req, - CheckDone); - void *got_tag; - bool ok; - - // Need to call 2 next for every 1 RPC (1 for req done, 1 for resp done) - cli_cq.Next(&got_tag,&ok); - if (!ok) - break; - ClientRpcContext *ctx = ClientRpcContext::detag(got_tag); - if ((*ctx)() == false) { - // call the callback and then delete it - (*ctx)(); - delete ctx; - } - cli_cq.Next(&got_tag,&ok); - if (!ok) - break; - ctx = ClientRpcContext::detag(got_tag); - if ((*ctx)() == false) { - // call the callback and then delete it - ctx->report_stats(hist); - (*ctx)(); - delete ctx; - } - // Now do runtime round-robin assignment of the next - // channel number - channel_num += client_threads; - channel_num %= client_channels; - } - }, - i % client_channels)); + threads.push_back(std::thread( + [hist, client_threads, client_channels, num_rpcs, payload_size, + &channels, &CheckDone](int channel_num) { + using namespace std::placeholders; + SimpleRequest request; + request.set_response_type(grpc::testing::PayloadType::COMPRESSABLE); + request.set_response_size(payload_size); + + grpc::CompletionQueue cli_cq; + + int rpcs_sent = 0; + while (rpcs_sent < num_rpcs) { + rpcs_sent++; + TestService::Stub *stub = channels[channel_num].get_stub(); + grpc::ClientContext context; + auto start_req = std::bind(&TestService::Stub::AsyncUnaryCall, stub, + _1, _2, &cli_cq, _3); + new ClientRpcContextUnaryImpl( + request, start_req, CheckDone); + void *got_tag; + bool ok; + + // Need to call 2 next for every 1 RPC (1 for req done, 1 for resp + // done) + cli_cq.Next(&got_tag, &ok); + if (!ok) break; + ClientRpcContext *ctx = ClientRpcContext::detag(got_tag); + if ((*ctx)() == false) { + // call the callback and then delete it + (*ctx)(); + delete ctx; + } + cli_cq.Next(&got_tag, &ok); + if (!ok) break; + ctx = ClientRpcContext::detag(got_tag); + if ((*ctx)() == false) { + // call the callback and then delete it + ctx->report_stats(hist); + (*ctx)(); + delete ctx; + } + // Now do runtime round-robin assignment of the next + // channel number + channel_num += client_threads; + channel_num %= client_channels; + } + }, + i % client_channels)); } gpr_histogram *hist = gpr_histogram_create(0.01, 60e9); diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index fec17ea79fa..b68c2c95483 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -124,10 +124,12 @@ class AsyncQpsServerTest { std::bind(&TestService::AsyncService::RequestCollectServerStats, &async_service_, _1, _2, _3, &srv_cq_, _4); for (int i = 0; i < 100; i++) { - contexts_.push_front(new ServerRpcContextUnaryImpl(request_unary_, UnaryCall)); - contexts_.push_front(new ServerRpcContextUnaryImpl(request_stats_, CollectServerStats)); + contexts_.push_front( + new ServerRpcContextUnaryImpl( + request_unary_, UnaryCall)); + contexts_.push_front( + new ServerRpcContextUnaryImpl( + request_stats_, CollectServerStats)); } } ~AsyncQpsServerTest() { @@ -151,12 +153,12 @@ class AsyncQpsServerTest { void *got_tag; while (srv_cq_.Next(&got_tag, &ok)) { EXPECT_EQ(ok, true); - ServerRpcContext *ctx = detag(got_tag); + ServerRpcContext *ctx = detag(got_tag); // The tag is a pointer to an RPC context to invoke if ((*ctx)() == false) { - // this RPC context is done, so refresh it - ctx->refresh(); - } + // this RPC context is done, so refresh it + ctx->refresh(); + } } return; })); @@ -165,13 +167,14 @@ class AsyncQpsServerTest { std::this_thread::sleep_for(std::chrono::seconds(5)); } } + private: class ServerRpcContext { - public: + public: ServerRpcContext() {} - virtual ~ServerRpcContext() {}; - virtual bool operator()() = 0; // do next state, return false if all done - virtual void refresh() = 0; // start this back at a clean state + virtual ~ServerRpcContext(){}; + virtual bool operator()() = 0; // do next state, return false if all done + virtual void refresh() = 0; // start this back at a clean state }; static void *tag(ServerRpcContext *func) { return reinterpret_cast(func); @@ -192,25 +195,26 @@ class AsyncQpsServerTest { : next_state_(&ServerRpcContextUnaryImpl::invoker), request_method_(request_method), invoke_method_(invoke_method), - response_writer_(&srv_ctx_) { + response_writer_(&srv_ctx_) { request_method_(&srv_ctx_, &req_, &response_writer_, - AsyncQpsServerTest::tag(this)); + AsyncQpsServerTest::tag(this)); } ~ServerRpcContextUnaryImpl() override {} - bool operator()() override {return (this->*next_state_)();} + bool operator()() override { return (this->*next_state_)(); } void refresh() override { srv_ctx_ = ServerContext(); req_ = RequestType(); response_writer_ = - grpc::ServerAsyncResponseWriter(&srv_ctx_); + grpc::ServerAsyncResponseWriter(&srv_ctx_); // Then request the method next_state_ = &ServerRpcContextUnaryImpl::invoker; request_method_(&srv_ctx_, &req_, &response_writer_, - AsyncQpsServerTest::tag(this)); + AsyncQpsServerTest::tag(this)); } + private: - bool finisher() {return false;} + bool finisher() { return false; } bool invoker() { ResponseType response; @@ -219,8 +223,7 @@ class AsyncQpsServerTest { // Have the response writer work and invoke on_finish when done next_state_ = &ServerRpcContextUnaryImpl::finisher; - response_writer_.Finish(response, status, - AsyncQpsServerTest::tag(this)); + response_writer_.Finish(response, status, AsyncQpsServerTest::tag(this)); return true; } ServerContext srv_ctx_; From 20ee44ff063e6cfee8e84fa3dc901b442ecf416e Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 27 Feb 2015 08:24:17 +0100 Subject: [PATCH 06/71] Removing the ssh setup of the dockerfile. --- tools/dockerfile/grpc_base/Dockerfile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tools/dockerfile/grpc_base/Dockerfile b/tools/dockerfile/grpc_base/Dockerfile index d2b5569036d..91862773d57 100644 --- a/tools/dockerfile/grpc_base/Dockerfile +++ b/tools/dockerfile/grpc_base/Dockerfile @@ -64,13 +64,5 @@ ENV CLOUD_SDK /google-cloud-sdk RUN $CLOUD_SDK/install.sh --usage-reporting=true --path-update=true --bash-completion=true --rc-path=/.bashrc --disable-installation-options ENV PATH $CLOUD_SDK/bin:$PATH -# Install a GitHub SSH service credential that gives access to the GitHub repo while it's private -# TODO: remove this once the repo is public -ADD .ssh .ssh -RUN chmod 600 .ssh/github.rsa -RUN mkdir -p $HOME/.ssh && echo 'Host github.com' > $HOME/.ssh/config -RUN echo " IdentityFile /.ssh/github.rsa" >> $HOME/.ssh/config -RUN echo 'StrictHostKeyChecking no' >> $HOME/.ssh/config - # Define the default command. CMD ["bash"] From 3c110662173ba64b7cbc3846f19d6d9e918e1cee Mon Sep 17 00:00:00 2001 From: vjpai Date: Fri, 27 Feb 2015 07:17:16 -0800 Subject: [PATCH 07/71] override->GRPC_OVERRIDE --- test/cpp/qps/client_async.cc | 6 +++--- test/cpp/qps/server_async.cc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index 0c48f08ea02..24f4ac69686 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -122,9 +122,9 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { start_(now()), response_reader_( start_req(&context_, req_, ClientRpcContext::tag(this))) {} - ~ClientRpcContextUnaryImpl() override {} - bool operator()() override { return (this->*next_state_)(); } - void report_stats(gpr_histogram *hist) override { + ~ClientRpcContextUnaryImpl() GRPC_OVERRIDE {} + bool operator()() GRPC_OVERRIDE { return (this->*next_state_)(); } + void report_stats(gpr_histogram *hist) GRPC_OVERRIDE { gpr_histogram_add(hist, now() - start_); } diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index b68c2c95483..67452294f98 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -199,9 +199,9 @@ class AsyncQpsServerTest { request_method_(&srv_ctx_, &req_, &response_writer_, AsyncQpsServerTest::tag(this)); } - ~ServerRpcContextUnaryImpl() override {} - bool operator()() override { return (this->*next_state_)(); } - void refresh() override { + ~ServerRpcContextUnaryImpl() GRPC_OVERRIDE {} + bool operator()() GRPC_OVERRIDE { return (this->*next_state_)(); } + void refresh() GRPC_OVERRIDE { srv_ctx_ = ServerContext(); req_ = RequestType(); response_writer_ = From cd801c853179bd9f7bbffcf7b5714741ff137706 Mon Sep 17 00:00:00 2001 From: vjpai Date: Fri, 27 Feb 2015 07:21:31 -0800 Subject: [PATCH 08/71] <:: -> < :: --- test/cpp/qps/client_async.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index 24f4ac69686..a897c28dc7f 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -188,7 +188,7 @@ static void RunTest(const int client_threads, const int client_channels, } std::vector threads; // Will add threads when ready to execute - std::vector<::gpr_histogram *> thread_stats(client_threads); + std::vector< ::gpr_histogram *> thread_stats(client_threads); TestService::Stub *stub_stats = channels[0].get_stub(); grpc::ClientContext context_stats_begin; From 9440a14558e6d43db52edcaa916374d12a3df677 Mon Sep 17 00:00:00 2001 From: vjpai Date: Fri, 27 Feb 2015 09:19:09 -0800 Subject: [PATCH 09/71] Move std::bind call out of main loop, change constructor appropriately --- test/cpp/qps/client_async.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index a897c28dc7f..8cb11b89c4d 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -109,19 +109,22 @@ template class ClientRpcContextUnaryImpl : public ClientRpcContext { public: ClientRpcContextUnaryImpl( + TestService::Stub *stub, const RequestType &req, std::function< std::unique_ptr>( - grpc::ClientContext *, const RequestType &, void *)> start_req, + TestService::Stub *, grpc::ClientContext *, const RequestType &, + void *)> start_req, std::function on_done) : context_(), + stub_(stub), req_(req), response_(), next_state_(&ClientRpcContextUnaryImpl::ReqSent), callback_(on_done), start_(now()), response_reader_( - start_req(&context_, req_, ClientRpcContext::tag(this))) {} + start_req(stub_, &context_, req_, ClientRpcContext::tag(this))) {} ~ClientRpcContextUnaryImpl() GRPC_OVERRIDE {} bool operator()() GRPC_OVERRIDE { return (this->*next_state_)(); } void report_stats(gpr_histogram *hist) GRPC_OVERRIDE { @@ -143,6 +146,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { return false; } grpc::ClientContext context_; + TestService::Stub *stub_; RequestType req_; ResponseType response_; bool (ClientRpcContextUnaryImpl::*next_state_)(); @@ -221,15 +225,14 @@ static void RunTest(const int client_threads, const int client_channels, request.set_response_size(payload_size); grpc::CompletionQueue cli_cq; + auto start_req = std::bind(&TestService::Stub::AsyncUnaryCall, _1, + _2, _3, &cli_cq, _4); int rpcs_sent = 0; while (rpcs_sent < num_rpcs) { rpcs_sent++; TestService::Stub *stub = channels[channel_num].get_stub(); - grpc::ClientContext context; - auto start_req = std::bind(&TestService::Stub::AsyncUnaryCall, stub, - _1, _2, &cli_cq, _3); - new ClientRpcContextUnaryImpl( + new ClientRpcContextUnaryImpl(stub, request, start_req, CheckDone); void *got_tag; bool ok; From 6e2e64a8b4252da5eaf2350805f25ab0661c3824 Mon Sep 17 00:00:00 2001 From: vjpai Date: Fri, 27 Feb 2015 09:28:28 -0800 Subject: [PATCH 10/71] Stop abusing operator() overloading --- test/cpp/qps/client_async.cc | 13 +++++++------ test/cpp/qps/server_async.cc | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index 8cb11b89c4d..9ea9cfe8b9b 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -98,7 +98,7 @@ class ClientRpcContext { public: ClientRpcContext() {} virtual ~ClientRpcContext() {} - virtual bool operator()() = 0; // do next state, return false if steps done + virtual bool RunNextState() = 0; // do next state, return false if steps done static void *tag(ClientRpcContext *c) { return reinterpret_cast(c); } static ClientRpcContext *detag(void *t) { return reinterpret_cast(t); @@ -126,7 +126,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { response_reader_( start_req(stub_, &context_, req_, ClientRpcContext::tag(this))) {} ~ClientRpcContextUnaryImpl() GRPC_OVERRIDE {} - bool operator()() GRPC_OVERRIDE { return (this->*next_state_)(); } + bool RunNextState() GRPC_OVERRIDE { return (this->*next_state_)(); } void report_stats(gpr_histogram *hist) GRPC_OVERRIDE { gpr_histogram_add(hist, now() - start_); } @@ -242,18 +242,19 @@ static void RunTest(const int client_threads, const int client_channels, cli_cq.Next(&got_tag, &ok); if (!ok) break; ClientRpcContext *ctx = ClientRpcContext::detag(got_tag); - if ((*ctx)() == false) { + if (ctx->RunNextState() == false) { // call the callback and then delete it - (*ctx)(); + ctx->report_stats(hist); + ctx->RunNextState(); delete ctx; } cli_cq.Next(&got_tag, &ok); if (!ok) break; ctx = ClientRpcContext::detag(got_tag); - if ((*ctx)() == false) { + if (ctx->RunNextState() == false) { // call the callback and then delete it ctx->report_stats(hist); - (*ctx)(); + ctx->RunNextState(); delete ctx; } // Now do runtime round-robin assignment of the next diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index 67452294f98..fc2459c1a50 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -155,7 +155,7 @@ class AsyncQpsServerTest { EXPECT_EQ(ok, true); ServerRpcContext *ctx = detag(got_tag); // The tag is a pointer to an RPC context to invoke - if ((*ctx)() == false) { + if (ctx->RunNextState() == false) { // this RPC context is done, so refresh it ctx->refresh(); } @@ -173,7 +173,7 @@ class AsyncQpsServerTest { public: ServerRpcContext() {} virtual ~ServerRpcContext(){}; - virtual bool operator()() = 0; // do next state, return false if all done + virtual bool RunNextState() = 0;// do next state, return false if all done virtual void refresh() = 0; // start this back at a clean state }; static void *tag(ServerRpcContext *func) { @@ -200,7 +200,7 @@ class AsyncQpsServerTest { AsyncQpsServerTest::tag(this)); } ~ServerRpcContextUnaryImpl() GRPC_OVERRIDE {} - bool operator()() GRPC_OVERRIDE { return (this->*next_state_)(); } + bool RunNextState() GRPC_OVERRIDE { return (this->*next_state_)(); } void refresh() GRPC_OVERRIDE { srv_ctx_ = ServerContext(); req_ = RequestType(); From 5b39f9a9fbfd74eeb0c2f9fd635ad61fc3856935 Mon Sep 17 00:00:00 2001 From: vjpai Date: Fri, 27 Feb 2015 09:33:00 -0800 Subject: [PATCH 11/71] refresh -> Reset --- test/cpp/qps/server_async.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index fc2459c1a50..c797d8af963 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -157,7 +157,7 @@ class AsyncQpsServerTest { // The tag is a pointer to an RPC context to invoke if (ctx->RunNextState() == false) { // this RPC context is done, so refresh it - ctx->refresh(); + ctx->Reset(); } } return; @@ -174,7 +174,7 @@ class AsyncQpsServerTest { ServerRpcContext() {} virtual ~ServerRpcContext(){}; virtual bool RunNextState() = 0;// do next state, return false if all done - virtual void refresh() = 0; // start this back at a clean state + virtual void Reset() = 0; // start this back at a clean state }; static void *tag(ServerRpcContext *func) { return reinterpret_cast(func); @@ -201,7 +201,7 @@ class AsyncQpsServerTest { } ~ServerRpcContextUnaryImpl() GRPC_OVERRIDE {} bool RunNextState() GRPC_OVERRIDE { return (this->*next_state_)(); } - void refresh() GRPC_OVERRIDE { + void Reset() GRPC_OVERRIDE { srv_ctx_ = ServerContext(); req_ = RequestType(); response_writer_ = From 6a4c4fabf359a8253c94eaeeb7e044973bcc5837 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 12:08:57 -0800 Subject: [PATCH 12/71] Added ruby tests to run_tests.py --- src/ruby/ext/grpc/extconf.rb | 16 ++++++++++++ tools/run_tests/build_ruby.sh | 47 +++++++++++++++++++++++++++++++++++ tools/run_tests/run_ruby.sh | 36 +++++++++++++++++++++++++++ tools/run_tests/run_tests.py | 12 +++++++++ 4 files changed, 111 insertions(+) create mode 100755 tools/run_tests/build_ruby.sh create mode 100755 tools/run_tests/run_ruby.sh diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb index 96c92e2be5d..483a31f60cc 100644 --- a/src/ruby/ext/grpc/extconf.rb +++ b/src/ruby/ext/grpc/extconf.rb @@ -32,6 +32,17 @@ require 'mkmf' LIBDIR = RbConfig::CONFIG['libdir'] INCLUDEDIR = RbConfig::CONFIG['includedir'] +if ENV.key? 'GRPC_ROOT' + GRPC_ROOT = ENV['GRPC_ROOT'] + if ENV.key? 'GRPC_LIB_DIR' + GRPC_LIB_DIR = ENV['GRPC_LIB_DIR'] + else + GRPC_LIB_DIR = 'libs/opt' + end +else + GRPC_ROOT = nil +end + HEADER_DIRS = [ # Search /opt/local (Mac source install) '/opt/local/include', @@ -54,6 +65,11 @@ LIB_DIRS = [ LIBDIR ] +unless GRPC_ROOT.nil? + HEADER_DIRS.unshift File.join(GRPC_ROOT, 'include') + LIB_DIRS.unshift File.join(GRPC_ROOT, GRPC_LIB_DIR) +end + def crash(msg) print(" extconf failure: #{msg}\n") exit 1 diff --git a/tools/run_tests/build_ruby.sh b/tools/run_tests/build_ruby.sh new file mode 100755 index 00000000000..53a69cf0798 --- /dev/null +++ b/tools/run_tests/build_ruby.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -ex + +CONFIG=${CONFIG:-opt} + +# change to grpc repo root +cd $(dirname $0)/../.. + +# tells npm install to look for files in that directory +export GRPC_ROOT=`pwd` +# tells npm install the subdirectory with library files +export GRPC_LIB_SUBDIR=libs/$CONFIG + +cd src/ruby + +bundle install +rake compile:grpc diff --git a/tools/run_tests/run_ruby.sh b/tools/run_tests/run_ruby.sh new file mode 100755 index 00000000000..b82ce52af38 --- /dev/null +++ b/tools/run_tests/run_ruby.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -ex + +# change to grpc repo root +cd $(dirname $0)/../../src/ruby + +rake diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 4e0ff85c59d..7b87c621ddd 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -136,6 +136,17 @@ class PythonLanguage(object): def build_steps(self): return [['tools/run_tests/build_python.sh']] +class RubyLanguage(object): + + def test_specs(self, config, travis): + return [config.job_spec('tools/run_tests/run_ruby.sh', None)] + + def make_targets(self): + return ['static_c'] + + def build_steps(self): + return [['tools/run_tests/build_ruby.sh']] + # different configurations we can run under _CONFIGS = { @@ -160,6 +171,7 @@ _LANGUAGES = { 'node': NodeLanguage(), 'php': PhpLanguage(), 'python': PythonLanguage(), + 'ruby': RubyLanguage() } # parse command line From cc2ef26288b860e43ea494b16ee4d9a35a15fb3f Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 12:51:14 -0800 Subject: [PATCH 13/71] Added ruby tests to travis file --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d770e7261f5..ad5fa22e39c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,5 +10,6 @@ script: - ./tools/run_tests/run_tests.py -l c -t -j 16 -c opt -s 2.0 - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt -s 2.0 - ./tools/run_tests/run_tests.py -l node -t -j 16 -c opt + - ./tools/run_tests/run_tests.py -l ruby -t -j 16 -c opt notifications: email: false From 7f86e953660b0a100eadc31ed538e66e037d475e Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 13:20:43 -0800 Subject: [PATCH 14/71] Added ruby version file for travis --- .ruby-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 00000000000..8f9174b4dd1 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.1.2 \ No newline at end of file From c921865c3956425732ab3bb27041729b95155153 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 14:08:46 -0800 Subject: [PATCH 15/71] Changed how ruby version is selected --- .ruby-version | 1 - tools/run_tests/build_ruby.sh | 2 ++ tools/run_tests/run_ruby.sh | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) delete mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 8f9174b4dd1..00000000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.1.2 \ No newline at end of file diff --git a/tools/run_tests/build_ruby.sh b/tools/run_tests/build_ruby.sh index 53a69cf0798..808570d8004 100755 --- a/tools/run_tests/build_ruby.sh +++ b/tools/run_tests/build_ruby.sh @@ -31,6 +31,8 @@ set -ex +rvm use 2.1.2 + CONFIG=${CONFIG:-opt} # change to grpc repo root diff --git a/tools/run_tests/run_ruby.sh b/tools/run_tests/run_ruby.sh index b82ce52af38..ef28c74398e 100755 --- a/tools/run_tests/run_ruby.sh +++ b/tools/run_tests/run_ruby.sh @@ -30,6 +30,8 @@ set -ex +rvm use 2.1.2 + # change to grpc repo root cd $(dirname $0)/../../src/ruby From ea14cfb4932335d4ccb7b7a612338157451d2f08 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 14:21:45 -0800 Subject: [PATCH 16/71] Further changed ruby version handling --- tools/run_tests/build_ruby.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/run_tests/build_ruby.sh b/tools/run_tests/build_ruby.sh index 808570d8004..e5eae05cb28 100755 --- a/tools/run_tests/build_ruby.sh +++ b/tools/run_tests/build_ruby.sh @@ -31,6 +31,7 @@ set -ex +rvm install 2.1.2 rvm use 2.1.2 CONFIG=${CONFIG:-opt} From bd3df5f5f11714d0d9e5221dd51d4aae6151fa00 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 27 Feb 2015 14:37:57 -0800 Subject: [PATCH 17/71] fix conditional inclusion of grpc_csharp_ext.dll --- src/csharp/Grpc.Core/Grpc.Core.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/csharp/Grpc.Core/Grpc.Core.csproj b/src/csharp/Grpc.Core/Grpc.Core.csproj index de742f99add..05d40d45a6e 100644 --- a/src/csharp/Grpc.Core/Grpc.Core.csproj +++ b/src/csharp/Grpc.Core/Grpc.Core.csproj @@ -67,9 +67,9 @@ - - + + PreserveNewest From 530c0b9b1fc6690423a457166c2ff7a71c35c050 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 14:38:34 -0800 Subject: [PATCH 18/71] Changed how ruby versions are selected again --- .travis.yml | 2 ++ tools/run_tests/build_ruby.sh | 3 --- tools/run_tests/run_ruby.sh | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad5fa22e39c..ba21f8cb912 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv script: + - rvm install 2.1.2 + - rvm use 2.1.2 - ./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 - make clean diff --git a/tools/run_tests/build_ruby.sh b/tools/run_tests/build_ruby.sh index e5eae05cb28..53a69cf0798 100755 --- a/tools/run_tests/build_ruby.sh +++ b/tools/run_tests/build_ruby.sh @@ -31,9 +31,6 @@ set -ex -rvm install 2.1.2 -rvm use 2.1.2 - CONFIG=${CONFIG:-opt} # change to grpc repo root diff --git a/tools/run_tests/run_ruby.sh b/tools/run_tests/run_ruby.sh index ef28c74398e..b82ce52af38 100755 --- a/tools/run_tests/run_ruby.sh +++ b/tools/run_tests/run_ruby.sh @@ -30,8 +30,6 @@ set -ex -rvm use 2.1.2 - # change to grpc repo root cd $(dirname $0)/../../src/ruby From 726b486b80b70cc5c49c163891d75f3c44b9468a Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 14:54:24 -0800 Subject: [PATCH 19/71] Updated bundler in travis.yml --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ba21f8cb912..efb27d09c2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,14 +4,14 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv script: - - rvm install 2.1.2 - rvm use 2.1.2 - - ./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 - - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 + - gem install bundler + - #./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 + - #./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 - make clean - - ./tools/run_tests/run_tests.py -l c -t -j 16 -c opt -s 2.0 - - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt -s 2.0 - - ./tools/run_tests/run_tests.py -l node -t -j 16 -c opt + - #./tools/run_tests/run_tests.py -l c -t -j 16 -c opt -s 2.0 + - #./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt -s 2.0 + - #./tools/run_tests/run_tests.py -l node -t -j 16 -c opt - ./tools/run_tests/run_tests.py -l ruby -t -j 16 -c opt notifications: email: false From 640e93f10be36f9d641918db148b5e57896588cf Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 14:59:37 -0800 Subject: [PATCH 20/71] Uncommented tests, switched to less specific version of ruby --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index efb27d09c2d..769d552f57e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,14 +4,14 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv script: - - rvm use 2.1.2 + - rvm use 2.1 - gem install bundler - - #./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 - - #./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 + - ./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 + - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 - make clean - - #./tools/run_tests/run_tests.py -l c -t -j 16 -c opt -s 2.0 - - #./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt -s 2.0 - - #./tools/run_tests/run_tests.py -l node -t -j 16 -c opt + - ./tools/run_tests/run_tests.py -l c -t -j 16 -c opt -s 2.0 + - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt -s 2.0 + - ./tools/run_tests/run_tests.py -l node -t -j 16 -c opt - ./tools/run_tests/run_tests.py -l ruby -t -j 16 -c opt notifications: email: false From 7e14dd817a17547a33c8730382fb3a28e831b008 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 15:06:03 -0800 Subject: [PATCH 21/71] Moved ruby version to environment varible --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 769d552f57e..c3b5efb4e4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,10 @@ before_install: - sudo add-apt-repository ppa:yjwong/gflags -y - sudo apt-get update -qq - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv +env: + - RUBY_VERSION=2.1 script: - - rvm use 2.1 + - rvm use $RUBY_VERSION - gem install bundler - ./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 From e1163283fb72c7bfc6f9697d94cacbbe617f0c3d Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 27 Feb 2015 23:08:28 +0000 Subject: [PATCH 22/71] Update suppressions file --- tools/tsan_suppressions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tsan_suppressions.txt b/tools/tsan_suppressions.txt index 23d57f9fd1f..3503c50ae8a 100644 --- a/tools/tsan_suppressions.txt +++ b/tools/tsan_suppressions.txt @@ -1,2 +1,3 @@ # OPENSSL_cleanse does racy access to a global race:OPENSSL_cleanse +race:cleanse_ctr From 5be9e3b4212e259e6ca93d860f3c9f86c49c7c7f Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 27 Feb 2015 23:14:35 +0000 Subject: [PATCH 23/71] Another update --- tools/tsan_suppressions.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/tsan_suppressions.txt b/tools/tsan_suppressions.txt index 3503c50ae8a..d3b04932f23 100644 --- a/tools/tsan_suppressions.txt +++ b/tools/tsan_suppressions.txt @@ -1,3 +1,5 @@ # OPENSSL_cleanse does racy access to a global race:OPENSSL_cleanse race:cleanse_ctr +race:ssleay_rand_status + From b47b89cedb40fd690529af59fc136998af7e430e Mon Sep 17 00:00:00 2001 From: Donna Dionne Date: Fri, 27 Feb 2015 15:21:14 -0800 Subject: [PATCH 24/71] Adding test command to test node auth compute engine credentials. --- tools/gce_setup/grpc_docker.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/gce_setup/grpc_docker.sh b/tools/gce_setup/grpc_docker.sh index df8605b58f5..02039261a35 100755 --- a/tools/gce_setup/grpc_docker.sh +++ b/tools/gce_setup/grpc_docker.sh @@ -1094,6 +1094,21 @@ grpc_cloud_prod_auth_service_account_creds_gen_node_cmd() { echo $the_cmd } +# constructs the full dockerized node gce auth interop test cmd. +# +# call-seq: +# flags= .... # generic flags to include the command +# cmd=$($grpc_gen_test_cmd $flags) +grpc_cloud_prod_auth_compute_engine_creds_gen_node_cmd() { + local env_flag="-e SSL_CERT_FILE=/cacerts/roots.pem " + local cmd_prefix="sudo docker run $env_flag grpc/node"; + local test_script="/usr/bin/nodejs /var/local/git/grpc/src/node/interop/interop_client.js --use_tls=true"; + local gfe_flags=$(_grpc_prod_gfe_flags) + local added_gfe_flags=$(_grpc_gce_test_flags) + local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; + echo $the_cmd +} + # constructs the full dockerized cpp interop test cmd. # # call-seq: From 239916079600f40eb035cac272c2a7211c75b77a Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 15:39:03 -0800 Subject: [PATCH 25/71] Switched to test matrix --- .travis.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index c3b5efb4e4a..17957584b76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,16 +4,18 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv env: - - RUBY_VERSION=2.1 + global: + - RUBY_VERSION=2.1 + matrix: + - CONFIG=dbg TEST=c + - CONFIG=dbg TEST=c++ + - CONFIG=opt TEST=c + - CONFIG=opt TEST=c++ + - CONFIG=opt TEST=node + - CONFIG=opt TEST=ruby script: - rvm use $RUBY_VERSION - gem install bundler - - ./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg -s 2.0 - - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg -s 2.0 - - make clean - - ./tools/run_tests/run_tests.py -l c -t -j 16 -c opt -s 2.0 - - ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt -s 2.0 - - ./tools/run_tests/run_tests.py -l node -t -j 16 -c opt - - ./tools/run_tests/run_tests.py -l ruby -t -j 16 -c opt + - ./tools/run_tests/run_tests.py -l $TEST -t -j 16 -c $CONFIG -s 2.0 notifications: - email: false + email: false \ No newline at end of file From ffc442c96126abde3355a7ac4c50fe326399d474 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 15:46:13 -0800 Subject: [PATCH 26/71] Added multiple ruby version tests --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 17957584b76..71e60a751b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ env: - CONFIG=opt TEST=c - CONFIG=opt TEST=c++ - CONFIG=opt TEST=node + - CONFIG=opt TEST=ruby RUBY_VERSION=2.1.0 - CONFIG=opt TEST=ruby script: - rvm use $RUBY_VERSION From af08efe29f443da768f291248dde716977685006 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 27 Feb 2015 23:53:45 +0000 Subject: [PATCH 27/71] This looks more serious --- tools/tsan_suppressions.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/tsan_suppressions.txt b/tools/tsan_suppressions.txt index d3b04932f23..fb7b85cbea5 100644 --- a/tools/tsan_suppressions.txt +++ b/tools/tsan_suppressions.txt @@ -1,5 +1,4 @@ # OPENSSL_cleanse does racy access to a global race:OPENSSL_cleanse race:cleanse_ctr -race:ssleay_rand_status From 0ee5fb8754afc44ee341ff3b737bcfe544ba390c Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 15:54:33 -0800 Subject: [PATCH 28/71] Removed test with non-included version of ruby --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 71e60a751b3..17957584b76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ env: - CONFIG=opt TEST=c - CONFIG=opt TEST=c++ - CONFIG=opt TEST=node - - CONFIG=opt TEST=ruby RUBY_VERSION=2.1.0 - CONFIG=opt TEST=ruby script: - rvm use $RUBY_VERSION From f26582d5476a9a91a6ab646d755dcc96dcee33e4 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 27 Feb 2015 16:01:13 -0800 Subject: [PATCH 29/71] Add asan/tsan tests --- .travis.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 17957584b76..17bd882e7c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,19 @@ language: cpp before_install: - sudo add-apt-repository ppa:yjwong/gflags -y + - sudo add-apt-repository ppa:h-rayflood/llvm -y - sudo apt-get update -qq - - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv + - sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv clang-3.5 env: global: - RUBY_VERSION=2.1 matrix: - CONFIG=dbg TEST=c - CONFIG=dbg TEST=c++ + - CONFIG=asan TEST=c + - CONFIG=asan TEST=c++ + - CONFIG=tsan TEST=c + - CONFIG=tsan TEST=c++ - CONFIG=opt TEST=c - CONFIG=opt TEST=c++ - CONFIG=opt TEST=node @@ -16,6 +21,6 @@ env: script: - rvm use $RUBY_VERSION - gem install bundler - - ./tools/run_tests/run_tests.py -l $TEST -t -j 16 -c $CONFIG -s 2.0 + - ./tools/run_tests/run_tests.py -l $TEST -t -j 16 -c $CONFIG -s 4.0 notifications: email: false \ No newline at end of file From b7063f1416cdff1a9d44e1622ab48dbaddcdd66a Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 16:12:24 -0800 Subject: [PATCH 30/71] Added python tests to .travis.yml --- .travis.yml | 8 ++------ tools/run_tests/build_python.sh | 2 -- tools/run_tests/run_tests.py | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 17957584b76..47ab5e888dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,13 +7,9 @@ env: global: - RUBY_VERSION=2.1 matrix: - - CONFIG=dbg TEST=c - - CONFIG=dbg TEST=c++ - - CONFIG=opt TEST=c - - CONFIG=opt TEST=c++ - - CONFIG=opt TEST=node - - CONFIG=opt TEST=ruby + - CONFIG=opt TEST=python script: + - which python - rvm use $RUBY_VERSION - gem install bundler - ./tools/run_tests/run_tests.py -l $TEST -t -j 16 -c $CONFIG -s 2.0 diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh index 5a3c720ba56..f575923c22d 100755 --- a/tools/run_tests/build_python.sh +++ b/tools/run_tests/build_python.sh @@ -33,8 +33,6 @@ set -ex # change to grpc repo root cd $(dirname $0)/../.. -make -j6 - root=`pwd` virtualenv python2.7_virtual_environment source python2.7_virtual_environment/bin/activate diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index b7370327ddd..e949670b8c9 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -135,7 +135,7 @@ class PythonLanguage(object): return [config.job_spec('tools/run_tests/run_python.sh', None)] def make_targets(self): - return[] + return ['static_c'] def build_steps(self): return [['tools/run_tests/build_python.sh']] From f5065c5b65035eb0999877391cf8dfd634ad4a5f Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 27 Feb 2015 16:17:39 -0800 Subject: [PATCH 31/71] Enable asan for C core Also speed up a test, and disable some rarely touched but long running tests --- .travis.yml | 3 --- build.json | 6 ++++-- templates/Makefile.template | 2 +- test/core/transport/chttp2/stream_map_test.c | 2 +- tools/run_tests/tests.json | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 17bd882e7c0..68097a8182b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,6 @@ env: - CONFIG=dbg TEST=c - CONFIG=dbg TEST=c++ - CONFIG=asan TEST=c - - CONFIG=asan TEST=c++ - - CONFIG=tsan TEST=c - - CONFIG=tsan TEST=c++ - CONFIG=opt TEST=c - CONFIG=opt TEST=c++ - CONFIG=opt TEST=node diff --git a/build.json b/build.json index 2079b2cce79..ff4c7fac06c 100644 --- a/build.json +++ b/build.json @@ -582,7 +582,8 @@ "grpc", "gpr_test_util", "gpr" - ] + ], + "flaky": true }, { "name": "census_statistics_multiple_writers_test", @@ -638,7 +639,8 @@ "grpc", "gpr_test_util", "gpr" - ] + ], + "flaky": true }, { "name": "census_stats_store_test", diff --git a/templates/Makefile.template b/templates/Makefile.template index 0413f19e44e..2e50e5d41ec 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -196,7 +196,7 @@ DEFINES += $(DEFINES_$(CONFIG)) INSTALL_PREFIX=\"$(prefix)\" LDFLAGS += $(LDFLAGS_$(CONFIG)) ifdef EXTRA_DEFINES -DEFINES += EXTRA_DEFINES +DEFINES += $(EXTRA_DEFINES) endif CFLAGS += -std=c89 -pedantic diff --git a/test/core/transport/chttp2/stream_map_test.c b/test/core/transport/chttp2/stream_map_test.c index 6b91bdf14fd..d678e0af73f 100644 --- a/test/core/transport/chttp2/stream_map_test.c +++ b/test/core/transport/chttp2/stream_map_test.c @@ -213,7 +213,7 @@ int main(int argc, char **argv) { test_empty_find(); test_double_deletion(); - while (n < 10000000) { + while (n < 100000) { test_basic_add_find(n); test_delete_evens_sweep(n); test_delete_evens_incremental(n); diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index f84bd9dac9c..772856b9c7f 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -32,7 +32,7 @@ "name": "census_hash_table_test" }, { - "flaky": false, + "flaky": true, "language": "c", "name": "census_statistics_multiple_writers_circular_buffer_test" }, @@ -52,7 +52,7 @@ "name": "census_statistics_quick_test" }, { - "flaky": false, + "flaky": true, "language": "c", "name": "census_statistics_small_log_test" }, From 7d33c2a90f109717f54f6c5cf653b800728fe92a Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 16:33:47 -0800 Subject: [PATCH 32/71] Added log line --- tools/run_tests/run_python.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index 06ddb8e41ac..208ff7d0429 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -36,6 +36,7 @@ cd $(dirname $0)/../.. root=`pwd` export LD_LIBRARY_PATH=$root/libs/opt source python2.7_virtual_environment/bin/activate +which python2.7 # TODO(issue 215): Properly itemize these in run_tests.py so that they can be parallelized. # TODO(atash): Enable dynamic unused port discovery for this test. python2.7 -B test/compiler/python_plugin_test.py --build_mode=opt From bf01d4f69cedd80ed5668c7f41540d7b5365134c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 27 Feb 2015 16:35:21 -0800 Subject: [PATCH 33/71] Ignore the ASAN bits, get the fixes in --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 68097a8182b..b51d2c0d821 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ env: matrix: - CONFIG=dbg TEST=c - CONFIG=dbg TEST=c++ - - CONFIG=asan TEST=c - CONFIG=opt TEST=c - CONFIG=opt TEST=c++ - CONFIG=opt TEST=node From d1d1626263244b3e4b530088b1fc23c3d6b369e6 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 27 Feb 2015 16:44:32 -0800 Subject: [PATCH 34/71] Added another log line --- tools/run_tests/build_python.sh | 2 ++ tools/run_tests/run_python.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh index f575923c22d..56761b802e0 100755 --- a/tools/run_tests/build_python.sh +++ b/tools/run_tests/build_python.sh @@ -36,5 +36,7 @@ cd $(dirname $0)/../.. root=`pwd` virtualenv python2.7_virtual_environment source python2.7_virtual_environment/bin/activate +echo $PATH +which pip pip install enum34==1.0.4 futures==2.2.0 protobuf==3.0.0-alpha-1 CFLAGS=-I$root/include LDFLAGS=-L$root/libs/opt pip install src/python/src diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index 208ff7d0429..f7438f6207f 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -36,6 +36,7 @@ cd $(dirname $0)/../.. root=`pwd` export LD_LIBRARY_PATH=$root/libs/opt source python2.7_virtual_environment/bin/activate +echo $PATH which python2.7 # TODO(issue 215): Properly itemize these in run_tests.py so that they can be parallelized. # TODO(atash): Enable dynamic unused port discovery for this test. From 45b0bc4bec5d0b701dbe5ae98542473ef3eaa4e4 Mon Sep 17 00:00:00 2001 From: vjpai Date: Fri, 27 Feb 2015 16:54:17 -0800 Subject: [PATCH 35/71] Use typedefs to avoid triply-nested function templates --- test/cpp/qps/client_async.cc | 19 +++++++++++++------ test/cpp/qps/server_async.cc | 29 +++++++++++++---------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index 9ea9cfe8b9b..0bd0f176a86 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -105,17 +105,24 @@ class ClientRpcContext { } virtual void report_stats(gpr_histogram *hist) = 0; }; + +template +using StartMethod = std::function< + std::unique_ptr>(TestService::Stub *, grpc::ClientContext *, + const RequestType &, void *)> ; + +template using DoneMethod = + std::function; + template class ClientRpcContextUnaryImpl : public ClientRpcContext { public: ClientRpcContextUnaryImpl( TestService::Stub *stub, const RequestType &req, - std::function< - std::unique_ptr>( - TestService::Stub *, grpc::ClientContext *, const RequestType &, - void *)> start_req, - std::function on_done) + StartMethod start_req, + DoneMethod on_done) : context_(), stub_(stub), req_(req), @@ -150,7 +157,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { RequestType req_; ResponseType response_; bool (ClientRpcContextUnaryImpl::*next_state_)(); - std::function callback_; + DoneMethod callback_; grpc::Status status_; double start_; std::unique_ptr> diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index c797d8af963..3d6379b73f5 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -183,15 +183,19 @@ class AsyncQpsServerTest { return reinterpret_cast(tag); } + template + using RequestMethod = std::function *, + void *)>; + template using InvokeMethod = + std::function; + template class ServerRpcContextUnaryImpl : public ServerRpcContext { public: ServerRpcContextUnaryImpl( - std::function *, - void *)> request_method, - std::function - invoke_method) + RequestMethod request_method, + InvokeMethod invoke_method) : next_state_(&ServerRpcContextUnaryImpl::invoker), request_method_(request_method), invoke_method_(invoke_method), @@ -229,11 +233,8 @@ class AsyncQpsServerTest { ServerContext srv_ctx_; RequestType req_; bool (ServerRpcContextUnaryImpl::*next_state_)(); - std::function *, void *)> - request_method_; - std::function - invoke_method_; + RequestMethod request_method_; + InvokeMethod invoke_method_; grpc::ServerAsyncResponseWriter response_writer_; }; @@ -261,12 +262,8 @@ class AsyncQpsServerTest { CompletionQueue srv_cq_; TestService::AsyncService async_service_; std::unique_ptr server_; - std::function *, void *)> - request_unary_; - std::function *, void *)> - request_stats_; + RequestMethod request_unary_; + RequestMethod request_stats_; std::forward_list contexts_; }; From 2f02bb051f0c1b907b39763f6bcae0ced9571c91 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 28 Feb 2015 05:58:22 +0100 Subject: [PATCH 36/71] Further cleanup. --- tools/dockerfile/grpc_build_deb/Dockerfile | 2 +- tools/dockerfile/grpc_cxx/Dockerfile | 2 +- tools/dockerfile/grpc_go/Dockerfile | 15 --------------- tools/dockerfile/grpc_java/Dockerfile | 2 +- tools/dockerfile/grpc_java_base/Dockerfile | 8 +------- tools/dockerfile/grpc_node_base/Dockerfile | 2 +- tools/dockerfile/grpc_php_base/Dockerfile | 4 ++-- tools/dockerfile/grpc_python_base/Dockerfile | 2 +- tools/dockerfile/grpc_ruby_base/Dockerfile | 2 +- 9 files changed, 9 insertions(+), 30 deletions(-) diff --git a/tools/dockerfile/grpc_build_deb/Dockerfile b/tools/dockerfile/grpc_build_deb/Dockerfile index 6cba74e4c63..24ffc7379cf 100644 --- a/tools/dockerfile/grpc_build_deb/Dockerfile +++ b/tools/dockerfile/grpc_build_deb/Dockerfile @@ -34,7 +34,7 @@ FROM grpc/base RUN apt-get update && apt-get install -y lintian # Get the source from GitHub -RUN git clone git@github.com:grpc/grpc.git /var/local/git/grpc +RUN git clone https://github.com/grpc/grpc.git /var/local/git/grpc RUN cd /var/local/git/grpc && \ git pull --recurse-submodules && \ git submodule update --init --recursive diff --git a/tools/dockerfile/grpc_cxx/Dockerfile b/tools/dockerfile/grpc_cxx/Dockerfile index 18c67324964..ac09e25e404 100644 --- a/tools/dockerfile/grpc_cxx/Dockerfile +++ b/tools/dockerfile/grpc_cxx/Dockerfile @@ -33,7 +33,7 @@ FROM grpc/base RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev # Get the source from GitHub -RUN git clone git@github.com:grpc/grpc.git /var/local/git/grpc +RUN git clone https://github.com/grpc/grpc.git /var/local/git/grpc RUN cd /var/local/git/grpc && \ git pull --recurse-submodules && \ git submodule update --init --recursive diff --git a/tools/dockerfile/grpc_go/Dockerfile b/tools/dockerfile/grpc_go/Dockerfile index e1671eaee14..06bb3e2d5e7 100644 --- a/tools/dockerfile/grpc_go/Dockerfile +++ b/tools/dockerfile/grpc_go/Dockerfile @@ -30,21 +30,6 @@ # Dockerfile for gRPC Go FROM golang:1.4 -# Install SSH to that Go source can be pulled securely. -RUN apt-get update && apt-get install -y ssh - -# Install a GitHub SSH service credential that gives access to the GitHub repo while it's private -# -# TODO: remove this once the repo is public -ADD .ssh .ssh -RUN chmod 600 /.ssh/github.rsa -RUN mkdir -p $HOME/.ssh && echo 'Host github.com' > $HOME/.ssh/config -RUN echo " IdentityFile /.ssh/github.rsa" >> $HOME/.ssh/config -RUN echo 'StrictHostKeyChecking no' >> $HOME/.ssh/config - -# Force go get to use the GitHub ssh url instead of https, and use the SSH creds -RUN git config --global url."git@github.com:".insteadOf "https://github.com/" - # Get the source from GitHub RUN go get google.golang.org/grpc diff --git a/tools/dockerfile/grpc_java/Dockerfile b/tools/dockerfile/grpc_java/Dockerfile index affbec9b20f..6b2612b9b29 100644 --- a/tools/dockerfile/grpc_java/Dockerfile +++ b/tools/dockerfile/grpc_java/Dockerfile @@ -30,7 +30,7 @@ # Dockerfile for the gRPC Java dev image FROM grpc/java_base -RUN git clone --recursive --depth 1 git@github.com:grpc/grpc-java.git /var/local/git/grpc-java +RUN git clone --recursive --depth 1 https://github.com/grpc/grpc-java.git /var/local/git/grpc-java RUN cd /var/local/git/grpc-java/lib/netty && \ mvn -pl codec-http2 -am -DskipTests install clean RUN cd /var/local/git/grpc-java && \ diff --git a/tools/dockerfile/grpc_java_base/Dockerfile b/tools/dockerfile/grpc_java_base/Dockerfile index 3eebc2bb93f..2ee0a623c7d 100644 --- a/tools/dockerfile/grpc_java_base/Dockerfile +++ b/tools/dockerfile/grpc_java_base/Dockerfile @@ -61,15 +61,9 @@ RUN wget -O - https://github.com/google/protobuf/archive/v3.0.0-alpha-2.tar.gz | cd javanano && mvn install && cd .. && \ rm -r "$(pwd)" -# Install a GitHub SSH service credential that gives access to the GitHub repo while it's private -# TODO: remove this once the repo is public -COPY .ssh/github.rsa /root/.ssh/id_rsa -RUN chmod 600 /root/.ssh/id_rsa -RUN echo 'Host github.com\nStrictHostKeyChecking no' > /root/.ssh/config - # Trigger download of as many Maven and Gradle artifacts as possible. We don't build grpc-java # because we don't want to install netty -RUN git clone --recursive --depth 1 git@github.com:grpc/grpc-java.git && \ +RUN git clone --recursive --depth 1 https://github.com/grpc/grpc-java.git && \ cd grpc-java/lib/netty && \ mvn -pl codec-http2 -am -DskipTests verify && \ cd ../.. && \ diff --git a/tools/dockerfile/grpc_node_base/Dockerfile b/tools/dockerfile/grpc_node_base/Dockerfile index 20ed4cf7be2..1f3a2362e99 100644 --- a/tools/dockerfile/grpc_node_base/Dockerfile +++ b/tools/dockerfile/grpc_node_base/Dockerfile @@ -39,7 +39,7 @@ RUN apt-get update && apt-get install -y nodejs nodejs-legacy RUN npm install -g node-gyp # Get the source from GitHub, this gets the protobuf library as well -RUN git clone git@github.com:grpc/grpc.git /var/local/git/grpc +RUN git clone https://github.com/grpc/grpc.git /var/local/git/grpc RUN cd /var/local/git/grpc && \ git pull --recurse-submodules && \ git submodule update --init --recursive diff --git a/tools/dockerfile/grpc_php_base/Dockerfile b/tools/dockerfile/grpc_php_base/Dockerfile index 49f5da846d7..cc874fd7c55 100644 --- a/tools/dockerfile/grpc_php_base/Dockerfile +++ b/tools/dockerfile/grpc_php_base/Dockerfile @@ -76,7 +76,7 @@ RUN cd /var/local \ # Download the patched PHP protobuf so that PHP gRPC clients can be generated # from proto3 schemas. -RUN git clone git@github.com:murgatroid99/Protobuf-PHP.git /var/local/git/protobuf-php +RUN git clone https://github.com/murgatroid99/Protobuf-PHP.git /var/local/git/protobuf-php # Install ruby (via RVM) as ruby tools are dependencies for building Protobuf # PHP extensions. @@ -91,7 +91,7 @@ ENV PATH /usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/s RUN rvm all do gem install ronn rake # Get the source from GitHub, this gets the protobuf library as well -RUN git clone git@github.com:grpc/grpc.git /var/local/git/grpc +RUN git clone https://github.com/grpc/grpc.git /var/local/git/grpc RUN cd /var/local/git/grpc && \ git pull --recurse-submodules && \ git submodule update --init --recursive diff --git a/tools/dockerfile/grpc_python_base/Dockerfile b/tools/dockerfile/grpc_python_base/Dockerfile index 18dd40a05a3..0d45f402429 100644 --- a/tools/dockerfile/grpc_python_base/Dockerfile +++ b/tools/dockerfile/grpc_python_base/Dockerfile @@ -46,4 +46,4 @@ RUN apt-get update && apt-get install -y \ RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0-alpha-1 # Get the GRPC source from GitHub -RUN git clone --recursive git@github.com:grpc/grpc.git /var/local/git/grpc +RUN git clone --recursive https://github.com/grpc/grpc.git /var/local/git/grpc diff --git a/tools/dockerfile/grpc_ruby_base/Dockerfile b/tools/dockerfile/grpc_ruby_base/Dockerfile index f3c7289943d..d58eeaaf709 100644 --- a/tools/dockerfile/grpc_ruby_base/Dockerfile +++ b/tools/dockerfile/grpc_ruby_base/Dockerfile @@ -72,7 +72,7 @@ RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc" RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" # Get the source from GitHub -RUN git clone git@github.com:grpc/grpc.git /var/local/git/grpc +RUN git clone https://github.com/grpc/grpc.git /var/local/git/grpc RUN cd /var/local/git/grpc && \ git pull --recurse-submodules && \ git submodule update --init --recursive From 0e46e349ab0c9f0485698c2b51f856aa7ef7a4a7 Mon Sep 17 00:00:00 2001 From: Johan Euphrosine Date: Fri, 27 Feb 2015 21:32:47 -0800 Subject: [PATCH 37/71] dockerfiles/go: go install from GOPATH and remove bash from CMD --- tools/dockerfile/grpc_go/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/dockerfile/grpc_go/Dockerfile b/tools/dockerfile/grpc_go/Dockerfile index e1671eaee14..4ee985ccef8 100644 --- a/tools/dockerfile/grpc_go/Dockerfile +++ b/tools/dockerfile/grpc_go/Dockerfile @@ -52,8 +52,8 @@ RUN go get google.golang.org/grpc ADD service_account service_account # Build the interop client and server -RUN cd src/google.golang.org/grpc/interop/client && go install -RUN cd src/google.golang.org/grpc/interop/server && go install +RUN go install google.golang.org/grpc/interop/client +RUN go install google.golang.org/grpc/interop/server # Specify the default command such that the interop server runs on its known testing port -CMD ["/bin/bash", "-c", "cd src/google.golang.org/grpc/interop/server && go run server.go --use_tls=true --port=8020"] +CMD ["server", "--use_tls=true", "--port=8020"] From 4e1e1bc28e9c95333a730889bc1a09581731ae2b Mon Sep 17 00:00:00 2001 From: vjpai Date: Fri, 27 Feb 2015 23:47:12 -0800 Subject: [PATCH 38/71] Revert "Use typedefs to avoid triply-nested function templates" This reverts commit 45b0bc4bec5d0b701dbe5ae98542473ef3eaa4e4. This revert is being done because the compilers on Travis don't understand the C++11 template/using syntax. --- test/cpp/qps/client_async.cc | 19 ++++++------------- test/cpp/qps/server_async.cc | 29 ++++++++++++++++------------- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index 0bd0f176a86..9ea9cfe8b9b 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -105,24 +105,17 @@ class ClientRpcContext { } virtual void report_stats(gpr_histogram *hist) = 0; }; - -template -using StartMethod = std::function< - std::unique_ptr>(TestService::Stub *, grpc::ClientContext *, - const RequestType &, void *)> ; - -template using DoneMethod = - std::function; - template class ClientRpcContextUnaryImpl : public ClientRpcContext { public: ClientRpcContextUnaryImpl( TestService::Stub *stub, const RequestType &req, - StartMethod start_req, - DoneMethod on_done) + std::function< + std::unique_ptr>( + TestService::Stub *, grpc::ClientContext *, const RequestType &, + void *)> start_req, + std::function on_done) : context_(), stub_(stub), req_(req), @@ -157,7 +150,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { RequestType req_; ResponseType response_; bool (ClientRpcContextUnaryImpl::*next_state_)(); - DoneMethod callback_; + std::function callback_; grpc::Status status_; double start_; std::unique_ptr> diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index 3d6379b73f5..c797d8af963 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -183,19 +183,15 @@ class AsyncQpsServerTest { return reinterpret_cast(tag); } - template - using RequestMethod = std::function *, - void *)>; - template using InvokeMethod = - std::function; - template class ServerRpcContextUnaryImpl : public ServerRpcContext { public: ServerRpcContextUnaryImpl( - RequestMethod request_method, - InvokeMethod invoke_method) + std::function *, + void *)> request_method, + std::function + invoke_method) : next_state_(&ServerRpcContextUnaryImpl::invoker), request_method_(request_method), invoke_method_(invoke_method), @@ -233,8 +229,11 @@ class AsyncQpsServerTest { ServerContext srv_ctx_; RequestType req_; bool (ServerRpcContextUnaryImpl::*next_state_)(); - RequestMethod request_method_; - InvokeMethod invoke_method_; + std::function *, void *)> + request_method_; + std::function + invoke_method_; grpc::ServerAsyncResponseWriter response_writer_; }; @@ -262,8 +261,12 @@ class AsyncQpsServerTest { CompletionQueue srv_cq_; TestService::AsyncService async_service_; std::unique_ptr server_; - RequestMethod request_unary_; - RequestMethod request_stats_; + std::function *, void *)> + request_unary_; + std::function *, void *)> + request_stats_; std::forward_list contexts_; }; From c24eb22860d5c3250cba1573ca86c003dd144abe Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Sat, 28 Feb 2015 17:09:48 +0000 Subject: [PATCH 39/71] Suppressing a data race in OpenSSL This race is (probably) legit on some platforms, but (likely) safe on Intel at least. For now, since it's a little outside our control, I'm suppressing it to focus on any remaining races in our code. --- tools/tsan_suppressions.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/tsan_suppressions.txt b/tools/tsan_suppressions.txt index fb7b85cbea5..65e7e2ec4b3 100644 --- a/tools/tsan_suppressions.txt +++ b/tools/tsan_suppressions.txt @@ -1,4 +1,8 @@ # OPENSSL_cleanse does racy access to a global race:OPENSSL_cleanse race:cleanse_ctr +# these are legitimate races in OpenSSL, and it appears those folks are looking at it +# https://www.mail-archive.com/openssl-dev@openssl.org/msg09019.html +race:ssleay_rand_add +race:ssleay_rand_bytes From 1ff52d5278b625ede3d008f053b652fa455eaf6b Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sun, 1 Mar 2015 05:24:36 +0100 Subject: [PATCH 40/71] Guard headers tool. --- examples/pubsub/publisher.h | 6 +- examples/pubsub/subscriber.h | 6 +- include/grpc++/async_unary_call.h | 6 +- include/grpc++/channel_arguments.h | 6 +- include/grpc++/channel_interface.h | 6 +- include/grpc++/client_context.h | 6 +- include/grpc++/completion_queue.h | 6 +- include/grpc++/config.h | 6 +- include/grpc++/create_channel.h | 6 +- include/grpc++/credentials.h | 6 +- include/grpc++/impl/call.h | 6 +- include/grpc++/impl/client_unary_call.h | 6 +- include/grpc++/impl/internal_stub.h | 6 +- include/grpc++/impl/rpc_method.h | 6 +- include/grpc++/impl/rpc_service_method.h | 6 +- include/grpc++/impl/service_type.h | 6 +- include/grpc++/server.h | 6 +- include/grpc++/server_builder.h | 6 +- include/grpc++/server_context.h | 6 +- include/grpc++/server_credentials.h | 6 +- include/grpc++/status.h | 6 +- include/grpc++/status_code_enum.h | 6 +- include/grpc++/stream.h | 6 +- include/grpc++/thread_pool_interface.h | 6 +- include/grpc/byte_buffer.h | 6 +- include/grpc/byte_buffer_reader.h | 6 +- include/grpc/grpc.h | 6 +- include/grpc/grpc_http.h | 6 +- include/grpc/grpc_security.h | 6 +- include/grpc/status.h | 6 +- include/grpc/support/alloc.h | 6 +- include/grpc/support/atm.h | 6 +- include/grpc/support/atm_gcc_atomic.h | 6 +- include/grpc/support/atm_gcc_sync.h | 6 +- include/grpc/support/atm_win32.h | 6 +- include/grpc/support/cancellable_platform.h | 6 +- include/grpc/support/cmdline.h | 6 +- include/grpc/support/cpu.h | 6 +- include/grpc/support/histogram.h | 6 +- include/grpc/support/host_port.h | 6 +- include/grpc/support/log.h | 6 +- include/grpc/support/log_win32.h | 6 +- include/grpc/support/port_platform.h | 6 +- include/grpc/support/slice.h | 6 +- include/grpc/support/slice_buffer.h | 6 +- include/grpc/support/sync.h | 6 +- include/grpc/support/sync_generic.h | 6 +- include/grpc/support/sync_posix.h | 6 +- include/grpc/support/sync_win32.h | 6 +- include/grpc/support/thd.h | 6 +- include/grpc/support/time.h | 6 +- include/grpc/support/useful.h | 6 +- src/compiler/cpp_generator.h | 6 +- src/compiler/cpp_generator_helpers.h | 6 +- src/compiler/generator_helpers.h | 6 +- src/compiler/python_generator.h | 6 +- src/compiler/ruby_generator.h | 6 +- src/compiler/ruby_generator_helpers-inl.h | 6 +- src/compiler/ruby_generator_map-inl.h | 6 +- src/compiler/ruby_generator_string-inl.h | 6 +- src/core/channel/census_filter.h | 6 +- src/core/channel/channel_args.h | 6 +- src/core/channel/channel_stack.h | 6 +- src/core/channel/child_channel.h | 6 +- src/core/channel/client_channel.h | 6 +- src/core/channel/client_setup.h | 6 +- src/core/channel/connected_channel.h | 6 +- src/core/channel/http_client_filter.h | 6 +- src/core/channel/http_filter.h | 6 +- src/core/channel/http_server_filter.h | 6 +- src/core/channel/metadata_buffer.h | 6 +- src/core/channel/noop_filter.h | 6 +- src/core/compression/algorithm.h | 6 +- src/core/compression/message_compress.h | 6 +- src/core/debug/trace.h | 7 +- src/core/httpcli/format_request.h | 6 +- src/core/httpcli/httpcli.h | 6 +- src/core/httpcli/httpcli_security_context.h | 6 +- src/core/httpcli/parser.h | 6 +- src/core/iomgr/alarm.h | 6 +- src/core/iomgr/alarm_heap.h | 6 +- src/core/iomgr/alarm_internal.h | 6 +- src/core/iomgr/endpoint.h | 6 +- src/core/iomgr/endpoint_pair.h | 6 +- src/core/iomgr/fd_posix.h | 6 +- src/core/iomgr/iocp_windows.h | 6 +- src/core/iomgr/iomgr.h | 6 +- src/core/iomgr/iomgr_internal.h | 6 +- src/core/iomgr/iomgr_posix.h | 6 +- src/core/iomgr/pollset.h | 6 +- src/core/iomgr/pollset_kick.h | 6 +- src/core/iomgr/pollset_kick_posix.h | 6 +- src/core/iomgr/pollset_kick_windows.h | 6 +- src/core/iomgr/pollset_posix.h | 6 +- src/core/iomgr/pollset_windows.h | 6 +- src/core/iomgr/resolve_address.h | 6 +- src/core/iomgr/sockaddr.h | 6 +- src/core/iomgr/sockaddr_posix.h | 6 +- src/core/iomgr/sockaddr_utils.h | 6 +- src/core/iomgr/sockaddr_win32.h | 6 +- src/core/iomgr/socket_utils_posix.h | 6 +- src/core/iomgr/socket_windows.h | 6 +- src/core/iomgr/tcp_client.h | 6 +- src/core/iomgr/tcp_posix.h | 6 +- src/core/iomgr/tcp_server.h | 6 +- src/core/iomgr/tcp_windows.h | 6 +- src/core/iomgr/time_averaged_stats.h | 6 +- src/core/iomgr/wakeup_fd_pipe.h | 6 +- src/core/iomgr/wakeup_fd_posix.h | 6 +- src/core/json/json.h | 6 +- src/core/json/json_common.h | 6 +- src/core/json/json_reader.h | 6 +- src/core/json/json_writer.h | 6 +- src/core/security/auth.h | 6 +- src/core/security/base64.h | 6 +- src/core/security/credentials.h | 6 +- src/core/security/json_token.h | 6 +- src/core/security/secure_endpoint.h | 6 +- src/core/security/secure_transport_setup.h | 6 +- src/core/security/security_context.h | 6 +- src/core/statistics/census_interface.h | 6 +- src/core/statistics/census_log.h | 6 +- src/core/statistics/census_rpc_stats.h | 6 +- src/core/statistics/census_tracing.h | 6 +- src/core/statistics/hash_table.h | 6 +- src/core/statistics/window_stats.h | 6 +- src/core/support/env.h | 6 +- src/core/support/file.h | 6 +- src/core/support/murmur_hash.h | 6 +- src/core/support/string.h | 6 +- src/core/support/string_win32.h | 6 +- src/core/support/thd_internal.h | 6 +- src/core/surface/byte_buffer_queue.h | 6 +- src/core/surface/call.h | 6 +- src/core/surface/channel.h | 6 +- src/core/surface/client.h | 6 +- src/core/surface/completion_queue.h | 6 +- src/core/surface/event_string.h | 6 +- src/core/surface/lame_client.h | 6 +- src/core/surface/server.h | 6 +- src/core/surface/surface_trace.h | 6 +- src/core/transport/chttp2/alpn.h | 6 +- src/core/transport/chttp2/bin_encoder.h | 6 +- src/core/transport/chttp2/frame.h | 6 +- src/core/transport/chttp2/frame_data.h | 6 +- src/core/transport/chttp2/frame_goaway.h | 6 +- src/core/transport/chttp2/frame_ping.h | 6 +- src/core/transport/chttp2/frame_rst_stream.h | 6 +- src/core/transport/chttp2/frame_settings.h | 6 +- .../transport/chttp2/frame_window_update.h | 6 +- src/core/transport/chttp2/hpack_parser.h | 6 +- src/core/transport/chttp2/hpack_table.h | 6 +- src/core/transport/chttp2/http2_errors.h | 6 +- src/core/transport/chttp2/huffsyms.h | 6 +- src/core/transport/chttp2/status_conversion.h | 6 +- src/core/transport/chttp2/stream_encoder.h | 6 +- src/core/transport/chttp2/stream_map.h | 6 +- src/core/transport/chttp2/timeout_encoding.h | 6 +- src/core/transport/chttp2/varint.h | 6 +- src/core/transport/chttp2_transport.h | 6 +- src/core/transport/metadata.h | 6 +- src/core/transport/stream_op.h | 6 +- src/core/transport/transport.h | 6 +- src/core/transport/transport_impl.h | 6 +- src/core/tsi/fake_transport_security.h | 6 +- src/core/tsi/ssl_transport_security.h | 6 +- src/core/tsi/transport_security.h | 6 +- src/core/tsi/transport_security_interface.h | 6 +- src/cpp/client/channel.h | 6 +- src/cpp/proto/proto_utils.h | 6 +- src/cpp/server/thread_pool.h | 6 +- src/cpp/util/time.h | 6 +- test/core/end2end/cq_verifier.h | 6 +- test/core/end2end/data/ssl_test_data.h | 6 +- test/core/end2end/end2end_tests.h | 6 +- test/core/end2end/tests/cancel_test_helpers.h | 6 +- test/core/iomgr/endpoint_tests.h | 6 +- test/core/statistics/census_log_tests.h | 6 +- test/core/transport/transport_end2end_tests.h | 6 +- test/core/util/grpc_profiler.h | 6 +- test/core/util/parse_hexstring.h | 6 +- test/core/util/port.h | 6 +- test/core/util/slice_splitter.h | 6 +- test/core/util/test_config.h | 6 +- test/cpp/util/create_test_channel.h | 6 +- tools/distrib/guard_headers.sh | 90 +++++++++++++++++++ 186 files changed, 645 insertions(+), 556 deletions(-) create mode 100755 tools/distrib/guard_headers.sh diff --git a/examples/pubsub/publisher.h b/examples/pubsub/publisher.h index 2d64a2abfa3..c90406ffef8 100644 --- a/examples/pubsub/publisher.h +++ b/examples/pubsub/publisher.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_EXAMPLES_PUBSUB_PUBLISHER_H_ -#define __GRPCPP_EXAMPLES_PUBSUB_PUBLISHER_H_ +#ifndef GRPC_EXAMPLES_PUBSUB_PUBLISHER_H +#define GRPC_EXAMPLES_PUBSUB_PUBLISHER_H #include #include @@ -64,4 +64,4 @@ class Publisher { } // namespace examples } // namespace grpc -#endif // __GRPCPP_EXAMPLES_PUBSUB_PUBLISHER_H_ +#endif // GRPC_EXAMPLES_PUBSUB_PUBLISHER_H diff --git a/examples/pubsub/subscriber.h b/examples/pubsub/subscriber.h index a973cd755c7..c587c01b825 100644 --- a/examples/pubsub/subscriber.h +++ b/examples/pubsub/subscriber.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_EXAMPLES_PUBSUB_SUBSCRIBER_H_ -#define __GRPCPP_EXAMPLES_PUBSUB_SUBSCRIBER_H_ +#ifndef GRPC_EXAMPLES_PUBSUB_SUBSCRIBER_H +#define GRPC_EXAMPLES_PUBSUB_SUBSCRIBER_H #include #include @@ -65,4 +65,4 @@ class Subscriber { } // namespace examples } // namespace grpc -#endif // __GRPCPP_EXAMPLES_PUBSUB_SUBSCRIBER_H_ +#endif // GRPC_EXAMPLES_PUBSUB_SUBSCRIBER_H diff --git a/include/grpc++/async_unary_call.h b/include/grpc++/async_unary_call.h index ccd0806b285..71b7d3ff858 100644 --- a/include/grpc++/async_unary_call.h +++ b/include/grpc++/async_unary_call.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_ASYNC_UNARY_CALL_H__ -#define __GRPCPP_ASYNC_UNARY_CALL_H__ +#ifndef GRPCXX_ASYNC_UNARY_CALL_H +#define GRPCXX_ASYNC_UNARY_CALL_H #include #include @@ -138,4 +138,4 @@ class ServerAsyncResponseWriter GRPC_FINAL } // namespace grpc -#endif // __GRPCPP_ASYNC_UNARY_CALL_H__ +#endif // GRPCXX_ASYNC_UNARY_CALL_H diff --git a/include/grpc++/channel_arguments.h b/include/grpc++/channel_arguments.h index 75c3cf45b49..ad96ef14ae3 100644 --- a/include/grpc++/channel_arguments.h +++ b/include/grpc++/channel_arguments.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_CHANNEL_ARGUMENTS_H_ -#define __GRPCPP_CHANNEL_ARGUMENTS_H_ +#ifndef GRPCXX_CHANNEL_ARGUMENTS_H +#define GRPCXX_CHANNEL_ARGUMENTS_H #include #include @@ -82,4 +82,4 @@ class ChannelArguments { } // namespace grpc -#endif // __GRPCPP_CHANNEL_ARGUMENTS_H_ +#endif // GRPCXX_CHANNEL_ARGUMENTS_H diff --git a/include/grpc++/channel_interface.h b/include/grpc++/channel_interface.h index 890fd04d824..77d13636184 100644 --- a/include/grpc++/channel_interface.h +++ b/include/grpc++/channel_interface.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_CHANNEL_INTERFACE_H__ -#define __GRPCPP_CHANNEL_INTERFACE_H__ +#ifndef GRPCXX_CHANNEL_INTERFACE_H +#define GRPCXX_CHANNEL_INTERFACE_H #include #include @@ -63,4 +63,4 @@ class ChannelInterface : public CallHook { } // namespace grpc -#endif // __GRPCPP_CHANNEL_INTERFACE_H__ +#endif // GRPCXX_CHANNEL_INTERFACE_H diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h index c5a213e848d..87e5e9ad6c4 100644 --- a/include/grpc++/client_context.h +++ b/include/grpc++/client_context.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_CLIENT_CONTEXT_H__ -#define __GRPCPP_CLIENT_CONTEXT_H__ +#ifndef GRPCXX_CLIENT_CONTEXT_H +#define GRPCXX_CLIENT_CONTEXT_H #include #include @@ -151,4 +151,4 @@ class ClientContext { } // namespace grpc -#endif // __GRPCPP_CLIENT_CONTEXT_H__ +#endif // GRPCXX_CLIENT_CONTEXT_H diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index 0075482d717..0ca12604038 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_COMPLETION_QUEUE_H__ -#define __GRPCPP_COMPLETION_QUEUE_H__ +#ifndef GRPCXX_COMPLETION_QUEUE_H +#define GRPCXX_COMPLETION_QUEUE_H #include @@ -121,4 +121,4 @@ class CompletionQueue { } // namespace grpc -#endif // __GRPCPP_COMPLETION_QUEUE_H__ +#endif // GRPCXX_COMPLETION_QUEUE_H diff --git a/include/grpc++/config.h b/include/grpc++/config.h index 323ea286326..cfa8d3be9f1 100644 --- a/include/grpc++/config.h +++ b/include/grpc++/config.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_CONFIG_H__ -#define __GRPCPP_CONFIG_H__ +#ifndef GRPCXX_CONFIG_H +#define GRPCXX_CONFIG_H #include @@ -50,4 +50,4 @@ typedef std::string string; } // namespace grpc -#endif // __GRPCPP_CONFIG_H__ +#endif // GRPCXX_CONFIG_H diff --git a/include/grpc++/create_channel.h b/include/grpc++/create_channel.h index 80ca0c4dc47..3f13188365c 100644 --- a/include/grpc++/create_channel.h +++ b/include/grpc++/create_channel.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_CREATE_CHANNEL_H__ -#define __GRPCPP_CREATE_CHANNEL_H__ +#ifndef GRPCXX_CREATE_CHANNEL_H +#define GRPCXX_CREATE_CHANNEL_H #include @@ -55,4 +55,4 @@ std::shared_ptr CreateChannel( } // namespace grpc -#endif // __GRPCPP_CREATE_CHANNEL_H__ +#endif // GRPCXX_CREATE_CHANNEL_H diff --git a/include/grpc++/credentials.h b/include/grpc++/credentials.h index b75755d5bc6..12c1a2fc98a 100644 --- a/include/grpc++/credentials.h +++ b/include/grpc++/credentials.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_CREDENTIALS_H_ -#define __GRPCPP_CREDENTIALS_H_ +#ifndef GRPCXX_CREDENTIALS_H +#define GRPCXX_CREDENTIALS_H #include #include @@ -133,4 +133,4 @@ class CredentialsFactory { } // namespace grpc -#endif // __GRPCPP_CREDENTIALS_H_ +#endif // GRPCXX_CREDENTIALS_H diff --git a/include/grpc++/impl/call.h b/include/grpc++/impl/call.h index 92ad0c71b7b..3e199e3eaef 100644 --- a/include/grpc++/impl/call.h +++ b/include/grpc++/impl/call.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_CALL_H__ -#define __GRPCPP_CALL_H__ +#ifndef GRPCXX_IMPL_CALL_H +#define GRPCXX_IMPL_CALL_H #include #include @@ -143,4 +143,4 @@ class Call GRPC_FINAL { } // namespace grpc -#endif // __GRPCPP_CALL_INTERFACE_H__ +#endif // GRPCXX_IMPL_CALL_H diff --git a/include/grpc++/impl/client_unary_call.h b/include/grpc++/impl/client_unary_call.h index f25ded7a249..d8703264e60 100644 --- a/include/grpc++/impl/client_unary_call.h +++ b/include/grpc++/impl/client_unary_call.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_CLIENT_UNARY_CALL_H__ -#define __GRPCPP_CLIENT_UNARY_CALL_H__ +#ifndef GRPCXX_IMPL_CLIENT_UNARY_CALL_H +#define GRPCXX_IMPL_CLIENT_UNARY_CALL_H namespace google { namespace protobuf { @@ -56,4 +56,4 @@ Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, } // namespace grpc -#endif +#endif // GRPCXX_IMPL_CLIENT_UNARY_CALL_H diff --git a/include/grpc++/impl/internal_stub.h b/include/grpc++/impl/internal_stub.h index 25290121cdf..2cbf1d901b2 100644 --- a/include/grpc++/impl/internal_stub.h +++ b/include/grpc++/impl/internal_stub.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_IMPL_INTERNAL_STUB_H__ -#define __GRPCPP_IMPL_INTERNAL_STUB_H__ +#ifndef GRPCXX_IMPL_INTERNAL_STUB_H +#define GRPCXX_IMPL_INTERNAL_STUB_H #include @@ -57,4 +57,4 @@ class InternalStub { } // namespace grpc -#endif // __GRPCPP_IMPL_INTERNAL_STUB_H__ +#endif // GRPCXX_IMPL_INTERNAL_STUB_H diff --git a/include/grpc++/impl/rpc_method.h b/include/grpc++/impl/rpc_method.h index 0236b1182a0..ab407f5c468 100644 --- a/include/grpc++/impl/rpc_method.h +++ b/include/grpc++/impl/rpc_method.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_IMPL_RPC_METHOD_H__ -#define __GRPCPP_IMPL_RPC_METHOD_H__ +#ifndef GRPCXX_IMPL_RPC_METHOD_H +#define GRPCXX_IMPL_RPC_METHOD_H namespace google { namespace protobuf { @@ -66,4 +66,4 @@ class RpcMethod { } // namespace grpc -#endif // __GRPCPP_IMPL_RPC_METHOD_H__ +#endif // GRPCXX_IMPL_RPC_METHOD_H diff --git a/include/grpc++/impl/rpc_service_method.h b/include/grpc++/impl/rpc_service_method.h index a8794bcd76a..ff94c7e6c00 100644 --- a/include/grpc++/impl/rpc_service_method.h +++ b/include/grpc++/impl/rpc_service_method.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_IMPL_RPC_SERVICE_METHOD_H__ -#define __GRPCPP_IMPL_RPC_SERVICE_METHOD_H__ +#ifndef GRPCXX_IMPL_RPC_SERVICE_METHOD_H +#define GRPCXX_IMPL_RPC_SERVICE_METHOD_H #include #include @@ -203,4 +203,4 @@ class RpcService { } // namespace grpc -#endif // __GRPCPP_IMPL_RPC_SERVICE_METHOD_H__ +#endif // GRPCXX_IMPL_RPC_SERVICE_METHOD_H diff --git a/include/grpc++/impl/service_type.h b/include/grpc++/impl/service_type.h index e54c3c24e19..7481d64d6af 100644 --- a/include/grpc++/impl/service_type.h +++ b/include/grpc++/impl/service_type.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_IMPL_SERVICE_TYPE_H__ -#define __GRPCPP_IMPL_SERVICE_TYPE_H__ +#ifndef GRPCXX_IMPL_SERVICE_TYPE_H +#define GRPCXX_IMPL_SERVICE_TYPE_H namespace google { namespace protobuf { @@ -128,4 +128,4 @@ class AsynchronousService { } // namespace grpc -#endif // __GRPCPP_IMPL_SERVICE_TYPE_H__ +#endif // GRPCXX_IMPL_SERVICE_TYPE_H diff --git a/include/grpc++/server.h b/include/grpc++/server.h index 46c4a622350..3282b82d04e 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_SERVER_H__ -#define __GRPCPP_SERVER_H__ +#ifndef GRPCXX_SERVER_H +#define GRPCXX_SERVER_H #include #include @@ -130,4 +130,4 @@ class Server GRPC_FINAL : private CallHook, } // namespace grpc -#endif // __GRPCPP_SERVER_H__ +#endif // GRPCXX_SERVER_H diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h index b672eb3e6ac..5566002dc22 100644 --- a/include/grpc++/server_builder.h +++ b/include/grpc++/server_builder.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_SERVER_BUILDER_H__ -#define __GRPCPP_SERVER_BUILDER_H__ +#ifndef GRPCXX_SERVER_BUILDER_H +#define GRPCXX_SERVER_BUILDER_H #include #include @@ -88,4 +88,4 @@ class ServerBuilder { } // namespace grpc -#endif // __GRPCPP_SERVER_BUILDER_H__ +#endif // GRPCXX_SERVER_BUILDER_H diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h index 6db767f05a4..9387f4a7e26 100644 --- a/include/grpc++/server_context.h +++ b/include/grpc++/server_context.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_SERVER_CONTEXT_H_ -#define __GRPCPP_SERVER_CONTEXT_H_ +#ifndef GRPCXX_SERVER_CONTEXT_H +#define GRPCXX_SERVER_CONTEXT_H #include #include @@ -121,4 +121,4 @@ class ServerContext GRPC_FINAL { } // namespace grpc -#endif // __GRPCPP_SERVER_CONTEXT_H_ +#endif // GRPCXX_SERVER_CONTEXT_H diff --git a/include/grpc++/server_credentials.h b/include/grpc++/server_credentials.h index 8af41597ac4..45cd279e0b0 100644 --- a/include/grpc++/server_credentials.h +++ b/include/grpc++/server_credentials.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_SERVER_CREDENTIALS_H_ -#define __GRPCPP_SERVER_CREDENTIALS_H_ +#ifndef GRPCXX_SERVER_CREDENTIALS_H +#define GRPCXX_SERVER_CREDENTIALS_H #include #include @@ -79,4 +79,4 @@ class ServerCredentialsFactory { } // namespace grpc -#endif // __GRPCPP_SERVER_CREDENTIALS_H_ +#endif // GRPCXX_SERVER_CREDENTIALS_H diff --git a/include/grpc++/status.h b/include/grpc++/status.h index 1dfb0c997ca..8073319eab8 100644 --- a/include/grpc++/status.h +++ b/include/grpc++/status.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_STATUS_H__ -#define __GRPCPP_STATUS_H__ +#ifndef GRPCXX_STATUS_H +#define GRPCXX_STATUS_H #include #include @@ -62,4 +62,4 @@ class Status { } // namespace grpc -#endif // __GRPCPP_STATUS_H__ +#endif // GRPCXX_STATUS_H diff --git a/include/grpc++/status_code_enum.h b/include/grpc++/status_code_enum.h index 0ec0a976d22..2728fb0ec1f 100644 --- a/include/grpc++/status_code_enum.h +++ b/include/grpc++/status_code_enum.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_STATUS_CODE_ENUM_H__ -#define __GRPCPP_STATUS_CODE_ENUM_H__ +#ifndef GRPCXX_STATUS_CODE_ENUM_H +#define GRPCXX_STATUS_CODE_ENUM_H namespace grpc { @@ -195,4 +195,4 @@ enum StatusCode { } // namespace grpc -#endif // __GRPCPP_STATUS_CODE_ENUM_H_ +#endif // GRPCXX_STATUS_CODE_ENUM_H diff --git a/include/grpc++/stream.h b/include/grpc++/stream.h index 8bcc75bce31..d95a379757e 100644 --- a/include/grpc++/stream.h +++ b/include/grpc++/stream.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_STREAM_H__ -#define __GRPCPP_STREAM_H__ +#ifndef GRPCXX_STREAM_H +#define GRPCXX_STREAM_H #include #include @@ -710,4 +710,4 @@ class ServerAsyncReaderWriter GRPC_FINAL : public ServerAsyncStreamingInterface, } // namespace grpc -#endif // __GRPCPP_STREAM_H__ +#endif // GRPCXX_STREAM_H diff --git a/include/grpc++/thread_pool_interface.h b/include/grpc++/thread_pool_interface.h index c8392493241..ead307f6a2f 100644 --- a/include/grpc++/thread_pool_interface.h +++ b/include/grpc++/thread_pool_interface.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_THREAD_POOL_INTERFACE_H__ -#define __GRPCPP_THREAD_POOL_INTERFACE_H__ +#ifndef GRPCXX_THREAD_POOL_INTERFACE_H +#define GRPCXX_THREAD_POOL_INTERFACE_H #include @@ -49,4 +49,4 @@ class ThreadPoolInterface { } // namespace grpc -#endif // __GRPCPP_THREAD_POOL_INTERFACE_H__ +#endif // GRPCXX_THREAD_POOL_INTERFACE_H diff --git a/include/grpc/byte_buffer.h b/include/grpc/byte_buffer.h index 89d8557edff..0ff494cdec9 100644 --- a/include/grpc/byte_buffer.h +++ b/include/grpc/byte_buffer.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_BYTE_BUFFER_H__ -#define __GRPC_BYTE_BUFFER_H__ +#ifndef GRPC_BYTE_BUFFER_H +#define GRPC_BYTE_BUFFER_H #include #include @@ -47,4 +47,4 @@ struct grpc_byte_buffer { } data; }; -#endif /* __GRPC_BYTE_BUFFER_H__ */ +#endif /* GRPC_BYTE_BUFFER_H */ diff --git a/include/grpc/byte_buffer_reader.h b/include/grpc/byte_buffer_reader.h index 4446e0c6b39..cb757cf6420 100644 --- a/include/grpc/byte_buffer_reader.h +++ b/include/grpc/byte_buffer_reader.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_BYTE_BUFFER_READER_H__ -#define __GRPC_BYTE_BUFFER_READER_H__ +#ifndef GRPC_BYTE_BUFFER_READER_H +#define GRPC_BYTE_BUFFER_READER_H #include #include @@ -46,4 +46,4 @@ struct grpc_byte_buffer_reader { } current; }; -#endif /* __GRPC_BYTE_BUFFER_READER_H__ */ +#endif /* GRPC_BYTE_BUFFER_READER_H */ diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index 4a720d11f85..bb1653101f4 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_GRPC_H__ -#define __GRPC_GRPC_H__ +#ifndef GRPC_GRPC_H +#define GRPC_GRPC_H #include @@ -632,4 +632,4 @@ void grpc_server_destroy(grpc_server *server); } #endif -#endif /* __GRPC_GRPC_H__ */ +#endif /* GRPC_GRPC_H */ diff --git a/include/grpc/grpc_http.h b/include/grpc/grpc_http.h index 757f53f9df1..c41e87413f3 100644 --- a/include/grpc/grpc_http.h +++ b/include/grpc/grpc_http.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_GRPC_HTTP_H__ -#define __GRPC_GRPC_HTTP_H__ +#ifndef GRPC_GRPC_HTTP_H +#define GRPC_GRPC_HTTP_H #ifdef __cplusplus extern "C" { @@ -64,4 +64,4 @@ typedef struct { } #endif -#endif /* __GRPC_GRPC_HTTP_H__ */ +#endif /* GRPC_GRPC_HTTP_H */ diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index 4ba4ffc1188..577f03e85fe 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -31,8 +31,8 @@ * */ -#ifndef GRPC_SECURITY_H_ -#define GRPC_SECURITY_H_ +#ifndef GRPC_GRPC_SECURITY_H +#define GRPC_GRPC_SECURITY_H #include "grpc.h" #include "status.h" @@ -185,4 +185,4 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr); } #endif -#endif /* GRPC_SECURITY_H_ */ +#endif /* GRPC_GRPC_SECURITY_H */ diff --git a/include/grpc/status.h b/include/grpc/status.h index 76a71ed26fc..a1a4d2ff0e2 100644 --- a/include/grpc/status.h +++ b/include/grpc/status.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_STATUS_H__ -#define __GRPC_STATUS_H__ +#ifndef GRPC_STATUS_H +#define GRPC_STATUS_H #ifdef __cplusplus extern "C" { @@ -199,4 +199,4 @@ typedef enum { } #endif -#endif /* __GRPC_STATUS_H__ */ +#endif /* GRPC_STATUS_H */ diff --git a/include/grpc/support/alloc.h b/include/grpc/support/alloc.h index 09ea97565b2..509870f3e3d 100644 --- a/include/grpc/support/alloc.h +++ b/include/grpc/support/alloc.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_ALLOC_H__ -#define __GRPC_SUPPORT_ALLOC_H__ +#ifndef GRPC_SUPPORT_ALLOC_H +#define GRPC_SUPPORT_ALLOC_H #include @@ -55,4 +55,4 @@ void gpr_free_aligned(void *ptr); } #endif -#endif /* __GRPC_SUPPORT_ALLOC_H__ */ +#endif /* GRPC_SUPPORT_ALLOC_H */ diff --git a/include/grpc/support/atm.h b/include/grpc/support/atm.h index f1e30d31e80..feca6b30b23 100644 --- a/include/grpc/support/atm.h +++ b/include/grpc/support/atm.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_ATM_H__ -#define __GRPC_SUPPORT_ATM_H__ +#ifndef GRPC_SUPPORT_ATM_H +#define GRPC_SUPPORT_ATM_H /* This interface provides atomic operations and barriers. It is internal to gpr support code and should not be used outside it. @@ -89,4 +89,4 @@ #error could not determine platform for atm #endif -#endif /* __GRPC_SUPPORT_ATM_H__ */ +#endif /* GRPC_SUPPORT_ATM_H */ diff --git a/include/grpc/support/atm_gcc_atomic.h b/include/grpc/support/atm_gcc_atomic.h index 2ae24aec06d..11d78b40973 100644 --- a/include/grpc/support/atm_gcc_atomic.h +++ b/include/grpc/support/atm_gcc_atomic.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_ATM_GCC_ATOMIC_H__ -#define __GRPC_SUPPORT_ATM_GCC_ATOMIC_H__ +#ifndef GRPC_SUPPORT_ATM_GCC_ATOMIC_H +#define GRPC_SUPPORT_ATM_GCC_ATOMIC_H /* atm_platform.h for gcc and gcc-like compilers with the __atomic_* interface. */ @@ -66,4 +66,4 @@ static __inline int gpr_atm_rel_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { __ATOMIC_RELAXED); } -#endif /* __GRPC_SUPPORT_ATM_GCC_ATOMIC_H__ */ +#endif /* GRPC_SUPPORT_ATM_GCC_ATOMIC_H */ diff --git a/include/grpc/support/atm_gcc_sync.h b/include/grpc/support/atm_gcc_sync.h index cec62e1a20d..e863bfd4c1e 100644 --- a/include/grpc/support/atm_gcc_sync.h +++ b/include/grpc/support/atm_gcc_sync.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_ATM_GCC_SYNC_H__ -#define __GRPC_SUPPORT_ATM_GCC_SYNC_H__ +#ifndef GRPC_SUPPORT_ATM_GCC_SYNC_H +#define GRPC_SUPPORT_ATM_GCC_SYNC_H /* variant of atm_platform.h for gcc and gcc-like compiers with __sync_* interface */ @@ -70,4 +70,4 @@ static __inline void gpr_atm_rel_store(gpr_atm *p, gpr_atm value) { #define gpr_atm_acq_cas(p, o, n) (__sync_bool_compare_and_swap((p), (o), (n))) #define gpr_atm_rel_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n)) -#endif /* __GRPC_SUPPORT_ATM_GCC_SYNC_H__ */ +#endif /* GRPC_SUPPORT_ATM_GCC_SYNC_H */ diff --git a/include/grpc/support/atm_win32.h b/include/grpc/support/atm_win32.h index 9bb1cfec357..3b9113c28b0 100644 --- a/include/grpc/support/atm_win32.h +++ b/include/grpc/support/atm_win32.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_ATM_WIN32_H__ -#define __GRPC_SUPPORT_ATM_WIN32_H__ +#ifndef GRPC_SUPPORT_ATM_WIN32_H +#define GRPC_SUPPORT_ATM_WIN32_H /* Win32 variant of atm_platform.h */ #include @@ -105,4 +105,4 @@ static __inline gpr_atm gpr_atm_full_fetch_add(gpr_atm *p, gpr_atm delta) { return old; } -#endif /* __GRPC_SUPPORT_ATM_WIN32_H__ */ +#endif /* GRPC_SUPPORT_ATM_WIN32_H */ diff --git a/include/grpc/support/cancellable_platform.h b/include/grpc/support/cancellable_platform.h index e77f9f15777..e8e4b84e2f1 100644 --- a/include/grpc/support/cancellable_platform.h +++ b/include/grpc/support/cancellable_platform.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_CANCELLABLE_PLATFORM_H__ -#define __GRPC_SUPPORT_CANCELLABLE_PLATFORM_H__ +#ifndef GRPC_SUPPORT_CANCELLABLE_PLATFORM_H +#define GRPC_SUPPORT_CANCELLABLE_PLATFORM_H #include #include @@ -53,4 +53,4 @@ typedef struct { struct gpr_cancellable_list_ waiters; } gpr_cancellable; -#endif /* __GRPC_SUPPORT_CANCELLABLE_PLATFORM_H__ */ +#endif /* GRPC_SUPPORT_CANCELLABLE_PLATFORM_H */ diff --git a/include/grpc/support/cmdline.h b/include/grpc/support/cmdline.h index 20de12242c7..c2350a07e8c 100644 --- a/include/grpc/support/cmdline.h +++ b/include/grpc/support/cmdline.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_CMDLINE_H__ -#define __GRPC_SUPPORT_CMDLINE_H__ +#ifndef GRPC_SUPPORT_CMDLINE_H +#define GRPC_SUPPORT_CMDLINE_H #ifdef __cplusplus extern "C" { @@ -92,4 +92,4 @@ void gpr_cmdline_destroy(gpr_cmdline *cl); } #endif -#endif /* __GRPC_SUPPORT_CMDLINE_H__ */ +#endif /* GRPC_SUPPORT_CMDLINE_H */ diff --git a/include/grpc/support/cpu.h b/include/grpc/support/cpu.h index 580f12dad72..005c3c721cc 100644 --- a/include/grpc/support/cpu.h +++ b/include/grpc/support/cpu.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SUPPORT_CPU_H__ -#define __GRPC_INTERNAL_SUPPORT_CPU_H__ +#ifndef GRPC_SUPPORT_CPU_H +#define GRPC_SUPPORT_CPU_H #ifdef __cplusplus extern "C" { @@ -54,4 +54,4 @@ unsigned gpr_cpu_current_cpu(void); } // extern "C" #endif -#endif /* __GRPC_INTERNAL_SUPPORT_CPU_H__ */ +#endif /* GRPC_SUPPORT_CPU_H */ diff --git a/include/grpc/support/histogram.h b/include/grpc/support/histogram.h index fb9d3d1691e..31f7fedfd5d 100644 --- a/include/grpc/support/histogram.h +++ b/include/grpc/support/histogram.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_HISTOGRAM_H__ -#define __GRPC_SUPPORT_HISTOGRAM_H__ +#ifndef GRPC_SUPPORT_HISTOGRAM_H +#define GRPC_SUPPORT_HISTOGRAM_H #ifdef __cplusplus extern "C" { @@ -63,4 +63,4 @@ double gpr_histogram_sum_of_squares(gpr_histogram *histogram); } #endif -#endif /* __GRPC_SUPPORT_HISTOGRAM_H__ */ +#endif /* GRPC_SUPPORT_HISTOGRAM_H */ diff --git a/include/grpc/support/host_port.h b/include/grpc/support/host_port.h index 2dac38a157c..3cc2f498e8f 100644 --- a/include/grpc/support/host_port.h +++ b/include/grpc/support/host_port.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_HOST_PORT_H__ -#define __GRPC_SUPPORT_HOST_PORT_H__ +#ifndef GRPC_SUPPORT_HOST_PORT_H +#define GRPC_SUPPORT_HOST_PORT_H #ifdef __cplusplus extern "C" { @@ -59,4 +59,4 @@ void gpr_split_host_port(const char *name, char **host, char **port); } #endif -#endif /* __GRPC_SUPPORT_HOST_PORT_H__ */ +#endif /* GRPC_SUPPORT_HOST_PORT_H */ diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h index c142949f770..aad4f235d22 100644 --- a/include/grpc/support/log.h +++ b/include/grpc/support/log.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_LOG_H__ -#define __GRPC_SUPPORT_LOG_H__ +#ifndef GRPC_SUPPORT_LOG_H +#define GRPC_SUPPORT_LOG_H #include /* for abort() */ #include @@ -105,4 +105,4 @@ void gpr_set_log_function(gpr_log_func func); } #endif -#endif /* __GRPC_SUPPORT_LOG_H__ */ +#endif /* GRPC_SUPPORT_LOG_H */ diff --git a/include/grpc/support/log_win32.h b/include/grpc/support/log_win32.h index 52d6a703189..ad0edcdb89f 100644 --- a/include/grpc/support/log_win32.h +++ b/include/grpc/support/log_win32.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_LOG_WIN32_H__ -#define __GRPC_SUPPORT_LOG_WIN32_H__ +#ifndef GRPC_SUPPORT_LOG_WIN32_H +#define GRPC_SUPPORT_LOG_WIN32_H #include @@ -50,4 +50,4 @@ char *gpr_format_message(DWORD messageid); } #endif -#endif /* __GRPC_SUPPORT_LOG_H__ */ +#endif /* GRPC_SUPPORT_LOG_WIN32_H */ diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index 0a651757bc0..f04c2e76afa 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_PORT_PLATFORM_H__ -#define __GRPC_SUPPORT_PORT_PLATFORM_H__ +#ifndef GRPC_SUPPORT_PORT_PLATFORM_H +#define GRPC_SUPPORT_PORT_PLATFORM_H /* Override this file with one for your platform if you need to redefine things. */ @@ -206,4 +206,4 @@ typedef uintptr_t gpr_uintptr; power of two */ #define GPR_MAX_ALIGNMENT 16 -#endif /* __GRPC_SUPPORT_PORT_PLATFORM_H__ */ +#endif /* GRPC_SUPPORT_PORT_PLATFORM_H */ diff --git a/include/grpc/support/slice.h b/include/grpc/support/slice.h index 8a2129028fd..9026602f15f 100644 --- a/include/grpc/support/slice.h +++ b/include/grpc/support/slice.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_SLICE_H__ -#define __GRPC_SUPPORT_SLICE_H__ +#ifndef GRPC_SUPPORT_SLICE_H +#define GRPC_SUPPORT_SLICE_H #include @@ -175,4 +175,4 @@ int gpr_slice_str_cmp(gpr_slice a, const char *b); } #endif -#endif /* __GRPC_SUPPORT_SLICE_H__ */ +#endif /* GRPC_SUPPORT_SLICE_H */ diff --git a/include/grpc/support/slice_buffer.h b/include/grpc/support/slice_buffer.h index 8b57f9f0b92..56f71ef2349 100644 --- a/include/grpc/support/slice_buffer.h +++ b/include/grpc/support/slice_buffer.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_SLICE_BUFFER_H__ -#define __GRPC_SUPPORT_SLICE_BUFFER_H__ +#ifndef GRPC_SUPPORT_SLICE_BUFFER_H +#define GRPC_SUPPORT_SLICE_BUFFER_H #include @@ -81,4 +81,4 @@ void gpr_slice_buffer_reset_and_unref(gpr_slice_buffer *sb); } #endif -#endif /* __GRPC_SUPPORT_SLICE_BUFFER_H__ */ +#endif /* GRPC_SUPPORT_SLICE_BUFFER_H */ diff --git a/include/grpc/support/sync.h b/include/grpc/support/sync.h index bc99317f3c9..35b2d12e774 100644 --- a/include/grpc/support/sync.h +++ b/include/grpc/support/sync.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_SYNC_H__ -#define __GRPC_SUPPORT_SYNC_H__ +#ifndef GRPC_SUPPORT_SYNC_H +#define GRPC_SUPPORT_SYNC_H /* Synchronization primitives for GPR. The type gpr_mu provides a non-reentrant mutex (lock). @@ -345,4 +345,4 @@ gpr_intptr gpr_stats_read(const gpr_stats_counter *c); } #endif -#endif /* __GRPC_SUPPORT_SYNC_H__ */ +#endif /* GRPC_SUPPORT_SYNC_H */ diff --git a/include/grpc/support/sync_generic.h b/include/grpc/support/sync_generic.h index 3bae222cb00..bbd1b3ea2ec 100644 --- a/include/grpc/support/sync_generic.h +++ b/include/grpc/support/sync_generic.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_SYNC_GENERIC_H__ -#define __GRPC_SUPPORT_SYNC_GENERIC_H__ +#ifndef GRPC_SUPPORT_SYNC_GENERIC_H +#define GRPC_SUPPORT_SYNC_GENERIC_H /* Generic type defintions for gpr_sync. */ #include @@ -58,4 +58,4 @@ typedef struct { #define GPR_STATS_INIT \ { 0 } -#endif /* __GRPC_SUPPORT_SYNC_GENERIC_H__ */ +#endif /* GRPC_SUPPORT_SYNC_GENERIC_H */ diff --git a/include/grpc/support/sync_posix.h b/include/grpc/support/sync_posix.h index 8ba2c5b8920..762d9ebe3cd 100644 --- a/include/grpc/support/sync_posix.h +++ b/include/grpc/support/sync_posix.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_SYNC_POSIX_H__ -#define __GRPC_SUPPORT_SYNC_POSIX_H__ +#ifndef GRPC_SUPPORT_SYNC_POSIX_H +#define GRPC_SUPPORT_SYNC_POSIX_H #include @@ -44,4 +44,4 @@ typedef pthread_once_t gpr_once; #define GPR_ONCE_INIT PTHREAD_ONCE_INIT -#endif /* __GRPC_SUPPORT_SYNC_POSIX_H__ */ +#endif /* GRPC_SUPPORT_SYNC_POSIX_H */ diff --git a/include/grpc/support/sync_win32.h b/include/grpc/support/sync_win32.h index 13823b8ee3d..cb2a8663a05 100644 --- a/include/grpc/support/sync_win32.h +++ b/include/grpc/support/sync_win32.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_SYNC_WIN32_H__ -#define __GRPC_SUPPORT_SYNC_WIN32_H__ +#ifndef GRPC_SUPPORT_SYNC_WIN32_H +#define GRPC_SUPPORT_SYNC_WIN32_H #include @@ -48,4 +48,4 @@ typedef CONDITION_VARIABLE gpr_cv; typedef INIT_ONCE gpr_once; #define GPR_ONCE_INIT INIT_ONCE_STATIC_INIT -#endif /* __GRPC_SUPPORT_SYNC_WIN32_H__ */ +#endif /* GRPC_SUPPORT_SYNC_WIN32_H */ diff --git a/include/grpc/support/thd.h b/include/grpc/support/thd.h index a81e6cd3ba9..64d5bed49a7 100644 --- a/include/grpc/support/thd.h +++ b/include/grpc/support/thd.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_THD_H__ -#define __GRPC_SUPPORT_THD_H__ +#ifndef GRPC_SUPPORT_THD_H +#define GRPC_SUPPORT_THD_H /* Thread interface for GPR. Types @@ -73,4 +73,4 @@ gpr_thd_id gpr_thd_currentid(void); } #endif -#endif /* __GRPC_SUPPORT_THD_H__ */ +#endif /* GRPC_SUPPORT_THD_H */ diff --git a/include/grpc/support/time.h b/include/grpc/support/time.h index 150b7ac8c53..1fd3181859f 100644 --- a/include/grpc/support/time.h +++ b/include/grpc/support/time.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_TIME_H__ -#define __GRPC_SUPPORT_TIME_H__ +#ifndef GRPC_SUPPORT_TIME_H +#define GRPC_SUPPORT_TIME_H /* Time support. We use gpr_timespec, which is analogous to struct timespec. On some machines, absolute times may be in local time. */ @@ -100,4 +100,4 @@ double gpr_timespec_to_micros(gpr_timespec t); } #endif -#endif /* __GRPC_SUPPORT_TIME_H__ */ +#endif /* GRPC_SUPPORT_TIME_H */ diff --git a/include/grpc/support/useful.h b/include/grpc/support/useful.h index 8d756c37c31..979f3d026b3 100644 --- a/include/grpc/support/useful.h +++ b/include/grpc/support/useful.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_USEFUL_H__ -#define __GRPC_SUPPORT_USEFUL_H__ +#ifndef GRPC_SUPPORT_USEFUL_H +#define GRPC_SUPPORT_USEFUL_H /* useful macros that don't belong anywhere else */ @@ -45,4 +45,4 @@ #define GPR_ARRAY_SIZE(array) (sizeof(array) / sizeof(*(array))) -#endif /* __GRPC_SUPPORT_USEFUL_H__ */ +#endif /* GRPC_SUPPORT_USEFUL_H */ diff --git a/src/compiler/cpp_generator.h b/src/compiler/cpp_generator.h index f5b1ad23eee..1bfe5a8819b 100644 --- a/src/compiler/cpp_generator.h +++ b/src/compiler/cpp_generator.h @@ -31,8 +31,8 @@ * */ -#ifndef NET_GRPC_COMPILER_CPP_GENERATOR_H_ -#define NET_GRPC_COMPILER_CPP_GENERATOR_H_ +#ifndef GRPC_INTERNAL_COMPILER_CPP_GENERATOR_H +#define GRPC_INTERNAL_COMPILER_CPP_GENERATOR_H #include @@ -58,4 +58,4 @@ std::string GetSourceServices(const google::protobuf::FileDescriptor *file); } // namespace grpc_cpp_generator -#endif // NET_GRPC_COMPILER_CPP_GENERATOR_H_ +#endif // GRPC_INTERNAL_COMPILER_CPP_GENERATOR_H diff --git a/src/compiler/cpp_generator_helpers.h b/src/compiler/cpp_generator_helpers.h index 632ff3c8cfe..16abbde8d47 100644 --- a/src/compiler/cpp_generator_helpers.h +++ b/src/compiler/cpp_generator_helpers.h @@ -31,8 +31,8 @@ * */ -#ifndef NET_GRPC_COMPILER_CPP_GENERATOR_HELPERS_H__ -#define NET_GRPC_COMPILER_CPP_GENERATOR_HELPERS_H__ +#ifndef GRPC_INTERNAL_COMPILER_CPP_GENERATOR_HELPERS_H +#define GRPC_INTERNAL_COMPILER_CPP_GENERATOR_HELPERS_H #include #include @@ -69,4 +69,4 @@ inline std::string ClassName(const google::protobuf::Descriptor *descriptor, } // namespace grpc_cpp_generator -#endif // NET_GRPC_COMPILER_CPP_GENERATOR_HELPERS_H__ +#endif // GRPC_INTERNAL_COMPILER_CPP_GENERATOR_HELPERS_H diff --git a/src/compiler/generator_helpers.h b/src/compiler/generator_helpers.h index 0c14bb8bcf4..2035820f0dc 100644 --- a/src/compiler/generator_helpers.h +++ b/src/compiler/generator_helpers.h @@ -31,8 +31,8 @@ * */ -#ifndef NET_GRPC_COMPILER_GENERATOR_HELPERS_H__ -#define NET_GRPC_COMPILER_GENERATOR_HELPERS_H__ +#ifndef GRPC_INTERNAL_COMPILER_GENERATOR_HELPERS_H +#define GRPC_INTERNAL_COMPILER_GENERATOR_HELPERS_H #include #include @@ -76,4 +76,4 @@ inline std::string StringReplace(std::string str, const std::string &from, } // namespace grpc_generator -#endif // NET_GRPC_COMPILER_GENERATOR_HELPERS_H__ +#endif // GRPC_INTERNAL_COMPILER_GENERATOR_HELPERS_H diff --git a/src/compiler/python_generator.h b/src/compiler/python_generator.h index 773dfa3513d..df29ca17e3e 100644 --- a/src/compiler/python_generator.h +++ b/src/compiler/python_generator.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_COMPILER_PYTHON_GENERATOR_H__ -#define __GRPC_COMPILER_PYTHON_GENERATOR_H__ +#ifndef GRPC_INTERNAL_COMPILER_PYTHON_GENERATOR_H +#define GRPC_INTERNAL_COMPILER_PYTHON_GENERATOR_H #include #include @@ -49,4 +49,4 @@ std::pair GetServices(const google::protobuf::FileDescriptor* } // namespace grpc_python_generator -#endif // __GRPC_COMPILER_PYTHON_GENERATOR_H__ +#endif // GRPC_INTERNAL_COMPILER_PYTHON_GENERATOR_H diff --git a/src/compiler/ruby_generator.h b/src/compiler/ruby_generator.h index d0c568fad0f..4dd38e0c274 100644 --- a/src/compiler/ruby_generator.h +++ b/src/compiler/ruby_generator.h @@ -31,8 +31,8 @@ * */ -#ifndef NET_GRPC_COMPILER_RUBY_GENERATOR_H_ -#define NET_GRPC_COMPILER_RUBY_GENERATOR_H_ +#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_H +#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_H #include @@ -48,4 +48,4 @@ std::string GetServices(const google::protobuf::FileDescriptor *file); } // namespace grpc_ruby_generator -#endif // NET_GRPC_COMPILER_RUBY_GENERATOR_H_ +#endif // GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_H diff --git a/src/compiler/ruby_generator_helpers-inl.h b/src/compiler/ruby_generator_helpers-inl.h index 61d887b41cd..f3a087b3f8e 100644 --- a/src/compiler/ruby_generator_helpers-inl.h +++ b/src/compiler/ruby_generator_helpers-inl.h @@ -31,8 +31,8 @@ * */ -#ifndef NET_GRPC_COMPILER_RUBY_GENERATOR_HELPERS_INL_H_ -#define NET_GRPC_COMPILER_RUBY_GENERATOR_HELPERS_INL_H_ +#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H +#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H #include @@ -64,4 +64,4 @@ inline std::string MessagesRequireName( } // namespace grpc_ruby_generator -#endif // NET_GRPC_COMPILER_RUBY_GENERATOR_HELPERS_INL_H_ +#endif // GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_HELPERS_INL_H diff --git a/src/compiler/ruby_generator_map-inl.h b/src/compiler/ruby_generator_map-inl.h index a86342e8d55..f902b6d98f8 100644 --- a/src/compiler/ruby_generator_map-inl.h +++ b/src/compiler/ruby_generator_map-inl.h @@ -31,8 +31,8 @@ * */ -#ifndef NET_GRPC_COMPILER_RUBY_GENERATOR_MAP_INL_H_ -#define NET_GRPC_COMPILER_RUBY_GENERATOR_MAP_INL_H_ +#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H +#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H #include #include @@ -69,4 +69,4 @@ inline std::map ListToDict( } // namespace grpc_ruby_generator -#endif // NET_GRPC_COMPILER_RUBY_GENERATOR_MAP_INL_H_ +#endif // GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H diff --git a/src/compiler/ruby_generator_string-inl.h b/src/compiler/ruby_generator_string-inl.h index 7c2e4e5d9d4..bdd314c16e5 100644 --- a/src/compiler/ruby_generator_string-inl.h +++ b/src/compiler/ruby_generator_string-inl.h @@ -31,8 +31,8 @@ * */ -#ifndef NET_GRPC_COMPILER_RUBY_GENERATOR_STRING_INL_H_ -#define NET_GRPC_COMPILER_RUBY_GENERATOR_STRING_INL_H_ +#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_STRING_INL_H +#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_STRING_INL_H #include #include @@ -130,4 +130,4 @@ inline std::string RubyTypeOf(const std::string &a_type, } // namespace grpc_ruby_generator -#endif // NET_GRPC_COMPILER_RUBY_GENERATOR_STRING_INL_H_ +#endif // GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_STRING_INL_H diff --git a/src/core/channel/census_filter.h b/src/core/channel/census_filter.h index 6acf9695f47..4f9759f0db2 100644 --- a/src/core/channel/census_filter.h +++ b/src/core/channel/census_filter.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_CHANNEL_CENSUS_FILTER_H__ -#define __GRPC_INTERNAL_CHANNEL_CENSUS_FILTER_H__ +#ifndef GRPC_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H +#define GRPC_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H #include "src/core/channel/channel_stack.h" @@ -41,4 +41,4 @@ extern const grpc_channel_filter grpc_client_census_filter; extern const grpc_channel_filter grpc_server_census_filter; -#endif /* __GRPC_INTERNAL_CHANNEL_CENSUS_FILTER_H__ */ +#endif /* GRPC_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H */ diff --git a/src/core/channel/channel_args.h b/src/core/channel/channel_args.h index 640bbd85a5f..eb5bf63986a 100644 --- a/src/core/channel/channel_args.h +++ b/src/core/channel/channel_args.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_CHANNEL_CHANNEL_ARGS_H__ -#define __GRPC_INTERNAL_CHANNEL_CHANNEL_ARGS_H__ +#ifndef GRPC_INTERNAL_CORE_CHANNEL_CHANNEL_ARGS_H +#define GRPC_INTERNAL_CORE_CHANNEL_CHANNEL_ARGS_H #include @@ -51,4 +51,4 @@ void grpc_channel_args_destroy(grpc_channel_args *a); is specified in channel args, otherwise returns 0. */ int grpc_channel_args_is_census_enabled(const grpc_channel_args *a); -#endif /* __GRPC_INTERNAL_CHANNEL_CHANNEL_ARGS_H__ */ +#endif /* GRPC_INTERNAL_CORE_CHANNEL_CHANNEL_ARGS_H */ diff --git a/src/core/channel/channel_stack.h b/src/core/channel/channel_stack.h index 1ca95e7f1a6..c136f5c17ca 100644 --- a/src/core/channel/channel_stack.h +++ b/src/core/channel/channel_stack.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_CHANNEL_CHANNEL_STACK_H__ -#define __GRPC_INTERNAL_CHANNEL_CHANNEL_STACK_H__ +#ifndef GRPC_INTERNAL_CORE_CHANNEL_CHANNEL_STACK_H +#define GRPC_INTERNAL_CORE_CHANNEL_CHANNEL_STACK_H /* A channel filter defines how operations on a channel are implemented. Channel filters are chained together to create full channels, and if those @@ -301,4 +301,4 @@ void grpc_call_element_send_finish(grpc_call_element *cur_elem); #define GRPC_CALL_LOG_OP(sev, elem, op) \ if (grpc_trace_bits & GRPC_TRACE_CHANNEL) grpc_call_log_op(sev, elem, op) -#endif /* __GRPC_INTERNAL_CHANNEL_CHANNEL_STACK_H__ */ +#endif /* GRPC_INTERNAL_CORE_CHANNEL_CHANNEL_STACK_H */ diff --git a/src/core/channel/child_channel.h b/src/core/channel/child_channel.h index 84a11062cbe..38695402ab0 100644 --- a/src/core/channel/child_channel.h +++ b/src/core/channel/child_channel.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_CHANNEL_CHILD_CHANNEL_H_ -#define __GRPC_INTERNAL_CHANNEL_CHILD_CHANNEL_H_ +#ifndef GRPC_INTERNAL_CORE_CHANNEL_CHILD_CHANNEL_H +#define GRPC_INTERNAL_CORE_CHANNEL_CHILD_CHANNEL_H #include "src/core/channel/channel_stack.h" @@ -61,4 +61,4 @@ grpc_child_call *grpc_child_channel_create_call(grpc_child_channel *channel, grpc_call_element *grpc_child_call_get_top_element(grpc_child_call *call); void grpc_child_call_destroy(grpc_child_call *call); -#endif /* __GRPC_INTERNAL_CHANNEL_CHILD_CHANNEL_H_ */ +#endif /* GRPC_INTERNAL_CORE_CHANNEL_CHILD_CHANNEL_H */ diff --git a/src/core/channel/client_channel.h b/src/core/channel/client_channel.h index 7da4fc92580..7a67a9f21f0 100644 --- a/src/core/channel/client_channel.h +++ b/src/core/channel/client_channel.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_CHANNEL_CLIENT_CHANNEL_H__ -#define __GRPC_INTERNAL_CHANNEL_CLIENT_CHANNEL_H__ +#ifndef GRPC_INTERNAL_CORE_CHANNEL_CLIENT_CHANNEL_H +#define GRPC_INTERNAL_CORE_CHANNEL_CLIENT_CHANNEL_H #include "src/core/channel/channel_stack.h" @@ -59,4 +59,4 @@ grpc_transport_setup_result grpc_client_channel_transport_setup_complete( grpc_channel_filter const **channel_filters, size_t num_channel_filters, grpc_mdctx *mdctx); -#endif /* __GRPC_INTERNAL_CHANNEL_CLIENT_CHANNEL_H__ */ +#endif /* GRPC_INTERNAL_CORE_CHANNEL_CLIENT_CHANNEL_H */ diff --git a/src/core/channel/client_setup.h b/src/core/channel/client_setup.h index f2b64265bc3..70137e1365a 100644 --- a/src/core/channel/client_setup.h +++ b/src/core/channel/client_setup.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_CHANNEL_CLIENT_SETUP_H__ -#define __GRPC_INTERNAL_CHANNEL_CLIENT_SETUP_H__ +#ifndef GRPC_INTERNAL_CORE_CHANNEL_CLIENT_SETUP_H +#define GRPC_INTERNAL_CORE_CHANNEL_CLIENT_SETUP_H #include "src/core/channel/client_channel.h" #include "src/core/transport/metadata.h" @@ -70,4 +70,4 @@ gpr_timespec grpc_client_setup_request_deadline(grpc_client_setup_request *r); grpc_mdctx *grpc_client_setup_get_mdctx(grpc_client_setup_request *r); -#endif /* __GRPC_INTERNAL_CHANNEL_CLIENT_SETUP_H__ */ +#endif /* GRPC_INTERNAL_CORE_CHANNEL_CLIENT_SETUP_H */ diff --git a/src/core/channel/connected_channel.h b/src/core/channel/connected_channel.h index e19de62ca94..8b35f69b26f 100644 --- a/src/core/channel/connected_channel.h +++ b/src/core/channel/connected_channel.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_CHANNEL_CONNECTED_CHANNEL_H__ -#define __GRPC_INTERNAL_CHANNEL_CONNECTED_CHANNEL_H__ +#ifndef GRPC_INTERNAL_CORE_CHANNEL_CONNECTED_CHANNEL_H +#define GRPC_INTERNAL_CORE_CHANNEL_CONNECTED_CHANNEL_H #include "src/core/channel/channel_stack.h" @@ -46,4 +46,4 @@ extern const grpc_channel_filter grpc_connected_channel_filter; grpc_transport_setup_result grpc_connected_channel_bind_transport( grpc_channel_stack *channel_stack, grpc_transport *transport); -#endif /* __GRPC_INTERNAL_CHANNEL_CONNECTED_CHANNEL_H__ */ +#endif /* GRPC_INTERNAL_CORE_CHANNEL_CONNECTED_CHANNEL_H */ diff --git a/src/core/channel/http_client_filter.h b/src/core/channel/http_client_filter.h index 5882f8fe057..04eb839e006 100644 --- a/src/core/channel/http_client_filter.h +++ b/src/core/channel/http_client_filter.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_CHANNEL_HTTP_CLIENT_FILTER_H__ -#define __GRPC_INTERNAL_CHANNEL_HTTP_CLIENT_FILTER_H__ +#ifndef GRPC_INTERNAL_CORE_CHANNEL_HTTP_CLIENT_FILTER_H +#define GRPC_INTERNAL_CORE_CHANNEL_HTTP_CLIENT_FILTER_H #include "src/core/channel/channel_stack.h" @@ -41,4 +41,4 @@ extern const grpc_channel_filter grpc_http_client_filter; #define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme" -#endif /* __GRPC_INTERNAL_CHANNEL_HTTP_CLIENT_FILTER_H__ */ +#endif /* GRPC_INTERNAL_CORE_CHANNEL_HTTP_CLIENT_FILTER_H */ diff --git a/src/core/channel/http_filter.h b/src/core/channel/http_filter.h index b85cd3956eb..1b116ad61f4 100644 --- a/src/core/channel/http_filter.h +++ b/src/core/channel/http_filter.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_CHANNEL_HTTP_FILTER_H__ -#define __GRPC_INTERNAL_CHANNEL_HTTP_FILTER_H__ +#ifndef GRPC_INTERNAL_CORE_CHANNEL_HTTP_FILTER_H +#define GRPC_INTERNAL_CORE_CHANNEL_HTTP_FILTER_H #include "src/core/channel/channel_stack.h" @@ -40,4 +40,4 @@ transports. */ extern const grpc_channel_filter grpc_http_filter; -#endif /* __GRPC_INTERNAL_CHANNEL_HTTP_FILTER_H__ */ +#endif /* GRPC_INTERNAL_CORE_CHANNEL_HTTP_FILTER_H */ diff --git a/src/core/channel/http_server_filter.h b/src/core/channel/http_server_filter.h index 0643c7be83c..42f76ed17f2 100644 --- a/src/core/channel/http_server_filter.h +++ b/src/core/channel/http_server_filter.h @@ -31,12 +31,12 @@ * */ -#ifndef __GRPC_INTERNAL_CHANNEL_HTTP_SERVER_FILTER_H__ -#define __GRPC_INTERNAL_CHANNEL_HTTP_SERVER_FILTER_H__ +#ifndef GRPC_INTERNAL_CORE_CHANNEL_HTTP_SERVER_FILTER_H +#define GRPC_INTERNAL_CORE_CHANNEL_HTTP_SERVER_FILTER_H #include "src/core/channel/channel_stack.h" /* Processes metadata on the client side for HTTP2 transports */ extern const grpc_channel_filter grpc_http_server_filter; -#endif /* __GRPC_INTERNAL_CHANNEL_HTTP_SERVER_FILTER_H__ */ +#endif /* GRPC_INTERNAL_CORE_CHANNEL_HTTP_SERVER_FILTER_H */ diff --git a/src/core/channel/metadata_buffer.h b/src/core/channel/metadata_buffer.h index 701d69df7c5..b7cc5170d13 100644 --- a/src/core/channel/metadata_buffer.h +++ b/src/core/channel/metadata_buffer.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_CHANNEL_METADATA_BUFFER_H__ -#define __GRPC_INTERNAL_CHANNEL_METADATA_BUFFER_H__ +#ifndef GRPC_INTERNAL_CORE_CHANNEL_METADATA_BUFFER_H +#define GRPC_INTERNAL_CORE_CHANNEL_METADATA_BUFFER_H #include "src/core/channel/channel_stack.h" @@ -67,4 +67,4 @@ grpc_metadata *grpc_metadata_buffer_extract_elements( grpc_metadata_buffer *buffer); void grpc_metadata_buffer_cleanup_elements(void *elements, grpc_op_error error); -#endif /* __GRPC_INTERNAL_CHANNEL_METADATA_BUFFER_H__ */ +#endif /* GRPC_INTERNAL_CORE_CHANNEL_METADATA_BUFFER_H */ diff --git a/src/core/channel/noop_filter.h b/src/core/channel/noop_filter.h index 93c2bff9b02..96463e53222 100644 --- a/src/core/channel/noop_filter.h +++ b/src/core/channel/noop_filter.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_CHANNEL_NOOP_FILTER_H__ -#define __GRPC_INTERNAL_CHANNEL_NOOP_FILTER_H__ +#ifndef GRPC_INTERNAL_CORE_CHANNEL_NOOP_FILTER_H +#define GRPC_INTERNAL_CORE_CHANNEL_NOOP_FILTER_H #include "src/core/channel/channel_stack.h" @@ -41,4 +41,4 @@ customize for their own filters */ extern const grpc_channel_filter grpc_no_op_filter; -#endif /* __GRPC_INTERNAL_CHANNEL_NOOP_FILTER_H__ */ +#endif /* GRPC_INTERNAL_CORE_CHANNEL_NOOP_FILTER_H */ diff --git a/src/core/compression/algorithm.h b/src/core/compression/algorithm.h index e398ae34b4c..9dd9f57b568 100644 --- a/src/core/compression/algorithm.h +++ b/src/core/compression/algorithm.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_COMPRESSION_ALGORITHM_H__ -#define __GRPC_INTERNAL_COMPRESSION_ALGORITHM_H__ +#ifndef GRPC_INTERNAL_CORE_COMPRESSION_ALGORITHM_H +#define GRPC_INTERNAL_CORE_COMPRESSION_ALGORITHM_H /* The various compression algorithms supported by GRPC */ typedef enum { @@ -46,4 +46,4 @@ typedef enum { const char *grpc_compression_algorithm_name( grpc_compression_algorithm algorithm); -#endif /* __GRPC_INTERNAL_COMPRESSION_ALGORITHM_H__ */ +#endif /* GRPC_INTERNAL_CORE_COMPRESSION_ALGORITHM_H */ diff --git a/src/core/compression/message_compress.h b/src/core/compression/message_compress.h index 666da2ed0d6..e8aef1a7139 100644 --- a/src/core/compression/message_compress.h +++ b/src/core/compression/message_compress.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_COMPRESSION_MESSAGE_COMPRESS_H__ -#define __GRPC_INTERNAL_COMPRESSION_MESSAGE_COMPRESS_H__ +#ifndef GRPC_INTERNAL_CORE_COMPRESSION_MESSAGE_COMPRESS_H +#define GRPC_INTERNAL_CORE_COMPRESSION_MESSAGE_COMPRESS_H #include "src/core/compression/algorithm.h" #include @@ -49,4 +49,4 @@ int grpc_msg_compress(grpc_compression_algorithm algorithm, int grpc_msg_decompress(grpc_compression_algorithm algorithm, gpr_slice_buffer *input, gpr_slice_buffer *output); -#endif /* __GRPC_INTERNAL_COMPRESSION_MESSAGE_COMPRESS_H__ */ +#endif /* GRPC_INTERNAL_CORE_COMPRESSION_MESSAGE_COMPRESS_H */ diff --git a/src/core/debug/trace.h b/src/core/debug/trace.h index bf9b8a3642c..2059599a7d8 100644 --- a/src/core/debug/trace.h +++ b/src/core/debug/trace.h @@ -31,8 +31,8 @@ * */ -#ifndef GRPC_CORE_DEBUG_TRACE_H -#define GRPC_CORE_DEBUG_TRACE_H +#ifndef GRPC_INTERNAL_CORE_DEBUG_TRACE_H +#define GRPC_INTERNAL_CORE_DEBUG_TRACE_H #include @@ -57,5 +57,4 @@ extern gpr_uint32 grpc_trace_bits; void grpc_init_trace_bits(); -#endif - +#endif /* GRPC_INTERNAL_CORE_DEBUG_TRACE_H */ diff --git a/src/core/httpcli/format_request.h b/src/core/httpcli/format_request.h index e06b6329903..8bfb20bfd0c 100644 --- a/src/core/httpcli/format_request.h +++ b/src/core/httpcli/format_request.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_HTTPCLI_FORMAT_REQUEST_H__ -#define __GRPC_INTERNAL_HTTPCLI_FORMAT_REQUEST_H__ +#ifndef GRPC_INTERNAL_CORE_HTTPCLI_FORMAT_REQUEST_H +#define GRPC_INTERNAL_CORE_HTTPCLI_FORMAT_REQUEST_H #include "src/core/httpcli/httpcli.h" #include @@ -42,4 +42,4 @@ gpr_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request, const char *body_bytes, size_t body_size); -#endif /* __GRPC_INTERNAL_HTTPCLI_FORMAT_REQUEST_H__ */ +#endif /* GRPC_INTERNAL_CORE_HTTPCLI_FORMAT_REQUEST_H */ diff --git a/src/core/httpcli/httpcli.h b/src/core/httpcli/httpcli.h index f6209877680..255c5ed90f1 100644 --- a/src/core/httpcli/httpcli.h +++ b/src/core/httpcli/httpcli.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_HTTPCLI_HTTPCLI_H__ -#define __GRPC_INTERNAL_HTTPCLI_HTTPCLI_H__ +#ifndef GRPC_INTERNAL_CORE_HTTPCLI_HTTPCLI_H +#define GRPC_INTERNAL_CORE_HTTPCLI_HTTPCLI_H #include @@ -115,4 +115,4 @@ typedef int (*grpc_httpcli_post_override)(const grpc_httpcli_request *request, void grpc_httpcli_set_override(grpc_httpcli_get_override get, grpc_httpcli_post_override post); -#endif /* __GRPC_INTERNAL_HTTPCLI_HTTPCLI_H__ */ +#endif /* GRPC_INTERNAL_CORE_HTTPCLI_HTTPCLI_H */ diff --git a/src/core/httpcli/httpcli_security_context.h b/src/core/httpcli/httpcli_security_context.h index 5a1311e7a41..a776828a692 100644 --- a/src/core/httpcli/httpcli_security_context.h +++ b/src/core/httpcli/httpcli_security_context.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_HTTPCLI_HTTPCLI_SECURITY_CONTEXT_H__ -#define __GRPC_INTERNAL_HTTPCLI_HTTPCLI_SECURITY_CONTEXT_H__ +#ifndef GRPC_INTERNAL_CORE_HTTPCLI_HTTPCLI_SECURITY_CONTEXT_H +#define GRPC_INTERNAL_CORE_HTTPCLI_HTTPCLI_SECURITY_CONTEXT_H #include "src/core/security/security_context.h" @@ -40,4 +40,4 @@ grpc_security_status grpc_httpcli_ssl_channel_security_context_create( const unsigned char *pem_root_certs, size_t pem_root_certs_size, const char *secure_peer_name, grpc_channel_security_context **ctx); -#endif /* __GRPC_INTERNAL_HTTPCLI_HTTPCLI_SECURITY_CONTEXT_H__ */ +#endif /* GRPC_INTERNAL_CORE_HTTPCLI_HTTPCLI_SECURITY_CONTEXT_H */ diff --git a/src/core/httpcli/parser.h b/src/core/httpcli/parser.h index db1fa0a33c8..71280e74794 100644 --- a/src/core/httpcli/parser.h +++ b/src/core/httpcli/parser.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_HTTPCLI_PARSER_H__ -#define __GRPC_INTERNAL_HTTPCLI_PARSER_H__ +#ifndef GRPC_INTERNAL_CORE_HTTPCLI_PARSER_H +#define GRPC_INTERNAL_CORE_HTTPCLI_PARSER_H #include "src/core/httpcli/httpcli.h" #include @@ -61,4 +61,4 @@ void grpc_httpcli_parser_destroy(grpc_httpcli_parser *parser); int grpc_httpcli_parser_parse(grpc_httpcli_parser *parser, gpr_slice slice); int grpc_httpcli_parser_eof(grpc_httpcli_parser *parser); -#endif /* __GRPC_INTERNAL_HTTPCLI_PARSER_H__ */ +#endif /* GRPC_INTERNAL_CORE_HTTPCLI_PARSER_H */ diff --git a/src/core/iomgr/alarm.h b/src/core/iomgr/alarm.h index 6dcc63a6d58..e5262e21998 100644 --- a/src/core/iomgr/alarm.h +++ b/src/core/iomgr/alarm.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_ALARM_H__ -#define __GRPC_INTERNAL_IOMGR_ALARM_H__ +#ifndef GRPC_INTERNAL_CORE_IOMGR_ALARM_H +#define GRPC_INTERNAL_CORE_IOMGR_ALARM_H #include "src/core/iomgr/iomgr.h" #include @@ -86,4 +86,4 @@ void grpc_alarm_init(grpc_alarm *alarm, gpr_timespec deadline, Requires: cancel() must happen after add() on a given alarm */ void grpc_alarm_cancel(grpc_alarm *alarm); -#endif /* __GRPC_INTERNAL_IOMGR_ALARM_H__ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_ALARM_H */ diff --git a/src/core/iomgr/alarm_heap.h b/src/core/iomgr/alarm_heap.h index bb6e5e3a899..c5adfc6d31e 100644 --- a/src/core/iomgr/alarm_heap.h +++ b/src/core/iomgr/alarm_heap.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_ALARM_HEAP_H_ -#define __GRPC_INTERNAL_IOMGR_ALARM_HEAP_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_ALARM_HEAP_H +#define GRPC_INTERNAL_CORE_IOMGR_ALARM_HEAP_H #include "src/core/iomgr/alarm.h" @@ -54,4 +54,4 @@ void grpc_alarm_heap_pop(grpc_alarm_heap *heap); int grpc_alarm_heap_is_empty(grpc_alarm_heap *heap); -#endif /* __GRPC_INTERNAL_IOMGR_ALARM_HEAP_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_ALARM_HEAP_H */ diff --git a/src/core/iomgr/alarm_internal.h b/src/core/iomgr/alarm_internal.h index cbd8fa9421f..0268a01badf 100644 --- a/src/core/iomgr/alarm_internal.h +++ b/src/core/iomgr/alarm_internal.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_ALARM_INTERNAL_H_ -#define __GRPC_INTERNAL_IOMGR_ALARM_INTERNAL_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_ALARM_INTERNAL_H +#define GRPC_INTERNAL_CORE_IOMGR_ALARM_INTERNAL_H #include #include @@ -59,4 +59,4 @@ gpr_timespec grpc_alarm_list_next_timeout(void); void grpc_kick_poller(void); -#endif /* __GRPC_INTERNAL_IOMGR_ALARM_INTERNAL_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_ALARM_INTERNAL_H */ diff --git a/src/core/iomgr/endpoint.h b/src/core/iomgr/endpoint.h index e89cf6691c0..881e851800b 100644 --- a/src/core/iomgr/endpoint.h +++ b/src/core/iomgr/endpoint.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_ENDPOINT_H__ -#define __GRPC_INTERNAL_IOMGR_ENDPOINT_H__ +#ifndef GRPC_INTERNAL_CORE_IOMGR_ENDPOINT_H +#define GRPC_INTERNAL_CORE_IOMGR_ENDPOINT_H #include "src/core/iomgr/pollset.h" #include @@ -103,4 +103,4 @@ struct grpc_endpoint { const grpc_endpoint_vtable *vtable; }; -#endif /* __GRPC_INTERNAL_IOMGR_ENDPOINT_H__ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_ENDPOINT_H */ diff --git a/src/core/iomgr/endpoint_pair.h b/src/core/iomgr/endpoint_pair.h index 2e46aab2283..dffbd36d4c6 100644 --- a/src/core/iomgr/endpoint_pair.h +++ b/src/core/iomgr/endpoint_pair.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_ENDPOINT_PAIR_H_ -#define __GRPC_INTERNAL_IOMGR_ENDPOINT_PAIR_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_ENDPOINT_PAIR_H +#define GRPC_INTERNAL_CORE_IOMGR_ENDPOINT_PAIR_H #include "src/core/iomgr/endpoint.h" @@ -43,4 +43,4 @@ typedef struct { grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(size_t read_slice_size); -#endif /* __GRPC_INTERNAL_IOMGR_ENDPOINT_PAIR_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_ENDPOINT_PAIR_H */ diff --git a/src/core/iomgr/fd_posix.h b/src/core/iomgr/fd_posix.h index 2a308c8ae20..be21f2b55f8 100644 --- a/src/core/iomgr/fd_posix.h +++ b/src/core/iomgr/fd_posix.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_FD_POSIX_H_ -#define __GRPC_INTERNAL_IOMGR_FD_POSIX_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_FD_POSIX_H +#define GRPC_INTERNAL_CORE_IOMGR_FD_POSIX_H #include "src/core/iomgr/iomgr.h" #include "src/core/iomgr/pollset.h" @@ -143,4 +143,4 @@ void grpc_fd_unref(grpc_fd *fd); void grpc_fd_global_init(void); void grpc_fd_global_shutdown(void); -#endif /* __GRPC_INTERNAL_IOMGR_FD_POSIX_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_FD_POSIX_H */ diff --git a/src/core/iomgr/iocp_windows.h b/src/core/iomgr/iocp_windows.h index d0231702a16..33133193a10 100644 --- a/src/core/iomgr/iocp_windows.h +++ b/src/core/iomgr/iocp_windows.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_IOCP_WINDOWS_H_ -#define __GRPC_INTERNAL_IOMGR_IOCP_WINDOWS_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_IOCP_WINDOWS_H +#define GRPC_INTERNAL_CORE_IOMGR_IOCP_WINDOWS_H #include #include @@ -49,4 +49,4 @@ void grpc_socket_notify_on_write(grpc_winsocket *, void(*cb)(void *, int success void grpc_socket_notify_on_read(grpc_winsocket *, void(*cb)(void *, int success), void *opaque); -#endif /* __GRPC_INTERNAL_IOMGR_IOCP_WINDOWS_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_IOCP_WINDOWS_H */ diff --git a/src/core/iomgr/iomgr.h b/src/core/iomgr/iomgr.h index 18a7d151fc7..1f5d23fdda4 100644 --- a/src/core/iomgr/iomgr.h +++ b/src/core/iomgr/iomgr.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_IOMGR_H__ -#define __GRPC_INTERNAL_IOMGR_IOMGR_H__ +#ifndef GRPC_INTERNAL_CORE_IOMGR_IOMGR_H +#define GRPC_INTERNAL_CORE_IOMGR_IOMGR_H /* gRPC Callback definition */ typedef void (*grpc_iomgr_cb_func)(void *arg, int success); @@ -44,4 +44,4 @@ void grpc_iomgr_shutdown(void); and causes the invocation of a callback at some point in the future */ void grpc_iomgr_add_callback(grpc_iomgr_cb_func cb, void *cb_arg); -#endif /* __GRPC_INTERNAL_IOMGR_IOMGR_H__ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_IOMGR_H */ diff --git a/src/core/iomgr/iomgr_internal.h b/src/core/iomgr/iomgr_internal.h index 7f29f44f7f9..07923258b9b 100644 --- a/src/core/iomgr/iomgr_internal.h +++ b/src/core/iomgr/iomgr_internal.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_IOMGR_INTERNAL_H_ -#define __GRPC_INTERNAL_IOMGR_IOMGR_INTERNAL_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_IOMGR_INTERNAL_H +#define GRPC_INTERNAL_CORE_IOMGR_IOMGR_INTERNAL_H #include "src/core/iomgr/iomgr.h" #include "src/core/iomgr/iomgr_internal.h" @@ -48,4 +48,4 @@ void grpc_iomgr_unref(void); void grpc_iomgr_platform_init(void); void grpc_iomgr_platform_shutdown(void); -#endif /* __GRPC_INTERNAL_IOMGR_IOMGR_INTERNAL_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_IOMGR_INTERNAL_H */ diff --git a/src/core/iomgr/iomgr_posix.h b/src/core/iomgr/iomgr_posix.h index f9e9b3d6ee4..a404f6433ec 100644 --- a/src/core/iomgr/iomgr_posix.h +++ b/src/core/iomgr/iomgr_posix.h @@ -31,12 +31,12 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_IOMGR_POSIX_H_ -#define __GRPC_INTERNAL_IOMGR_IOMGR_POSIX_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_IOMGR_POSIX_H +#define GRPC_INTERNAL_CORE_IOMGR_IOMGR_POSIX_H #include "src/core/iomgr/iomgr_internal.h" void grpc_pollset_global_init(void); void grpc_pollset_global_shutdown(void); -#endif /* __GRPC_INTERNAL_IOMGR_IOMGR_POSIX_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_IOMGR_POSIX_H */ diff --git a/src/core/iomgr/pollset.h b/src/core/iomgr/pollset.h index c26947f37cb..067af87c931 100644 --- a/src/core/iomgr/pollset.h +++ b/src/core/iomgr/pollset.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_POLLSET_H_ -#define __GRPC_INTERNAL_IOMGR_POLLSET_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_H +#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_H #include #include @@ -71,4 +71,4 @@ int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline); Requires GRPC_POLLSET_MU(pollset) locked. */ void grpc_pollset_kick(grpc_pollset *pollset); -#endif /* __GRPC_INTERNAL_IOMGR_POLLSET_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_H */ diff --git a/src/core/iomgr/pollset_kick.h b/src/core/iomgr/pollset_kick.h index b224177d317..cc9357de1fc 100644 --- a/src/core/iomgr/pollset_kick.h +++ b/src/core/iomgr/pollset_kick.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_POLLSET_KICK_H_ -#define __GRPC_INTERNAL_IOMGR_POLLSET_KICK_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_H +#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_H #include @@ -71,4 +71,4 @@ void grpc_pollset_kick_post_poll(grpc_pollset_kick_state *kick_state); void grpc_pollset_kick_kick(grpc_pollset_kick_state *kick_state); -#endif /* __GRPC_INTERNAL_IOMGR_POLLSET_KICK_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_H */ diff --git a/src/core/iomgr/pollset_kick_posix.h b/src/core/iomgr/pollset_kick_posix.h index 162ae5bd8f1..427699198c3 100644 --- a/src/core/iomgr/pollset_kick_posix.h +++ b/src/core/iomgr/pollset_kick_posix.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_POLLSET_KICK_POSIX_H_ -#define __GRPC_INTERNAL_IOMGR_POLLSET_KICK_POSIX_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_POSIX_H +#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_POSIX_H #include "src/core/iomgr/wakeup_fd_posix.h" #include @@ -48,4 +48,4 @@ typedef struct grpc_pollset_kick_state { struct grpc_kick_fd_info *fd_info; } grpc_pollset_kick_state; -#endif /* __GRPC_INTERNALIOMGR_POLLSET_KICK_POSIX_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_POSIX_H */ diff --git a/src/core/iomgr/pollset_kick_windows.h b/src/core/iomgr/pollset_kick_windows.h index 1053230a983..3836aa00820 100644 --- a/src/core/iomgr/pollset_kick_windows.h +++ b/src/core/iomgr/pollset_kick_windows.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_POLLSET_KICK_WINDOWS_H_ -#define __GRPC_INTERNAL_IOMGR_POLLSET_KICK_WINDOWS_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_WINDOWS_H +#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_WINDOWS_H #include @@ -42,4 +42,4 @@ typedef struct grpc_pollset_kick_state { int unused; } grpc_pollset_kick_state; -#endif /* __GRPC_INTERNALIOMGR_POLLSET_KICK_WINDOWS_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_WINDOWS_H */ diff --git a/src/core/iomgr/pollset_posix.h b/src/core/iomgr/pollset_posix.h index 86b6c9f20e8..da843f7381c 100644 --- a/src/core/iomgr/pollset_posix.h +++ b/src/core/iomgr/pollset_posix.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_POLLSET_POSIX_H_ -#define __GRPC_INTERNAL_IOMGR_POLLSET_POSIX_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_POSIX_H +#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_POSIX_H #include @@ -104,4 +104,4 @@ grpc_pollset *grpc_backup_pollset(void); void grpc_platform_become_multipoller(grpc_pollset *pollset, struct grpc_fd **fds, size_t fd_count); -#endif /* __GRPC_INTERNAL_IOMGR_POLLSET_POSIX_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_POSIX_H */ diff --git a/src/core/iomgr/pollset_windows.h b/src/core/iomgr/pollset_windows.h index 41c193fcad0..266175abfb9 100644 --- a/src/core/iomgr/pollset_windows.h +++ b/src/core/iomgr/pollset_windows.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_POLLSET_WINDOWS_H_ -#define __GRPC_INTERNAL_IOMGR_POLLSET_WINDOWS_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H +#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H #include #include @@ -53,4 +53,4 @@ typedef struct grpc_pollset { #define GRPC_POLLSET_MU(pollset) (&(pollset)->mu) #define GRPC_POLLSET_CV(pollset) (&(pollset)->cv) -#endif /* __GRPC_INTERNAL_IOMGR_POLLSET_WINDOWS_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H */ diff --git a/src/core/iomgr/resolve_address.h b/src/core/iomgr/resolve_address.h index 65432ec61aa..8f1d7a22bb1 100644 --- a/src/core/iomgr/resolve_address.h +++ b/src/core/iomgr/resolve_address.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_RESOLVE_ADDRESS_H__ -#define __GRPC_INTERNAL_IOMGR_RESOLVE_ADDRESS_H__ +#ifndef GRPC_INTERNAL_CORE_IOMGR_RESOLVE_ADDRESS_H +#define GRPC_INTERNAL_CORE_IOMGR_RESOLVE_ADDRESS_H #include @@ -66,4 +66,4 @@ void grpc_resolved_addresses_destroy(grpc_resolved_addresses *addresses); grpc_resolved_addresses *grpc_blocking_resolve_address( const char *addr, const char *default_port); -#endif /* __GRPC_INTERNAL_IOMGR_RESOLVE_ADDRESS_H__ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_RESOLVE_ADDRESS_H */ diff --git a/src/core/iomgr/sockaddr.h b/src/core/iomgr/sockaddr.h index a5f7c546ecf..7528db73b81 100644 --- a/src/core/iomgr/sockaddr.h +++ b/src/core/iomgr/sockaddr.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_SOCKADDR_H_ -#define __GRPC_INTERNAL_IOMGR_SOCKADDR_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_H +#define GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_H #include @@ -44,4 +44,4 @@ #include "src/core/iomgr/sockaddr_posix.h" #endif -#endif /* __GRPC_INTERNAL_IOMGR_SOCKADDR_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_H */ diff --git a/src/core/iomgr/sockaddr_posix.h b/src/core/iomgr/sockaddr_posix.h index 00115e25368..2a3d932f700 100644 --- a/src/core/iomgr/sockaddr_posix.h +++ b/src/core/iomgr/sockaddr_posix.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_SOCKADDR_POSIX_H_ -#define __GRPC_INTERNAL_IOMGR_SOCKADDR_POSIX_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_POSIX_H +#define GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_POSIX_H #include #include @@ -41,4 +41,4 @@ #include #include -#endif /* __GRPC_INTERNAL_IOMGR_SOCKADDR_POSIX_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_POSIX_H */ diff --git a/src/core/iomgr/sockaddr_utils.h b/src/core/iomgr/sockaddr_utils.h index d3a25ad373b..bdfb83479b4 100644 --- a/src/core/iomgr/sockaddr_utils.h +++ b/src/core/iomgr/sockaddr_utils.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_SOCKADDR_UTILS_H__ -#define __GRPC_INTERNAL_IOMGR_SOCKADDR_UTILS_H__ +#ifndef GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_UTILS_H +#define GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_UTILS_H #include "src/core/iomgr/sockaddr.h" @@ -84,4 +84,4 @@ int grpc_sockaddr_set_port(const struct sockaddr *addr, int port); int grpc_sockaddr_to_string(char **out, const struct sockaddr *addr, int normalize); -#endif /* __GRPC_INTERNAL_IOMGR_SOCKADDR_UTILS_H__ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_UTILS_H */ diff --git a/src/core/iomgr/sockaddr_win32.h b/src/core/iomgr/sockaddr_win32.h index 6ed164ced1d..3a5f27bb345 100644 --- a/src/core/iomgr/sockaddr_win32.h +++ b/src/core/iomgr/sockaddr_win32.h @@ -31,11 +31,11 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_SOCKADDR_WIN32_H_ -#define __GRPC_INTERNAL_IOMGR_SOCKADDR_WIN32_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_WIN32_H +#define GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_WIN32_H #include #include #include -#endif /* __GRPC_INTERNAL_IOMGR_SOCKADDR_WIN32_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_WIN32_H */ diff --git a/src/core/iomgr/socket_utils_posix.h b/src/core/iomgr/socket_utils_posix.h index b35fe785f1a..c161082afc0 100644 --- a/src/core/iomgr/socket_utils_posix.h +++ b/src/core/iomgr/socket_utils_posix.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_SOCKET_UTILS_POSIX_H__ -#define __GRPC_INTERNAL_IOMGR_SOCKET_UTILS_POSIX_H__ +#ifndef GRPC_INTERNAL_CORE_IOMGR_SOCKET_UTILS_POSIX_H +#define GRPC_INTERNAL_CORE_IOMGR_SOCKET_UTILS_POSIX_H #include #include @@ -105,4 +105,4 @@ extern int grpc_forbid_dualstack_sockets_for_testing; int grpc_create_dualstack_socket(const struct sockaddr *addr, int type, int protocol, grpc_dualstack_mode *dsmode); -#endif /* __GRPC_INTERNAL_IOMGR_SOCKET_UTILS_POSIX_H__ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_SOCKET_UTILS_POSIX_H */ diff --git a/src/core/iomgr/socket_windows.h b/src/core/iomgr/socket_windows.h index de80e97e7f6..d4776ab10f8 100644 --- a/src/core/iomgr/socket_windows.h +++ b/src/core/iomgr/socket_windows.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_HANDLE_WINDOWS_H__ -#define __GRPC_INTERNAL_IOMGR_HANDLE_WINDOWS_H__ +#ifndef GRPC_INTERNAL_CORE_IOMGR_SOCKET_WINDOWS_H +#define GRPC_INTERNAL_CORE_IOMGR_SOCKET_WINDOWS_H #include @@ -72,4 +72,4 @@ grpc_winsocket *grpc_winsocket_create(SOCKET socket); void grpc_winsocket_shutdown(grpc_winsocket *socket); void grpc_winsocket_orphan(grpc_winsocket *socket); -#endif /* __GRPC_INTERNAL_IOMGR_HANDLE_WINDOWS_H__ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_SOCKET_WINDOWS_H */ diff --git a/src/core/iomgr/tcp_client.h b/src/core/iomgr/tcp_client.h index c919c02440f..2e91497fb7d 100644 --- a/src/core/iomgr/tcp_client.h +++ b/src/core/iomgr/tcp_client.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_TCP_CLIENT_H__ -#define __GRPC_INTERNAL_IOMGR_TCP_CLIENT_H__ +#ifndef GRPC_INTERNAL_CORE_IOMGR_TCP_CLIENT_H +#define GRPC_INTERNAL_CORE_IOMGR_TCP_CLIENT_H #include "src/core/iomgr/endpoint.h" #include "src/core/iomgr/sockaddr.h" @@ -45,4 +45,4 @@ void grpc_tcp_client_connect(void (*cb)(void *arg, grpc_endpoint *tcp), void *arg, const struct sockaddr *addr, int addr_len, gpr_timespec deadline); -#endif /* __GRPC_INTERNAL_IOMGR_TCP_CLIENT_H__ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_TCP_CLIENT_H */ diff --git a/src/core/iomgr/tcp_posix.h b/src/core/iomgr/tcp_posix.h index 6ff87704efb..7e8064bffc7 100644 --- a/src/core/iomgr/tcp_posix.h +++ b/src/core/iomgr/tcp_posix.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_TCP_POSIX_H__ -#define __GRPC_INTERNAL_IOMGR_TCP_POSIX_H__ +#ifndef GRPC_INTERNAL_CORE_IOMGR_TCP_POSIX_H +#define GRPC_INTERNAL_CORE_IOMGR_TCP_POSIX_H /* Low level TCP "bottom half" implementation, for use by transports built on top of a TCP connection. @@ -53,4 +53,4 @@ Takes ownership of fd. */ grpc_endpoint *grpc_tcp_create(grpc_fd *fd, size_t read_slice_size); -#endif /* __GRPC_INTERNAL_IOMGR_TCP_POSIX_H__ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_TCP_POSIX_H */ diff --git a/src/core/iomgr/tcp_server.h b/src/core/iomgr/tcp_server.h index c1e5f45208d..68ee85c5a7f 100644 --- a/src/core/iomgr/tcp_server.h +++ b/src/core/iomgr/tcp_server.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_TCP_SERVER_H__ -#define __GRPC_INTERNAL_IOMGR_TCP_SERVER_H__ +#ifndef GRPC_INTERNAL_CORE_IOMGR_TCP_SERVER_H +#define GRPC_INTERNAL_CORE_IOMGR_TCP_SERVER_H #include "src/core/iomgr/endpoint.h" @@ -73,4 +73,4 @@ int grpc_tcp_server_get_fd(grpc_tcp_server *s, unsigned index); void grpc_tcp_server_destroy(grpc_tcp_server *server); -#endif /* __GRPC_INTERNAL_IOMGR_TCP_SERVER_H__ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_TCP_SERVER_H */ diff --git a/src/core/iomgr/tcp_windows.h b/src/core/iomgr/tcp_windows.h index 565d42e5b29..4cbc12c53aa 100644 --- a/src/core/iomgr/tcp_windows.h +++ b/src/core/iomgr/tcp_windows.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_TCP_WINDOWS_H__ -#define __GRPC_INTERNAL_IOMGR_TCP_WINDOWS_H__ +#ifndef GRPC_INTERNAL_CORE_IOMGR_TCP_WINDOWS_H +#define GRPC_INTERNAL_CORE_IOMGR_TCP_WINDOWS_H /* Low level TCP "bottom half" implementation, for use by transports built on top of a TCP connection. @@ -54,4 +54,4 @@ grpc_endpoint *grpc_tcp_create(grpc_winsocket *socket); int grpc_tcp_prepare_socket(SOCKET sock); -#endif /* __GRPC_INTERNAL_IOMGR_TCP_WINDOWS_H__ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_TCP_WINDOWS_H */ diff --git a/src/core/iomgr/time_averaged_stats.h b/src/core/iomgr/time_averaged_stats.h index e901f3c33b3..13894b26408 100644 --- a/src/core/iomgr/time_averaged_stats.h +++ b/src/core/iomgr/time_averaged_stats.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_TIME_AVERAGED_STATS_H_ -#define __GRPC_INTERNAL_IOMGR_TIME_AVERAGED_STATS_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_TIME_AVERAGED_STATS_H +#define GRPC_INTERNAL_CORE_IOMGR_TIME_AVERAGED_STATS_H /* This tracks a time-decaying weighted average. It works by collecting batches of samples and then mixing their average into a time-decaying @@ -85,4 +85,4 @@ void grpc_time_averaged_stats_add_sample(grpc_time_averaged_stats *stats, value. */ double grpc_time_averaged_stats_update_average(grpc_time_averaged_stats *stats); -#endif /* __GRPC_INTERNAL_IOMGR_TIME_AVERAGED_STATS_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_TIME_AVERAGED_STATS_H */ diff --git a/src/core/iomgr/wakeup_fd_pipe.h b/src/core/iomgr/wakeup_fd_pipe.h index a2fcde5b55f..aa8f977ddb8 100644 --- a/src/core/iomgr/wakeup_fd_pipe.h +++ b/src/core/iomgr/wakeup_fd_pipe.h @@ -31,11 +31,11 @@ * */ -#ifndef __GRPC_INTERNAL_IOMGR_WAKEUP_FD_PIPE_H_ -#define __GRPC_INTERNAL_IOMGR_WAKEUP_FD_PIPE_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_WAKEUP_FD_PIPE_H +#define GRPC_INTERNAL_CORE_IOMGR_WAKEUP_FD_PIPE_H #include "src/core/iomgr/wakeup_fd_posix.h" extern grpc_wakeup_fd_vtable grpc_pipe_wakeup_fd_vtable; -#endif /* __GRPC_INTERNAL_IOMGR_WAKEUP_FD_PIPE_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_WAKEUP_FD_PIPE_H */ diff --git a/src/core/iomgr/wakeup_fd_posix.h b/src/core/iomgr/wakeup_fd_posix.h index 75bb9fc766c..1b0ff70c7f5 100644 --- a/src/core/iomgr/wakeup_fd_posix.h +++ b/src/core/iomgr/wakeup_fd_posix.h @@ -59,8 +59,8 @@ * 2. If the polling thread was awakened by a wakeup_fd event, call * grpc_wakeup_fd_consume_wakeup() on it. */ -#ifndef __GRPC_INTERNAL_IOMGR_WAKEUP_FD_POSIX_H_ -#define __GRPC_INTERNAL_IOMGR_WAKEUP_FD_POSIX_H_ +#ifndef GRPC_INTERNAL_CORE_IOMGR_WAKEUP_FD_POSIX_H +#define GRPC_INTERNAL_CORE_IOMGR_WAKEUP_FD_POSIX_H void grpc_wakeup_fd_global_init(void); void grpc_wakeup_fd_global_destroy(void); @@ -96,4 +96,4 @@ void grpc_wakeup_fd_destroy(grpc_wakeup_fd_info *fd_info); * wakeup_fd_nospecial.c if no such implementation exists. */ extern const grpc_wakeup_fd_vtable grpc_specialized_wakeup_fd_vtable; -#endif /* __GRPC_INTERNAL_IOMGR_WAKEUP_FD_POSIX_H_ */ +#endif /* GRPC_INTERNAL_CORE_IOMGR_WAKEUP_FD_POSIX_H */ diff --git a/src/core/json/json.h b/src/core/json/json.h index dc519e9d5ec..69cbac17dc3 100644 --- a/src/core/json/json.h +++ b/src/core/json/json.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SRC_CORE_JSON_JSON_H__ -#define __GRPC_SRC_CORE_JSON_JSON_H__ +#ifndef GRPC_INTERNAL_CORE_JSON_JSON_H +#define GRPC_INTERNAL_CORE_JSON_JSON_H #include @@ -85,4 +85,4 @@ char* grpc_json_dump_to_string(grpc_json* json, int indent); grpc_json* grpc_json_create(grpc_json_type type); void grpc_json_destroy(grpc_json* json); -#endif /* __GRPC_SRC_CORE_JSON_JSON_H__ */ +#endif /* GRPC_INTERNAL_CORE_JSON_JSON_H */ diff --git a/src/core/json/json_common.h b/src/core/json/json_common.h index 60763cc72ea..84bf3759169 100644 --- a/src/core/json/json_common.h +++ b/src/core/json/json_common.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SRC_CORE_JSON_JSON_COMMON_H__ -#define __GRPC_SRC_CORE_JSON_JSON_COMMON_H__ +#ifndef GRPC_INTERNAL_CORE_JSON_JSON_COMMON_H +#define GRPC_INTERNAL_CORE_JSON_JSON_COMMON_H /* The various json types. */ typedef enum { @@ -46,4 +46,4 @@ typedef enum { GRPC_JSON_TOP_LEVEL } grpc_json_type; -#endif /* __GRPC_SRC_CORE_JSON_JSON_COMMON_H__ */ +#endif /* GRPC_INTERNAL_CORE_JSON_JSON_COMMON_H */ diff --git a/src/core/json/json_reader.h b/src/core/json/json_reader.h index f7f59127f93..b1a5ace8fb5 100644 --- a/src/core/json/json_reader.h +++ b/src/core/json/json_reader.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SRC_CORE_JSON_JSON_READER_H__ -#define __GRPC_SRC_CORE_JSON_JSON_READER_H__ +#ifndef GRPC_INTERNAL_CORE_JSON_JSON_READER_H +#define GRPC_INTERNAL_CORE_JSON_JSON_READER_H #include #include "src/core/json/json_common.h" @@ -157,4 +157,4 @@ void grpc_json_reader_init(grpc_json_reader* reader, */ int grpc_json_reader_is_complete(grpc_json_reader* reader); -#endif /* __GRPC_SRC_CORE_JSON_JSON_READER_H__ */ +#endif /* GRPC_INTERNAL_CORE_JSON_JSON_READER_H */ diff --git a/src/core/json/json_writer.h b/src/core/json/json_writer.h index 5d5d0891a3c..dfa61a5fefc 100644 --- a/src/core/json/json_writer.h +++ b/src/core/json/json_writer.h @@ -43,8 +43,8 @@ * a valid UTF-8 string overall. */ -#ifndef __GRPC_SRC_CORE_JSON_JSON_WRITER_H__ -#define __GRPC_SRC_CORE_JSON_JSON_WRITER_H__ +#ifndef GRPC_INTERNAL_CORE_JSON_JSON_WRITER_H +#define GRPC_INTERNAL_CORE_JSON_JSON_WRITER_H #include @@ -90,4 +90,4 @@ void grpc_json_writer_value_raw_with_len(grpc_json_writer* writer, const char* s /* Sets a string value. It'll be escaped, and utf-8 validated. */ void grpc_json_writer_value_string(grpc_json_writer* writer, const char* string); -#endif /* __GRPC_SRC_CORE_JSON_JSON_WRITER_H__ */ +#endif /* GRPC_INTERNAL_CORE_JSON_JSON_WRITER_H */ diff --git a/src/core/security/auth.h b/src/core/security/auth.h index fee75c40e1c..08dc4152ba4 100644 --- a/src/core/security/auth.h +++ b/src/core/security/auth.h @@ -31,11 +31,11 @@ * */ -#ifndef __GRPC_INTERNAL_SECURITY_AUTH_H__ -#define __GRPC_INTERNAL_SECURITY_AUTH_H__ +#ifndef GRPC_INTERNAL_CORE_SECURITY_AUTH_H +#define GRPC_INTERNAL_CORE_SECURITY_AUTH_H #include "src/core/channel/channel_stack.h" extern const grpc_channel_filter grpc_client_auth_filter; -#endif /* __GRPC_INTERNAL_SECURITY_AUTH_H__ */ +#endif /* GRPC_INTERNAL_CORE_SECURITY_AUTH_H */ diff --git a/src/core/security/base64.h b/src/core/security/base64.h index 0eb69d0ccb3..6a7cd8e96ce 100644 --- a/src/core/security/base64.h +++ b/src/core/security/base64.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SECURITY_BASE64_H_ -#define __GRPC_INTERNAL_SECURITY_BASE64_H_ +#ifndef GRPC_INTERNAL_CORE_SECURITY_BASE64_H +#define GRPC_INTERNAL_CORE_SECURITY_BASE64_H #include @@ -45,4 +45,4 @@ char *grpc_base64_encode(const void *data, size_t data_size, int url_safe, slice in case of failure. */ gpr_slice grpc_base64_decode(const char *b64, int url_safe); -#endif /* __GRPC_INTERNAL_SECURITY_BASE64_H_ */ +#endif /* GRPC_INTERNAL_CORE_SECURITY_BASE64_H */ diff --git a/src/core/security/credentials.h b/src/core/security/credentials.h index 0a0074c1d53..454e66845d1 100644 --- a/src/core/security/credentials.h +++ b/src/core/security/credentials.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SECURITY_CREDENTIALS_H__ -#define __GRPC_INTERNAL_SECURITY_CREDENTIALS_H__ +#ifndef GRPC_INTERNAL_CORE_SECURITY_CREDENTIALS_H +#define GRPC_INTERNAL_CORE_SECURITY_CREDENTIALS_H #include "src/core/transport/stream_op.h" #include @@ -160,4 +160,4 @@ typedef struct { const grpc_ssl_server_config *grpc_ssl_server_credentials_get_config( const grpc_server_credentials *ssl_creds); -#endif /* __GRPC_INTERNAL_SECURITY_CREDENTIALS_H__ */ +#endif /* GRPC_INTERNAL_CORE_SECURITY_CREDENTIALS_H */ diff --git a/src/core/security/json_token.h b/src/core/security/json_token.h index 1ef9682f528..029ede39558 100644 --- a/src/core/security/json_token.h +++ b/src/core/security/json_token.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SECURITY_JSON_TOKEN_H_ -#define __GRPC_INTERNAL_SECURITY_JSON_TOKEN_H_ +#ifndef GRPC_INTERNAL_CORE_SECURITY_JSON_TOKEN_H +#define GRPC_INTERNAL_CORE_SECURITY_JSON_TOKEN_H #include #include @@ -79,4 +79,4 @@ typedef char *(*grpc_jwt_encode_and_sign_override)( void grpc_jwt_encode_and_sign_set_override( grpc_jwt_encode_and_sign_override func); -#endif /* __GRPC_INTERNAL_SECURITY_JSON_TOKEN_H_ */ +#endif /* GRPC_INTERNAL_CORE_SECURITY_JSON_TOKEN_H */ diff --git a/src/core/security/secure_endpoint.h b/src/core/security/secure_endpoint.h index 82ba4082e32..808889bf047 100644 --- a/src/core/security/secure_endpoint.h +++ b/src/core/security/secure_endpoint.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_ENDPOINT_SECURE_ENDPOINT_H__ -#define __GRPC_INTERNAL_ENDPOINT_SECURE_ENDPOINT_H__ +#ifndef GRPC_INTERNAL_CORE_SECURITY_SECURE_ENDPOINT_H +#define GRPC_INTERNAL_CORE_SECURITY_SECURE_ENDPOINT_H #include "src/core/iomgr/endpoint.h" #include @@ -44,4 +44,4 @@ grpc_endpoint *grpc_secure_endpoint_create( struct tsi_frame_protector *protector, grpc_endpoint *to_wrap, gpr_slice *leftover_slices, size_t leftover_nslices); -#endif /* __GRPC_INTERNAL_ENDPOINT_SECURE_ENDPOINT_H__ */ +#endif /* GRPC_INTERNAL_CORE_SECURITY_SECURE_ENDPOINT_H */ diff --git a/src/core/security/secure_transport_setup.h b/src/core/security/secure_transport_setup.h index 21f41fd6822..e1f8ed7830d 100644 --- a/src/core/security/secure_transport_setup.h +++ b/src/core/security/secure_transport_setup.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SECURITY_SECURE_TRANSPORT_SETUP_H__ -#define __GRPC_INTERNAL_SECURITY_SECURE_TRANSPORT_SETUP_H__ +#ifndef GRPC_INTERNAL_CORE_SECURITY_SECURE_TRANSPORT_SETUP_H +#define GRPC_INTERNAL_CORE_SECURITY_SECURE_TRANSPORT_SETUP_H #include "src/core/iomgr/endpoint.h" #include "src/core/security/security_context.h" @@ -50,4 +50,4 @@ void grpc_setup_secure_transport(grpc_security_context *ctx, grpc_secure_transport_setup_done_cb cb, void *user_data); -#endif /* __GRPC_INTERNAL_SECURITY_SECURE_TRANSPORT_SETUP_H__ */ +#endif /* GRPC_INTERNAL_CORE_SECURITY_SECURE_TRANSPORT_SETUP_H */ diff --git a/src/core/security/security_context.h b/src/core/security/security_context.h index 40e2daceb80..0b5821c3c08 100644 --- a/src/core/security/security_context.h +++ b/src/core/security/security_context.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SECURITY_SECURITY_CONTEXT_H__ -#define __GRPC_INTERNAL_SECURITY_SECURITY_CONTEXT_H__ +#ifndef GRPC_INTERNAL_CORE_SECURITY_SECURITY_CONTEXT_H +#define GRPC_INTERNAL_CORE_SECURITY_SECURITY_CONTEXT_H #include #include "src/core/iomgr/endpoint.h" @@ -212,4 +212,4 @@ grpc_server *grpc_secure_server_create_internal(grpc_completion_queue *cq, const grpc_channel_args *args, grpc_security_context *ctx); -#endif /* __GRPC_INTERNAL_SECURITY_SECURITY_CONTEXT_H__ */ +#endif /* GRPC_INTERNAL_CORE_SECURITY_SECURITY_CONTEXT_H */ diff --git a/src/core/statistics/census_interface.h b/src/core/statistics/census_interface.h index 0bb0a9f328d..eb4349c3115 100644 --- a/src/core/statistics/census_interface.h +++ b/src/core/statistics/census_interface.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_STATISTICS_CENSUS_INTERFACE_H__ -#define __GRPC_INTERNAL_STATISTICS_CENSUS_INTERFACE_H__ +#ifndef GRPC_INTERNAL_CORE_STATISTICS_CENSUS_INTERFACE_H +#define GRPC_INTERNAL_CORE_STATISTICS_CENSUS_INTERFACE_H #include @@ -73,4 +73,4 @@ census_op_id census_tracing_start_op(void); /* Ends tracing. Calling this function will invalidate the input op_id. */ void census_tracing_end_op(census_op_id op_id); -#endif /* __GRPC_INTERNAL_STATISTICS_CENSUS_INTERFACE_H__ */ +#endif /* GRPC_INTERNAL_CORE_STATISTICS_CENSUS_INTERFACE_H */ diff --git a/src/core/statistics/census_log.h b/src/core/statistics/census_log.h index 01fd63aca39..06869b7a33a 100644 --- a/src/core/statistics/census_log.h +++ b/src/core/statistics/census_log.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_STATISTICS_LOG_H__ -#define __GRPC_INTERNAL_STATISTICS_LOG_H__ +#ifndef GRPC_INTERNAL_CORE_STATISTICS_CENSUS_LOG_H +#define GRPC_INTERNAL_CORE_STATISTICS_CENSUS_LOG_H #include @@ -88,4 +88,4 @@ size_t census_log_remaining_space(void); out-of-space. */ int census_log_out_of_space_count(void); -#endif /* __GRPC_INTERNAL_STATISTICS_LOG_H__ */ +#endif /* GRPC_INTERNAL_CORE_STATISTICS_CENSUS_LOG_H */ diff --git a/src/core/statistics/census_rpc_stats.h b/src/core/statistics/census_rpc_stats.h index 942de81b888..9336dce1f85 100644 --- a/src/core/statistics/census_rpc_stats.h +++ b/src/core/statistics/census_rpc_stats.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_STATISTICS_CENSUS_RPC_STATS_H__ -#define __GRPC_INTERNAL_STATISTICS_CENSUS_RPC_STATS_H__ +#ifndef GRPC_INTERNAL_CORE_STATISTICS_CENSUS_RPC_STATS_H +#define GRPC_INTERNAL_CORE_STATISTICS_CENSUS_RPC_STATS_H #include "src/core/statistics/census_interface.h" #include @@ -98,4 +98,4 @@ void census_stats_store_shutdown(void); } #endif -#endif /* __GRPC_INTERNAL_STATISTICS_CENSUS_RPC_STATS_H__ */ +#endif /* GRPC_INTERNAL_CORE_STATISTICS_CENSUS_RPC_STATS_H */ diff --git a/src/core/statistics/census_tracing.h b/src/core/statistics/census_tracing.h index 51aa578c0c1..a4494b510c2 100644 --- a/src/core/statistics/census_tracing.h +++ b/src/core/statistics/census_tracing.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_STATISTICS_CENSUS_TRACING_H_ -#define __GRPC_INTERNAL_STATISTICS_CENSUS_TRACING_H_ +#ifndef GRPC_INTERNAL_CORE_STATISTICS_CENSUS_TRACING_H +#define GRPC_INTERNAL_CORE_STATISTICS_CENSUS_TRACING_H #include #include "src/core/statistics/census_rpc_stats.h" @@ -93,4 +93,4 @@ census_trace_obj** census_get_active_ops(int* num_active_ops); } #endif -#endif /* __GRPC_INTERNAL_STATISTICS_CENSUS_TRACING_H_ */ +#endif /* GRPC_INTERNAL_CORE_STATISTICS_CENSUS_TRACING_H */ diff --git a/src/core/statistics/hash_table.h b/src/core/statistics/hash_table.h index 2c2386d1ab1..7bcb4bcd9bd 100644 --- a/src/core/statistics/hash_table.h +++ b/src/core/statistics/hash_table.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_STATISTICS_HASH_TABLE_H_ -#define __GRPC_INTERNAL_STATISTICS_HASH_TABLE_H_ +#ifndef GRPC_INTERNAL_CORE_STATISTICS_HASH_TABLE_H +#define GRPC_INTERNAL_CORE_STATISTICS_HASH_TABLE_H #include @@ -128,4 +128,4 @@ typedef void (*census_ht_itr_cb)(census_ht_key key, const void* val_ptr, should not invalidate data entries. */ gpr_uint64 census_ht_for_all(const census_ht* ht, census_ht_itr_cb); -#endif /* __GRPC_INTERNAL_STATISTICS_HASH_TABLE_H_ */ +#endif /* GRPC_INTERNAL_CORE_STATISTICS_HASH_TABLE_H */ diff --git a/src/core/statistics/window_stats.h b/src/core/statistics/window_stats.h index 98f8dac5595..d733d8d247a 100644 --- a/src/core/statistics/window_stats.h +++ b/src/core/statistics/window_stats.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_STATISTICS_WINDOW_STATS_H_ -#define __GRPC_INTERNAL_STATISTICS_WINDOW_STATS_H_ +#ifndef GRPC_INTERNAL_CORE_STATISTICS_WINDOW_STATS_H +#define GRPC_INTERNAL_CORE_STATISTICS_WINDOW_STATS_H #include @@ -170,4 +170,4 @@ void census_window_stats_get_sums(const struct census_window_stats* wstats, assertion failure). This function is thread-compatible. */ void census_window_stats_destroy(struct census_window_stats* wstats); -#endif /* __GRPC_INTERNAL_STATISTICS_WINDOW_STATS_H_ */ +#endif /* GRPC_INTERNAL_CORE_STATISTICS_WINDOW_STATS_H */ diff --git a/src/core/support/env.h b/src/core/support/env.h index 0c6091b84b8..4f2e394d140 100644 --- a/src/core/support/env.h +++ b/src/core/support/env.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_ENV_H__ -#define __GRPC_SUPPORT_ENV_H__ +#ifndef GRPC_INTERNAL_CORE_SUPPORT_ENV_H +#define GRPC_INTERNAL_CORE_SUPPORT_ENV_H #include @@ -57,4 +57,4 @@ void gpr_setenv(const char *name, const char *value); } #endif -#endif /* __GRPC_SUPPORT_ENV_H__ */ +#endif /* GRPC_INTERNAL_CORE_SUPPORT_ENV_H */ diff --git a/src/core/support/file.h b/src/core/support/file.h index 600850e03d4..ee6ca7b2304 100644 --- a/src/core/support/file.h +++ b/src/core/support/file.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_FILE_H__ -#define __GRPC_SUPPORT_FILE_H__ +#ifndef GRPC_INTERNAL_CORE_SUPPORT_FILE_H +#define GRPC_INTERNAL_CORE_SUPPORT_FILE_H #include @@ -58,4 +58,4 @@ FILE *gpr_tmpfile(const char *prefix, char **tmp_filename); } #endif -#endif /* __GRPC_SUPPORT_FILE_H__ */ +#endif /* GRPC_INTERNAL_CORE_SUPPORT_FILE_H */ diff --git a/src/core/support/murmur_hash.h b/src/core/support/murmur_hash.h index 06c0c560797..85ab2fe4bfd 100644 --- a/src/core/support/murmur_hash.h +++ b/src/core/support/murmur_hash.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SUPPORT_MURMUR_HASH_H__ -#define __GRPC_INTERNAL_SUPPORT_MURMUR_HASH_H__ +#ifndef GRPC_INTERNAL_CORE_SUPPORT_MURMUR_HASH_H +#define GRPC_INTERNAL_CORE_SUPPORT_MURMUR_HASH_H #include @@ -41,4 +41,4 @@ /* compute the hash of key (length len) */ gpr_uint32 gpr_murmur_hash3(const void *key, size_t len, gpr_uint32 seed); -#endif /* __GRPC_INTERNAL_SUPPORT_MURMUR_HASH_H__ */ +#endif /* GRPC_INTERNAL_CORE_SUPPORT_MURMUR_HASH_H */ diff --git a/src/core/support/string.h b/src/core/support/string.h index eaa18264392..faf33427083 100644 --- a/src/core/support/string.h +++ b/src/core/support/string.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_STRING_H__ -#define __GRPC_SUPPORT_STRING_H__ +#ifndef GRPC_INTERNAL_CORE_SUPPORT_STRING_H +#define GRPC_INTERNAL_CORE_SUPPORT_STRING_H #include @@ -106,4 +106,4 @@ char *gpr_strvec_flatten(gpr_strvec *strs, size_t *total_length); } #endif -#endif /* __GRPC_SUPPORT_STRING_H__ */ +#endif /* GRPC_INTERNAL_CORE_SUPPORT_STRING_H */ diff --git a/src/core/support/string_win32.h b/src/core/support/string_win32.h index 5dbb40dbc3b..0bc3247d9da 100644 --- a/src/core/support/string_win32.h +++ b/src/core/support/string_win32.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_SUPPORT_STRING_WIN32_H__ -#define __GRPC_SUPPORT_STRING_WIN32_H__ +#ifndef GRPC_INTERNAL_CORE_SUPPORT_STRING_WIN32_H +#define GRPC_INTERNAL_CORE_SUPPORT_STRING_WIN32_H #include @@ -46,4 +46,4 @@ LPSTR gpr_tchar_to_char(LPCTSTR input); #endif /* GPR_WIN32 */ -#endif /* __GRPC_SUPPORT_STRING_WIN32_H__ */ +#endif /* GRPC_INTERNAL_CORE_SUPPORT_STRING_WIN32_H */ diff --git a/src/core/support/thd_internal.h b/src/core/support/thd_internal.h index 0fb1447e488..4683c37742e 100644 --- a/src/core/support/thd_internal.h +++ b/src/core/support/thd_internal.h @@ -31,9 +31,9 @@ * */ -#ifndef __GRPC_INTERNAL_SUPPORT_THD_INTERNAL_H__ -#define __GRPC_INTERNAL_SUPPORT_THD_INTERNAL_H__ +#ifndef GRPC_INTERNAL_CORE_SUPPORT_THD_INTERNAL_H +#define GRPC_INTERNAL_CORE_SUPPORT_THD_INTERNAL_H /* Internal interfaces between modules within the gpr support library. */ -#endif /* __GRPC_INTERNAL_SUPPORT_THD_INTERNAL_H__ */ +#endif /* GRPC_INTERNAL_CORE_SUPPORT_THD_INTERNAL_H */ diff --git a/src/core/surface/byte_buffer_queue.h b/src/core/surface/byte_buffer_queue.h index 9d3b5257a7a..32c57f87563 100644 --- a/src/core/surface/byte_buffer_queue.h +++ b/src/core/surface/byte_buffer_queue.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SURFACE_BYTE_BUFFER_QUEUE_H__ -#define __GRPC_INTERNAL_SURFACE_BYTE_BUFFER_QUEUE_H__ +#ifndef GRPC_INTERNAL_CORE_SURFACE_BYTE_BUFFER_QUEUE_H +#define GRPC_INTERNAL_CORE_SURFACE_BYTE_BUFFER_QUEUE_H #include @@ -57,4 +57,4 @@ void grpc_bbq_flush(grpc_byte_buffer_queue *q); int grpc_bbq_empty(grpc_byte_buffer_queue *q); void grpc_bbq_push(grpc_byte_buffer_queue *q, grpc_byte_buffer *bb); -#endif /* __GRPC_INTERNAL_SURFACE_BYTE_BUFFER_QUEUE_H__ */ +#endif /* GRPC_INTERNAL_CORE_SURFACE_BYTE_BUFFER_QUEUE_H */ diff --git a/src/core/surface/call.h b/src/core/surface/call.h index dd3ad124e6d..cb81cb52c25 100644 --- a/src/core/surface/call.h +++ b/src/core/surface/call.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SURFACE_CALL_H__ -#define __GRPC_INTERNAL_SURFACE_CALL_H__ +#ifndef GRPC_INTERNAL_CORE_SURFACE_CALL_H +#define GRPC_INTERNAL_CORE_SURFACE_CALL_H #include "src/core/channel/channel_stack.h" #include "src/core/channel/metadata_buffer.h" @@ -119,4 +119,4 @@ grpc_call_stack *grpc_call_get_call_stack(grpc_call *call); /* Given the top call_element, get the call object. */ grpc_call *grpc_call_from_top_element(grpc_call_element *surface_element); -#endif /* __GRPC_INTERNAL_SURFACE_CALL_H__ */ +#endif /* GRPC_INTERNAL_CORE_SURFACE_CALL_H */ diff --git a/src/core/surface/channel.h b/src/core/surface/channel.h index 6bdfd474d2e..d3e51185eec 100644 --- a/src/core/surface/channel.h +++ b/src/core/surface/channel.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SURFACE_CHANNEL_H__ -#define __GRPC_INTERNAL_SURFACE_CHANNEL_H__ +#ifndef GRPC_INTERNAL_CORE_SURFACE_CHANNEL_H +#define GRPC_INTERNAL_CORE_SURFACE_CHANNEL_H #include "src/core/channel/channel_stack.h" @@ -50,4 +50,4 @@ void grpc_client_channel_closed(grpc_channel_element *elem); void grpc_channel_internal_ref(grpc_channel *channel); void grpc_channel_internal_unref(grpc_channel *channel); -#endif /* __GRPC_INTERNAL_SURFACE_CHANNEL_H__ */ +#endif /* GRPC_INTERNAL_CORE_SURFACE_CHANNEL_H */ diff --git a/src/core/surface/client.h b/src/core/surface/client.h index 06ce8f66567..9db2ccf3d28 100644 --- a/src/core/surface/client.h +++ b/src/core/surface/client.h @@ -31,11 +31,11 @@ * */ -#ifndef __GRPC_INTERNAL_SURFACE_CLIENT_H__ -#define __GRPC_INTERNAL_SURFACE_CLIENT_H__ +#ifndef GRPC_INTERNAL_CORE_SURFACE_CLIENT_H +#define GRPC_INTERNAL_CORE_SURFACE_CLIENT_H #include "src/core/channel/channel_stack.h" extern const grpc_channel_filter grpc_client_surface_filter; -#endif /* __GRPC_INTERNAL_SURFACE_CLIENT_H__ */ +#endif /* GRPC_INTERNAL_CORE_SURFACE_CLIENT_H */ diff --git a/src/core/surface/completion_queue.h b/src/core/surface/completion_queue.h index a7688b844c6..3054264cadf 100644 --- a/src/core/surface/completion_queue.h +++ b/src/core/surface/completion_queue.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SURFACE_COMPLETION_QUEUE_H__ -#define __GRPC_INTERNAL_SURFACE_COMPLETION_QUEUE_H__ +#ifndef GRPC_INTERNAL_CORE_SURFACE_COMPLETION_QUEUE_H +#define GRPC_INTERNAL_CORE_SURFACE_COMPLETION_QUEUE_H /* Internal API for completion channels */ @@ -114,4 +114,4 @@ void grpc_cq_dump_pending_ops(grpc_completion_queue *cc); grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc); -#endif /* __GRPC_INTERNAL_SURFACE_COMPLETION_QUEUE_H__ */ +#endif /* GRPC_INTERNAL_CORE_SURFACE_COMPLETION_QUEUE_H */ diff --git a/src/core/surface/event_string.h b/src/core/surface/event_string.h index d9b1e4e0747..e8a8f935180 100644 --- a/src/core/surface/event_string.h +++ b/src/core/surface/event_string.h @@ -31,12 +31,12 @@ * */ -#ifndef __GRPC_INTERNAL_SURFACE_EVENT_STRING_H__ -#define __GRPC_INTERNAL_SURFACE_EVENT_STRING_H__ +#ifndef GRPC_INTERNAL_CORE_SURFACE_EVENT_STRING_H +#define GRPC_INTERNAL_CORE_SURFACE_EVENT_STRING_H #include /* Returns a string describing an event. Must be later freed with gpr_free() */ char *grpc_event_string(grpc_event *ev); -#endif /* __GRPC_INTERNAL_SURFACE_EVENT_STRING_H__ */ +#endif /* GRPC_INTERNAL_CORE_SURFACE_EVENT_STRING_H */ diff --git a/src/core/surface/lame_client.h b/src/core/surface/lame_client.h index 2bd97b95eb1..b13e8cb6efe 100644 --- a/src/core/surface/lame_client.h +++ b/src/core/surface/lame_client.h @@ -31,12 +31,12 @@ * */ -#ifndef __GRPC_INTERNAL_SURFACE_LAME_CLIENT_H_ -#define __GRPC_INTERNAL_SURFACE_LAME_CLIENT_H_ +#ifndef GRPC_INTERNAL_CORE_SURFACE_LAME_CLIENT_H +#define GRPC_INTERNAL_CORE_SURFACE_LAME_CLIENT_H #include /* Create a lame client: this client fails every operation attempted on it. */ grpc_channel *grpc_lame_client_channel_create(void); -#endif /* __GRPC_INTERNAL_SURFACE_LAME_CLIENT_H_ */ +#endif /* GRPC_INTERNAL_CORE_SURFACE_LAME_CLIENT_H */ diff --git a/src/core/surface/server.h b/src/core/surface/server.h index 5ae59b22554..e33f69b8c75 100644 --- a/src/core/surface/server.h +++ b/src/core/surface/server.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SURFACE_SERVER_H__ -#define __GRPC_INTERNAL_SURFACE_SERVER_H__ +#ifndef GRPC_INTERNAL_CORE_SURFACE_SERVER_H +#define GRPC_INTERNAL_CORE_SURFACE_SERVER_H #include "src/core/channel/channel_stack.h" #include @@ -60,4 +60,4 @@ grpc_transport_setup_result grpc_server_setup_transport( const grpc_channel_args *grpc_server_get_channel_args(grpc_server *server); -#endif /* __GRPC_INTERNAL_SURFACE_SERVER_H__ */ +#endif /* GRPC_INTERNAL_CORE_SURFACE_SERVER_H */ diff --git a/src/core/surface/surface_trace.h b/src/core/surface/surface_trace.h index 4d478d6470e..50071ee317d 100644 --- a/src/core/surface/surface_trace.h +++ b/src/core/surface/surface_trace.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_SURFACE_SURFACE_TRACE_H__ -#define __GRPC_INTERNAL_SURFACE_SURFACE_TRACE_H__ +#ifndef GRPC_INTERNAL_CORE_SURFACE_SURFACE_TRACE_H +#define GRPC_INTERNAL_CORE_SURFACE_SURFACE_TRACE_H #include "src/core/debug/trace.h" #include @@ -44,4 +44,4 @@ gpr_free(_ev); \ } -#endif /* __GRPC_INTERNAL_SURFACE_SURFACE_TRACE_H__ */ +#endif /* GRPC_INTERNAL_CORE_SURFACE_SURFACE_TRACE_H */ diff --git a/src/core/transport/chttp2/alpn.h b/src/core/transport/chttp2/alpn.h index 796f514f19e..fcbefc060f4 100644 --- a/src/core/transport/chttp2/alpn.h +++ b/src/core/transport/chttp2/alpn.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_ALPN_H_ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_ALPN_H_ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_ALPN_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_ALPN_H #include @@ -46,4 +46,4 @@ size_t grpc_chttp2_num_alpn_versions(void); * grpc_chttp2_num_alpn_versions()) */ const char *grpc_chttp2_get_alpn_version_index(size_t i); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_ALPN_H_ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_ALPN_H */ diff --git a/src/core/transport/chttp2/bin_encoder.h b/src/core/transport/chttp2/bin_encoder.h index 2368fdd738c..9c88ac9725a 100644 --- a/src/core/transport/chttp2/bin_encoder.h +++ b/src/core/transport/chttp2/bin_encoder.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_BIN_ENCODER_H_ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_BIN_ENCODER_H_ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_BIN_ENCODER_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_BIN_ENCODER_H #include @@ -53,4 +53,4 @@ gpr_slice grpc_chttp2_base64_encode_and_huffman_compress(gpr_slice input); int grpc_is_binary_header(const char *key, size_t length); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_BIN_ENCODER_H_ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_BIN_ENCODER_H */ diff --git a/src/core/transport/chttp2/frame.h b/src/core/transport/chttp2/frame.h index 733dd5eec48..fbb941969e9 100644 --- a/src/core/transport/chttp2/frame.h +++ b/src/core/transport/chttp2/frame.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_H #include #include @@ -77,4 +77,4 @@ typedef struct { #define GRPC_CHTTP2_DATA_FLAG_PADDED 8 #define GRPC_CHTTP2_FLAG_HAS_PRIORITY 0x20 -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_H */ diff --git a/src/core/transport/chttp2/frame_data.h b/src/core/transport/chttp2/frame_data.h index 4d05a5f4529..24e557accd1 100644 --- a/src/core/transport/chttp2/frame_data.h +++ b/src/core/transport/chttp2/frame_data.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_DATA_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_DATA_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_DATA_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_DATA_H /* Parser for GRPC streams embedded in DATA frames */ @@ -77,4 +77,4 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_parse( /* create a slice with an empty data frame and is_last set */ gpr_slice grpc_chttp2_data_frame_create_empty_close(gpr_uint32 id); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_DATA_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_DATA_H */ diff --git a/src/core/transport/chttp2/frame_goaway.h b/src/core/transport/chttp2/frame_goaway.h index 9ccef276346..76388915142 100644 --- a/src/core/transport/chttp2/frame_goaway.h +++ b/src/core/transport/chttp2/frame_goaway.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_GOAWAY_H_ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_GOAWAY_H_ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_GOAWAY_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_GOAWAY_H #include "src/core/transport/chttp2/frame.h" #include @@ -71,4 +71,4 @@ void grpc_chttp2_goaway_append(gpr_uint32 last_stream_id, gpr_uint32 error_code, gpr_slice debug_data, gpr_slice_buffer *slice_buffer); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_GOAWAY_H_ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_GOAWAY_H */ diff --git a/src/core/transport/chttp2/frame_ping.h b/src/core/transport/chttp2/frame_ping.h index d9d6f7ef15e..11d38b80ea5 100644 --- a/src/core/transport/chttp2/frame_ping.h +++ b/src/core/transport/chttp2/frame_ping.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_PING_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_PING_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_PING_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_PING_H #include #include "src/core/transport/chttp2/frame.h" @@ -50,4 +50,4 @@ grpc_chttp2_parse_error grpc_chttp2_ping_parser_begin_frame( grpc_chttp2_parse_error grpc_chttp2_ping_parser_parse( void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_PING_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_PING_H */ diff --git a/src/core/transport/chttp2/frame_rst_stream.h b/src/core/transport/chttp2/frame_rst_stream.h index 83fc3806eb2..2d3ee18637b 100644 --- a/src/core/transport/chttp2/frame_rst_stream.h +++ b/src/core/transport/chttp2/frame_rst_stream.h @@ -31,11 +31,11 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H #include gpr_slice grpc_chttp2_rst_stream_create(gpr_uint32 stream_id, gpr_uint32 code); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H */ diff --git a/src/core/transport/chttp2/frame_settings.h b/src/core/transport/chttp2/frame_settings.h index 6cde2c6e47e..18765631a68 100644 --- a/src/core/transport/chttp2/frame_settings.h +++ b/src/core/transport/chttp2/frame_settings.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_SETTINGS_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_SETTINGS_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_SETTINGS_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_SETTINGS_H #include #include @@ -96,4 +96,4 @@ grpc_chttp2_parse_error grpc_chttp2_settings_parser_begin_frame( grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse( void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_SETTINGS_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_SETTINGS_H */ diff --git a/src/core/transport/chttp2/frame_window_update.h b/src/core/transport/chttp2/frame_window_update.h index 093263db170..85475a8f9ef 100644 --- a/src/core/transport/chttp2/frame_window_update.h +++ b/src/core/transport/chttp2/frame_window_update.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H #include #include "src/core/transport/chttp2/frame.h" @@ -52,4 +52,4 @@ grpc_chttp2_parse_error grpc_chttp2_window_update_parser_begin_frame( grpc_chttp2_parse_error grpc_chttp2_window_update_parser_parse( void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H */ diff --git a/src/core/transport/chttp2/hpack_parser.h b/src/core/transport/chttp2/hpack_parser.h index 94acc8864f7..bb4c1a1f492 100644 --- a/src/core/transport/chttp2/hpack_parser.h +++ b/src/core/transport/chttp2/hpack_parser.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_PARSER_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_PARSER_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HPACK_PARSER_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HPACK_PARSER_H #include @@ -108,4 +108,4 @@ grpc_chttp2_parse_error grpc_chttp2_header_parser_parse( void *hpack_parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_PARSER_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HPACK_PARSER_H */ diff --git a/src/core/transport/chttp2/hpack_table.h b/src/core/transport/chttp2/hpack_table.h index ea0fc1d0302..d3bf41bbc5b 100644 --- a/src/core/transport/chttp2/hpack_table.h +++ b/src/core/transport/chttp2/hpack_table.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_TABLE_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_TABLE_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HPACK_TABLE_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HPACK_TABLE_H #include "src/core/transport/metadata.h" #include @@ -94,4 +94,4 @@ typedef struct { grpc_chttp2_hptbl_find_result grpc_chttp2_hptbl_find( const grpc_chttp2_hptbl *tbl, grpc_mdelem *md); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_TABLE_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HPACK_TABLE_H */ diff --git a/src/core/transport/chttp2/http2_errors.h b/src/core/transport/chttp2/http2_errors.h index 1eecd175401..4ab2ec02207 100644 --- a/src/core/transport/chttp2/http2_errors.h +++ b/src/core/transport/chttp2/http2_errors.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_HTTP2_ERRORS_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_HTTP2_ERRORS_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HTTP2_ERRORS_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HTTP2_ERRORS_H /* error codes for RST_STREAM from http2 draft 14 section 7 */ typedef enum { @@ -53,4 +53,4 @@ typedef enum { GRPC_CHTTP2__ERROR_DO_NOT_USE = -1 } grpc_chttp2_error_code; -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HTTP2_ERRORS_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HTTP2_ERRORS_H */ diff --git a/src/core/transport/chttp2/huffsyms.h b/src/core/transport/chttp2/huffsyms.h index 131c4acbebb..f9c14479669 100644 --- a/src/core/transport/chttp2/huffsyms.h +++ b/src/core/transport/chttp2/huffsyms.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_HUFFSYMS_H_ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_HUFFSYMS_H_ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HUFFSYMS_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HUFFSYMS_H /* HPACK static huffman table */ @@ -45,4 +45,4 @@ typedef struct { extern const grpc_chttp2_huffsym grpc_chttp2_huffsyms[GRPC_CHTTP2_NUM_HUFFSYMS]; -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HUFFSYMS_H_ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HUFFSYMS_H */ diff --git a/src/core/transport/chttp2/status_conversion.h b/src/core/transport/chttp2/status_conversion.h index 8e2672008cf..cf06c3576e1 100644 --- a/src/core/transport/chttp2/status_conversion.h +++ b/src/core/transport/chttp2/status_conversion.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_STATUS_CONVERSION_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_STATUS_CONVERSION_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STATUS_CONVERSION_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STATUS_CONVERSION_H #include #include "src/core/transport/chttp2/http2_errors.h" @@ -47,4 +47,4 @@ grpc_status_code grpc_chttp2_http2_error_to_grpc_status( grpc_status_code grpc_chttp2_http2_status_to_grpc_status(int status); int grpc_chttp2_grpc_status_to_http2_status(grpc_status_code status); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STATUS_CONVERSION_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STATUS_CONVERSION_H */ diff --git a/src/core/transport/chttp2/stream_encoder.h b/src/core/transport/chttp2/stream_encoder.h index a99d61a553f..50c58ad5ca3 100644 --- a/src/core/transport/chttp2/stream_encoder.h +++ b/src/core/transport/chttp2/stream_encoder.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_ENCODER_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_ENCODER_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STREAM_ENCODER_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STREAM_ENCODER_H #include "src/core/transport/chttp2/frame.h" #include "src/core/transport/metadata.h" @@ -90,4 +90,4 @@ void grpc_chttp2_encode(grpc_stream_op *ops, size_t ops_count, int eof, grpc_chttp2_hpack_compressor *compressor, gpr_slice_buffer *output); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_ENCODER_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STREAM_ENCODER_H */ diff --git a/src/core/transport/chttp2/stream_map.h b/src/core/transport/chttp2/stream_map.h index 3fb91fc88f7..d338d2f8921 100644 --- a/src/core/transport/chttp2/stream_map.h +++ b/src/core/transport/chttp2/stream_map.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_MAP_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_MAP_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STREAM_MAP_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STREAM_MAP_H #include @@ -78,4 +78,4 @@ void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map *map, void *value), void *user_data); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_MAP_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STREAM_MAP_H */ diff --git a/src/core/transport/chttp2/timeout_encoding.h b/src/core/transport/chttp2/timeout_encoding.h index 2bef8ba67f5..e6664c62628 100644 --- a/src/core/transport/chttp2/timeout_encoding.h +++ b/src/core/transport/chttp2/timeout_encoding.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_TIMEOUT_ENCODING_H_ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_TIMEOUT_ENCODING_H_ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_TIMEOUT_ENCODING_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_TIMEOUT_ENCODING_H #include "src/core/support/string.h" #include @@ -44,4 +44,4 @@ void grpc_chttp2_encode_timeout(gpr_timespec timeout, char *buffer); int grpc_chttp2_decode_timeout(const char *buffer, gpr_timespec *timeout); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_TIMEOUT_ENCODING_H_ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_TIMEOUT_ENCODING_H */ diff --git a/src/core/transport/chttp2/varint.h b/src/core/transport/chttp2/varint.h index 8c353c66a72..ee04ed7fb22 100644 --- a/src/core/transport/chttp2/varint.h +++ b/src/core/transport/chttp2/varint.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_VARINT_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_VARINT_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_VARINT_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_VARINT_H #include @@ -71,4 +71,4 @@ void grpc_chttp2_hpack_write_varint_tail(gpr_uint32 tail_value, } \ } while (0) -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_VARINT_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_VARINT_H */ diff --git a/src/core/transport/chttp2_transport.h b/src/core/transport/chttp2_transport.h index 6fbc5961a1d..c5b65bd4f75 100644 --- a/src/core/transport/chttp2_transport.h +++ b/src/core/transport/chttp2_transport.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_CHTTP2_TRANSPORT_H__ -#define __GRPC_INTERNAL_TRANSPORT_CHTTP2_TRANSPORT_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_TRANSPORT_H +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_TRANSPORT_H #include "src/core/iomgr/endpoint.h" #include "src/core/transport/transport.h" @@ -44,4 +44,4 @@ void grpc_create_chttp2_transport(grpc_transport_setup_callback setup, size_t nslices, grpc_mdctx *metadata_context, int is_client); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_TRANSPORT_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_TRANSPORT_H */ diff --git a/src/core/transport/metadata.h b/src/core/transport/metadata.h index 7a56e346901..b8afbeb1e34 100644 --- a/src/core/transport/metadata.h +++ b/src/core/transport/metadata.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_METADATA_H__ -#define __GRPC_INTERNAL_TRANSPORT_METADATA_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_METADATA_H +#define GRPC_INTERNAL_CORE_TRANSPORT_METADATA_H #include #include @@ -137,4 +137,4 @@ const char *grpc_mdstr_as_c_string(grpc_mdstr *s); #define GRPC_MDSTR_KV_HASH(k_hash, v_hash) (GPR_ROTL((k_hash), 2) ^ (v_hash)) -#endif /* __GRPC_INTERNAL_TRANSPORT_METADATA_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_METADATA_H */ diff --git a/src/core/transport/stream_op.h b/src/core/transport/stream_op.h index 828a7f7226f..2ffbcce87b3 100644 --- a/src/core/transport/stream_op.h +++ b/src/core/transport/stream_op.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_STREAM_OP_H__ -#define __GRPC_INTERNAL_TRANSPORT_STREAM_OP_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_STREAM_OP_H +#define GRPC_INTERNAL_CORE_TRANSPORT_STREAM_OP_H #include #include @@ -131,4 +131,4 @@ void grpc_sopb_add_flow_ctl_cb(grpc_stream_op_buffer *sopb, void grpc_sopb_append(grpc_stream_op_buffer *sopb, grpc_stream_op *ops, size_t nops); -#endif /* __GRPC_INTERNAL_TRANSPORT_STREAM_OP_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_STREAM_OP_H */ diff --git a/src/core/transport/transport.h b/src/core/transport/transport.h index 60193b1844c..ce8c17c3228 100644 --- a/src/core/transport/transport.h +++ b/src/core/transport/transport.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_TRANSPORT_H__ -#define __GRPC_INTERNAL_TRANSPORT_TRANSPORT_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_TRANSPORT_H +#define GRPC_INTERNAL_CORE_TRANSPORT_TRANSPORT_H #include @@ -254,4 +254,4 @@ void grpc_transport_setup_initiate(grpc_transport_setup *setup); used as a destruction call by setup). */ void grpc_transport_setup_cancel(grpc_transport_setup *setup); -#endif /* __GRPC_INTERNAL_TRANSPORT_TRANSPORT_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_TRANSPORT_H */ diff --git a/src/core/transport/transport_impl.h b/src/core/transport/transport_impl.h index d1e0b1920ea..ac275c75606 100644 --- a/src/core/transport/transport_impl.h +++ b/src/core/transport/transport_impl.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_INTERNAL_TRANSPORT_TRANSPORT_IMPL_H__ -#define __GRPC_INTERNAL_TRANSPORT_TRANSPORT_IMPL_H__ +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_TRANSPORT_IMPL_H +#define GRPC_INTERNAL_CORE_TRANSPORT_TRANSPORT_IMPL_H #include "src/core/transport/transport.h" @@ -84,4 +84,4 @@ struct grpc_transport { const grpc_transport_vtable *vtable; }; -#endif /* __GRPC_INTERNAL_TRANSPORT_TRANSPORT_IMPL_H__ */ +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_TRANSPORT_IMPL_H */ diff --git a/src/core/tsi/fake_transport_security.h b/src/core/tsi/fake_transport_security.h index 36e62bce3da..af9730b90e1 100644 --- a/src/core/tsi/fake_transport_security.h +++ b/src/core/tsi/fake_transport_security.h @@ -31,8 +31,8 @@ * */ -#ifndef __FAKE_TRANSPORT_SECURITY_H_ -#define __FAKE_TRANSPORT_SECURITY_H_ +#ifndef GRPC_INTERNAL_CORE_TSI_FAKE_TRANSPORT_SECURITY_H +#define GRPC_INTERNAL_CORE_TSI_FAKE_TRANSPORT_SECURITY_H #include "src/core/tsi/transport_security_interface.h" @@ -58,4 +58,4 @@ tsi_frame_protector* tsi_create_fake_protector( } #endif -#endif /* __FAKE_TRANSPORT_SECURITY_H_ */ +#endif /* GRPC_INTERNAL_CORE_TSI_FAKE_TRANSPORT_SECURITY_H */ diff --git a/src/core/tsi/ssl_transport_security.h b/src/core/tsi/ssl_transport_security.h index eecf2d7c2d6..192f7acf0e0 100644 --- a/src/core/tsi/ssl_transport_security.h +++ b/src/core/tsi/ssl_transport_security.h @@ -31,8 +31,8 @@ * */ -#ifndef __SSL_TRANSPORT_SECURITY_H_ -#define __SSL_TRANSPORT_SECURITY_H_ +#ifndef GRPC_INTERNAL_CORE_TSI_SSL_TRANSPORT_SECURITY_H +#define GRPC_INTERNAL_CORE_TSI_SSL_TRANSPORT_SECURITY_H #include "src/core/tsi/transport_security_interface.h" @@ -170,4 +170,4 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, const char* name); } #endif -#endif /* __SSL_TRANSPORT_SECURITY_H_ */ +#endif /* GRPC_INTERNAL_CORE_TSI_SSL_TRANSPORT_SECURITY_H */ diff --git a/src/core/tsi/transport_security.h b/src/core/tsi/transport_security.h index 432da073463..e47e258e59d 100644 --- a/src/core/tsi/transport_security.h +++ b/src/core/tsi/transport_security.h @@ -31,8 +31,8 @@ * */ -#ifndef __TRANSPORT_SECURITY_H_ -#define __TRANSPORT_SECURITY_H_ +#ifndef GRPC_INTERNAL_CORE_TSI_TRANSPORT_SECURITY_H +#define GRPC_INTERNAL_CORE_TSI_TRANSPORT_SECURITY_H #include "src/core/tsi/transport_security_interface.h" @@ -115,4 +115,4 @@ char* tsi_strdup(const char* src); /* Sadly, no strdup in C89. */ } #endif -#endif /* __TRANSPORT_SECURITY_H_ */ +#endif /* GRPC_INTERNAL_CORE_TSI_TRANSPORT_SECURITY_H */ diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h index 90e119ca8e4..50de7b927f2 100644 --- a/src/core/tsi/transport_security_interface.h +++ b/src/core/tsi/transport_security_interface.h @@ -31,8 +31,8 @@ * */ -#ifndef __TRANSPORT_SECURITY_INTERFACE_H_ -#define __TRANSPORT_SECURITY_INTERFACE_H_ +#ifndef GRPC_INTERNAL_CORE_TSI_TRANSPORT_SECURITY_INTERFACE_H +#define GRPC_INTERNAL_CORE_TSI_TRANSPORT_SECURITY_INTERFACE_H #include #include @@ -361,4 +361,4 @@ void tsi_handshaker_destroy(tsi_handshaker* self); } #endif -#endif /* __TRANSPORT_SECURITY_INTERFACE_H_ */ +#endif /* GRPC_INTERNAL_CORE_TSI_TRANSPORT_SECURITY_INTERFACE_H */ diff --git a/src/cpp/client/channel.h b/src/cpp/client/channel.h index e3edcf73a51..63c6e2bde6d 100644 --- a/src/cpp/client/channel.h +++ b/src/cpp/client/channel.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_INTERNAL_CLIENT_CHANNEL_H__ -#define __GRPCPP_INTERNAL_CLIENT_CHANNEL_H__ +#ifndef GRPC_INTERNAL_CPP_CLIENT_CHANNEL_H +#define GRPC_INTERNAL_CPP_CLIENT_CHANNEL_H #include @@ -68,4 +68,4 @@ class Channel GRPC_FINAL : public ChannelInterface { } // namespace grpc -#endif // __GRPCPP_INTERNAL_CLIENT_CHANNEL_H__ +#endif // GRPC_INTERNAL_CPP_CLIENT_CHANNEL_H diff --git a/src/cpp/proto/proto_utils.h b/src/cpp/proto/proto_utils.h index 834884d5796..a0af4d6465d 100644 --- a/src/cpp/proto/proto_utils.h +++ b/src/cpp/proto/proto_utils.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_INTERNAL_PROTO_PROTO_UTILS_H__ -#define __GRPCPP_INTERNAL_PROTO_PROTO_UTILS_H__ +#ifndef GRPC_INTERNAL_CPP_PROTO_PROTO_UTILS_H +#define GRPC_INTERNAL_CPP_PROTO_PROTO_UTILS_H struct grpc_byte_buffer; namespace google { @@ -54,4 +54,4 @@ bool DeserializeProto(grpc_byte_buffer *buffer, google::protobuf::Message *msg); } // namespace grpc -#endif // __GRPCPP_INTERNAL_PROTO_PROTO_UTILS_H__ +#endif // GRPC_INTERNAL_CPP_PROTO_PROTO_UTILS_H diff --git a/src/cpp/server/thread_pool.h b/src/cpp/server/thread_pool.h index 9c1df0b15bc..6157e403e95 100644 --- a/src/cpp/server/thread_pool.h +++ b/src/cpp/server/thread_pool.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_INTERNAL_SERVER_THREAD_POOL_H__ -#define __GRPCPP_INTERNAL_SERVER_THREAD_POOL_H__ +#ifndef GRPC_INTERNAL_CPP_SERVER_THREAD_POOL_H +#define GRPC_INTERNAL_CPP_SERVER_THREAD_POOL_H #include #include @@ -62,4 +62,4 @@ class ThreadPool GRPC_FINAL : public ThreadPoolInterface { } // namespace grpc -#endif // __GRPCPP_INTERNAL_SERVER_THREAD_POOL_H__ +#endif // GRPC_INTERNAL_CPP_SERVER_THREAD_POOL_H diff --git a/src/cpp/util/time.h b/src/cpp/util/time.h index 9f9e582d070..1994848eb21 100644 --- a/src/cpp/util/time.h +++ b/src/cpp/util/time.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_INTERNAL_UTIL_TIME_H__ -#define __GRPCPP_INTERNAL_UTIL_TIME_H__ +#ifndef GRPC_INTERNAL_CPP_UTIL_TIME_H +#define GRPC_INTERNAL_CPP_UTIL_TIME_H #include @@ -48,4 +48,4 @@ std::chrono::system_clock::time_point Timespec2Timepoint(gpr_timespec t); } // namespace grpc -#endif // __GRPCPP_INTERNAL_UTIL_TIME_H__ +#endif // GRPC_INTERNAL_CPP_UTIL_TIME_H diff --git a/test/core/end2end/cq_verifier.h b/test/core/end2end/cq_verifier.h index 8f1471060f8..c1e25d8aa40 100644 --- a/test/core/end2end/cq_verifier.h +++ b/test/core/end2end/cq_verifier.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_TEST_END2END_CQ_VERIFIER_H__ -#define __GRPC_TEST_END2END_CQ_VERIFIER_H__ +#ifndef GRPC_TEST_CORE_END2END_CQ_VERIFIER_H +#define GRPC_TEST_CORE_END2END_CQ_VERIFIER_H #include #include "test/core/util/test_config.h" @@ -76,4 +76,4 @@ void cq_expect_server_shutdown(cq_verifier *v, void *tag); int byte_buffer_eq_string(grpc_byte_buffer *byte_buffer, const char *string); int contains_metadata(grpc_metadata_array *array, const char *key, const char *value); -#endif /* __GRPC_TEST_END2END_CQ_VERIFIER_H__ */ +#endif /* GRPC_TEST_CORE_END2END_CQ_VERIFIER_H */ diff --git a/test/core/end2end/data/ssl_test_data.h b/test/core/end2end/data/ssl_test_data.h index 41248670d62..4f4b30ef211 100644 --- a/test/core/end2end/data/ssl_test_data.h +++ b/test/core/end2end/data/ssl_test_data.h @@ -31,11 +31,11 @@ * */ -#ifndef __GRPC_TEST_END2END_DATA_SSL_TEST_DATA_H__ -#define __GRPC_TEST_END2END_DATA_SSL_TEST_DATA_H__ +#ifndef GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H +#define GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H extern const char test_root_cert[]; extern const char test_server1_cert[]; extern const char test_server1_key[]; -#endif /* __GRPC_TEST_END2END_DATA_SSL_TEST_DATA_H__ */ +#endif /* GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H */ diff --git a/test/core/end2end/end2end_tests.h b/test/core/end2end/end2end_tests.h index 8f2cd0f2e05..b6d93252eb2 100644 --- a/test/core/end2end/end2end_tests.h +++ b/test/core/end2end/end2end_tests.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_TEST_END2END_END2END_TESTS_H__ -#define __GRPC_TEST_END2END_END2END_TESTS_H__ +#ifndef GRPC_TEST_CORE_END2END_END2END_TESTS_H +#define GRPC_TEST_CORE_END2END_END2END_TESTS_H #include @@ -63,4 +63,4 @@ struct grpc_end2end_test_config { void grpc_end2end_tests(grpc_end2end_test_config config); -#endif /* __GRPC_TEST_END2END_END2END_TESTS_H__ */ +#endif /* GRPC_TEST_CORE_END2END_END2END_TESTS_H */ diff --git a/test/core/end2end/tests/cancel_test_helpers.h b/test/core/end2end/tests/cancel_test_helpers.h index 3dd74373531..f2581dc32ff 100644 --- a/test/core/end2end/tests/cancel_test_helpers.h +++ b/test/core/end2end/tests/cancel_test_helpers.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_TEST_END2END_TESTS_CANCEL_TEST_HELPERS_H__ -#define __GRPC_TEST_END2END_TESTS_CANCEL_TEST_HELPERS_H__ +#ifndef GRPC_TEST_CORE_END2END_TESTS_CANCEL_TEST_HELPERS_H +#define GRPC_TEST_CORE_END2END_TESTS_CANCEL_TEST_HELPERS_H typedef struct { grpc_call_error (*initiate_cancel)(grpc_call *call); @@ -48,4 +48,4 @@ static const cancellation_mode cancellation_modes[] = { {grpc_call_cancel, GRPC_STATUS_CANCELLED, ""}, {wait_for_deadline, GRPC_STATUS_DEADLINE_EXCEEDED, "Deadline Exceeded"}, }; -#endif +#endif /* GRPC_TEST_CORE_END2END_TESTS_CANCEL_TEST_HELPERS_H */ diff --git a/test/core/iomgr/endpoint_tests.h b/test/core/iomgr/endpoint_tests.h index 3be377c4e3d..1679d7bd4f0 100644 --- a/test/core/iomgr/endpoint_tests.h +++ b/test/core/iomgr/endpoint_tests.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_TEST_IOMGR_ENDPOINT_TESTS_H__ -#define __GRPC_TEST_IOMGR_ENDPOINT_TESTS_H__ +#ifndef GRPC_TEST_CORE_IOMGR_ENDPOINT_TESTS_H +#define GRPC_TEST_CORE_IOMGR_ENDPOINT_TESTS_H #include @@ -54,4 +54,4 @@ struct grpc_endpoint_test_config { void grpc_endpoint_tests(grpc_endpoint_test_config config); -#endif /* __GRPC_TEST_IOMGR_ENDPOINT_TESTS_H__ */ +#endif /* GRPC_TEST_CORE_IOMGR_ENDPOINT_TESTS_H */ diff --git a/test/core/statistics/census_log_tests.h b/test/core/statistics/census_log_tests.h index f829ab36833..28bde086f3b 100644 --- a/test/core/statistics/census_log_tests.h +++ b/test/core/statistics/census_log_tests.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_TEST_STATISTICS_LOG_TESTS_H__ -#define __GRPC_TEST_STATISTICS_LOG_TESTS_H__ +#ifndef GRPC_TEST_CORE_STATISTICS_CENSUS_LOG_TESTS_H +#define GRPC_TEST_CORE_STATISTICS_CENSUS_LOG_TESTS_H void test_invalid_record_size(); void test_end_write_with_different_size(); @@ -48,4 +48,4 @@ void test_multiple_writers(); void test_performance(); void test_small_log(); -#endif /* __GRPC_TEST_STATISTICS_LOG_TESTS_H__ */ +#endif /* GRPC_TEST_CORE_STATISTICS_CENSUS_LOG_TESTS_H */ diff --git a/test/core/transport/transport_end2end_tests.h b/test/core/transport/transport_end2end_tests.h index 3dc2b9b0678..1edffe9a79e 100644 --- a/test/core/transport/transport_end2end_tests.h +++ b/test/core/transport/transport_end2end_tests.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_TEST_TRANSPORT_TRANSPORT_END2END_TESTS_H__ -#define __GRPC_TEST_TRANSPORT_TRANSPORT_END2END_TESTS_H__ +#ifndef GRPC_TEST_CORE_TRANSPORT_TRANSPORT_END2END_TESTS_H +#define GRPC_TEST_CORE_TRANSPORT_TRANSPORT_END2END_TESTS_H #include "src/core/transport/transport.h" @@ -65,4 +65,4 @@ typedef struct grpc_transport_test_config { /* Run the test suite on one configuration */ void grpc_transport_end2end_tests(grpc_transport_test_config *config); -#endif /* __GRPC_TEST_TRANSPORT_TRANSPORT_END2END_TESTS_H__ */ +#endif /* GRPC_TEST_CORE_TRANSPORT_TRANSPORT_END2END_TESTS_H */ diff --git a/test/core/util/grpc_profiler.h b/test/core/util/grpc_profiler.h index a31fcc1db5f..347a1d39d51 100644 --- a/test/core/util/grpc_profiler.h +++ b/test/core/util/grpc_profiler.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_TEST_UTIL_GRPC_PROFILER_H__ -#define __GRPC_TEST_UTIL_GRPC_PROFILER_H__ +#ifndef GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H +#define GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H #ifdef __cplusplus extern "C" { @@ -45,4 +45,4 @@ void grpc_profiler_stop(); } #endif /* __cplusplus */ -#endif /* __GRPC_TEST_UTIL_GRPC_PROFILER_H__ */ +#endif /* GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H */ diff --git a/test/core/util/parse_hexstring.h b/test/core/util/parse_hexstring.h index 3fce0c9f7ac..22bbd1756fd 100644 --- a/test/core/util/parse_hexstring.h +++ b/test/core/util/parse_hexstring.h @@ -31,11 +31,11 @@ * */ -#ifndef __GRPC_TEST_UTIL_PARSE_HEXSTRING_H_ -#define __GRPC_TEST_UTIL_PARSE_HEXSTRING_H_ +#ifndef GRPC_TEST_CORE_UTIL_PARSE_HEXSTRING_H +#define GRPC_TEST_CORE_UTIL_PARSE_HEXSTRING_H #include gpr_slice parse_hexstring(const char *hexstring); -#endif /* __GRPC_TEST_UTIL_PARSE_HEXSTRING_H_ */ +#endif /* GRPC_TEST_CORE_UTIL_PARSE_HEXSTRING_H */ diff --git a/test/core/util/port.h b/test/core/util/port.h index 2a12ab985e0..b516ec5a483 100644 --- a/test/core/util/port.h +++ b/test/core/util/port.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_TEST_UTIL_PORT_H__ -#define __GRPC_TEST_UTIL_PORT_H__ +#ifndef GRPC_TEST_CORE_UTIL_PORT_H +#define GRPC_TEST_CORE_UTIL_PORT_H #ifdef __cplusplus extern "C" { @@ -49,4 +49,4 @@ int grpc_pick_unused_port_or_die(); } #endif -#endif /* __GRPC_TEST_UTIL_PORT_H__ */ +#endif /* GRPC_TEST_CORE_UTIL_PORT_H */ diff --git a/test/core/util/slice_splitter.h b/test/core/util/slice_splitter.h index b67fe737cbd..1ce1c097e29 100644 --- a/test/core/util/slice_splitter.h +++ b/test/core/util/slice_splitter.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_TEST_UTIL_SLICE_SPLITTER_H__ -#define __GRPC_TEST_UTIL_SLICE_SPLITTER_H__ +#ifndef GRPC_TEST_CORE_UTIL_SLICE_SPLITTER_H +#define GRPC_TEST_CORE_UTIL_SLICE_SPLITTER_H /* utility function to split/merge slices together to help create test cases */ @@ -65,4 +65,4 @@ gpr_slice grpc_slice_merge(gpr_slice *slices, size_t nslices); const char *grpc_slice_split_mode_name(grpc_slice_split_mode mode); -#endif /* __GRPC_TEST_UTIL_SLICE_SPLITTER_H__ */ +#endif /* GRPC_TEST_CORE_UTIL_SLICE_SPLITTER_H */ diff --git a/test/core/util/test_config.h b/test/core/util/test_config.h index 5292c7b525e..668a069f267 100644 --- a/test/core/util/test_config.h +++ b/test/core/util/test_config.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPC_TEST_UTIL_TEST_CONFIG_H__ -#define __GRPC_TEST_UTIL_TEST_CONFIG_H__ +#ifndef GRPC_TEST_CORE_UTIL_TEST_CONFIG_H +#define GRPC_TEST_CORE_UTIL_TEST_CONFIG_H #include @@ -65,4 +65,4 @@ void grpc_test_init(int argc, char **argv); } #endif /* __cplusplus */ -#endif /* __GRPC_TEST_UTIL_TEST_CONFIG_H__ */ +#endif /* GRPC_TEST_CORE_UTIL_TEST_CONFIG_H */ diff --git a/test/cpp/util/create_test_channel.h b/test/cpp/util/create_test_channel.h index 3476b8354b1..5c298ce8504 100644 --- a/test/cpp/util/create_test_channel.h +++ b/test/cpp/util/create_test_channel.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_TEST_UTIL_CREATE_TEST_CHANNEL_H_ -#define __GRPCPP_TEST_UTIL_CREATE_TEST_CHANNEL_H_ +#ifndef GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H +#define GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H #include @@ -56,4 +56,4 @@ std::shared_ptr CreateTestChannel( } // namespace grpc -#endif // __GRPCPP_TEST_UTIL_CREATE_TEST_CHANNEL_H_ +#endif // GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H diff --git a/tools/distrib/guard_headers.sh b/tools/distrib/guard_headers.sh new file mode 100755 index 00000000000..2a54cf821a8 --- /dev/null +++ b/tools/distrib/guard_headers.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +set -e + +cd `dirname $0`/../.. + +function process_dir { + base_dir=$1 + prefix=$2 + comment_language=$3 + ( + cd $base_dir + find . -name "*.h" | while read f ; do + guard=${prefix}_`echo ${f#*/} | tr '[:lower:]/.-' '[:upper:]___'` + if [ "$comment_language" = "c++" ] ; then + comment="// $guard" + else + comment="/* $guard */" + fi + awk ' + BEGIN { + guard = "'${guard}'"; + comment_language = "'${comment_language}'"; + } + prev ~ /^#ifndef/ && !got_first_ifndef { + got_first_ifndef = 1; + prev = "#ifndef " guard; + } + prev ~ /^#define/ && !got_first_define { + got_first_define = 1; + prev = "#define " guard; + } + NR > 1 { print prev; } + { prev = $0; } + END { + if (prev ~ /^#endif/) { + if (comment_language ~ /^c$/) { + print "#endif /* " guard " */"; + } else if (comment_language ~ /^c\+\+$/) { + print "#endif // " guard; + } else { + print "ERROR: unknown comment language: " comment_language; + } + } else { + print "ERROR: file does not end with #endif"; + } + } + ' "${f}" > "${f}.rewritten" + mv "${f}.rewritten" "${f}" + done + ) +} + +process_dir include/grpc GRPC c +process_dir include/grpc++ GRPCXX c++ +process_dir src/core GRPC_INTERNAL_CORE c +process_dir src/cpp GRPC_INTERNAL_CPP c++ +process_dir src/compiler GRPC_INTERNAL_COMPILER c++ +process_dir test/core GRPC_TEST_CORE c +process_dir test/cpp GRPC_TEST_CPP c++ +process_dir examples GRPC_EXAMPLES c++ From 980f600c83d6c213d4037ab69dc8ffca35015e22 Mon Sep 17 00:00:00 2001 From: Julien Boeuf Date: Thu, 26 Feb 2015 16:41:41 -0800 Subject: [PATCH 41/71] Adding support to enable tracing in tsi. --- src/core/tsi/fake_transport_security.c | 20 ++++++++++++++------ src/core/tsi/ssl_transport_security.c | 2 +- src/core/tsi/transport_security.c | 8 ++++++++ src/core/tsi/transport_security.h | 2 ++ src/core/tsi/transport_security_interface.h | 5 +++++ 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/core/tsi/fake_transport_security.c b/src/core/tsi/fake_transport_security.c index e8af200284a..f58f04ea20b 100644 --- a/src/core/tsi/fake_transport_security.c +++ b/src/core/tsi/fake_transport_security.c @@ -392,8 +392,10 @@ static tsi_result fake_handshaker_get_bytes_to_send_to_peer( if (next_message_to_send > TSI_FAKE_HANDSHAKE_MESSAGE_MAX) { next_message_to_send = TSI_FAKE_HANDSHAKE_MESSAGE_MAX; } - gpr_log(GPR_INFO, "%s prepared %s.", impl->is_client ? "Client" : "Server", - tsi_fake_handshake_message_to_string(impl->next_message_to_send)); + if (tsi_tracing_enabled) { + gpr_log(GPR_INFO, "%s prepared %s.", impl->is_client ? "Client" : "Server", + tsi_fake_handshake_message_to_string(impl->next_message_to_send)); + } impl->next_message_to_send = next_message_to_send; } result = drain_frame_to_bytes(bytes, bytes_size, &impl->outgoing); @@ -401,7 +403,9 @@ static tsi_result fake_handshaker_get_bytes_to_send_to_peer( if (!impl->is_client && impl->next_message_to_send == TSI_FAKE_HANDSHAKE_MESSAGE_MAX) { /* We're done. */ - gpr_log(GPR_INFO, "Server is done."); + if (tsi_tracing_enabled) { + gpr_log(GPR_INFO, "Server is done."); + } impl->result = TSI_OK; } else { impl->needs_incoming_message = 1; @@ -436,13 +440,17 @@ static tsi_result fake_handshaker_process_bytes_from_peer( tsi_fake_handshake_message_to_string(received_msg), tsi_fake_handshake_message_to_string(expected_msg)); } - gpr_log(GPR_INFO, "%s received %s.", impl->is_client ? "Client" : "Server", - tsi_fake_handshake_message_to_string(received_msg)); + if (tsi_tracing_enabled) { + gpr_log(GPR_INFO, "%s received %s.", impl->is_client ? "Client" : "Server", + tsi_fake_handshake_message_to_string(received_msg)); + } tsi_fake_frame_reset(&impl->incoming, 0 /* needs_draining */); impl->needs_incoming_message = 0; if (impl->next_message_to_send == TSI_FAKE_HANDSHAKE_MESSAGE_MAX) { /* We're done. */ - gpr_log(GPR_INFO, "%s is done.", impl->is_client ? "Client" : "Server"); + if (tsi_tracing_enabled) { + gpr_log(GPR_INFO, "%s is done.", impl->is_client ? "Client" : "Server"); + } impl->result = TSI_OK; } return TSI_OK; diff --git a/src/core/tsi/ssl_transport_security.c b/src/core/tsi/ssl_transport_security.c index 8446cc4fdc2..dc43f7e270c 100644 --- a/src/core/tsi/ssl_transport_security.c +++ b/src/core/tsi/ssl_transport_security.c @@ -162,7 +162,7 @@ static const char* ssl_error_string(int error) { /* TODO(jboeuf): Remove when we are past the debugging phase with this code. */ static void ssl_log_where_info(const SSL* ssl, int where, int flag, const char* msg) { - if (where & flag) { + if ((where & flag) && tsi_tracing_enabled) { gpr_log(GPR_INFO, "%20.20s - %30.30s - %5.10s", msg, SSL_state_string_long(ssl), SSL_state_string(ssl)); } diff --git a/src/core/tsi/transport_security.c b/src/core/tsi/transport_security.c index aeb9b3fc17d..04b30004fcd 100644 --- a/src/core/tsi/transport_security.c +++ b/src/core/tsi/transport_security.c @@ -36,6 +36,14 @@ #include #include +/* --- Tracing. --- */ + +int tsi_tracing_enabled = 0; + +void tsi_enable_tracing() { + tsi_tracing_enabled = 1; +} + /* --- Utils. --- */ char* tsi_strdup(const char* src) { diff --git a/src/core/tsi/transport_security.h b/src/core/tsi/transport_security.h index e47e258e59d..59e5dcff9a2 100644 --- a/src/core/tsi/transport_security.h +++ b/src/core/tsi/transport_security.h @@ -40,6 +40,8 @@ extern "C" { #endif +extern int tsi_tracing_enabled; + /* Base for tsi_frame_protector implementations. See transport_security_interface.h for documentation. */ typedef struct { diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h index 50de7b927f2..33a19bef0de 100644 --- a/src/core/tsi/transport_security_interface.h +++ b/src/core/tsi/transport_security_interface.h @@ -61,6 +61,11 @@ typedef enum { const char* tsi_result_to_string(tsi_result result); +/* --- tsi tracing --- */ + +/* Call this function before any other tsi function to avoid races. */ +void tsi_enable_tracing(void); + /* --- tsi_frame_protector object --- This object protects and unprotects buffers once the handshake is done. From c1f97ce78998d87ef8e74c5575de8fee36794763 Mon Sep 17 00:00:00 2001 From: bjorn Date: Sun, 1 Mar 2015 21:18:52 +0800 Subject: [PATCH 42/71] Update log_posix.c size error --- src/core/support/log_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/support/log_posix.c b/src/core/support/log_posix.c index 8f85791466d..afca792c404 100644 --- a/src/core/support/log_posix.c +++ b/src/core/support/log_posix.c @@ -64,7 +64,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity, } else { message = allocated = gpr_malloc(ret + 1); va_start(args, format); - vsnprintf(message, ret, format, args); + vsnprintf(message, ret + 1, format, args); va_end(args); } gpr_log_message(file, line, severity, message); From 53f101a7a9ffc3ee35b50a2bf609df942634d651 Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Mon, 2 Mar 2015 00:59:16 +0000 Subject: [PATCH 43/71] Moved pip dependencies into requirements.txt . This allows for easier scripting and updates. --- src/python/README.md | 2 +- src/python/requirements.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src/python/requirements.txt diff --git a/src/python/README.md b/src/python/README.md index 06ef1a0f836..490a229d1d7 100755 --- a/src/python/README.md +++ b/src/python/README.md @@ -46,7 +46,7 @@ Installing - Install gRPC Python's dependencies ``` -$ pip install enum34==1.0.4 futures==2.2.0 protobuf==3.0.0-alpha-1 +$ pip install -r requirements.txt ``` - Install gRPC Python diff --git a/src/python/requirements.txt b/src/python/requirements.txt new file mode 100644 index 00000000000..06a42e1c9ff --- /dev/null +++ b/src/python/requirements.txt @@ -0,0 +1,3 @@ +enum34==1.0.4 +futures==2.2.0 +protobuf==3.0.0-alpha-1 From faa8480a399061cef95aef394b2e1977bdef4b4a Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Sun, 1 Mar 2015 21:56:38 -0800 Subject: [PATCH 44/71] Tracer registration. First: ugh. Second: allow tracer global variables to be registered and then parsed out of a configuration environment variable. Expose TSI trace config variable directly to ease this a little. --- Makefile | 36 ++++++++++- build.json | 6 ++ src/core/channel/channel_stack.c | 2 + src/core/channel/channel_stack.h | 4 +- src/core/debug/trace.c | 62 ++++++++++--------- src/core/debug/trace.h | 23 +------ src/core/iomgr/iomgr_posix.c | 3 + src/core/iomgr/tcp_posix.c | 6 +- src/core/iomgr/tcp_posix.h | 2 + src/core/security/secure_endpoint.c | 6 +- src/core/security/secure_endpoint.h | 2 + src/core/surface/init.c | 10 ++- src/core/surface/init.h | 39 ++++++++++++ src/core/surface/init_secure.c | 42 +++++++++++++ src/core/surface/init_unsecure.c | 37 +++++++++++ src/core/surface/surface_trace.c | 36 +++++++++++ src/core/surface/surface_trace.h | 4 +- src/core/transport/chttp2/frame_settings.c | 3 +- src/core/transport/chttp2_transport.c | 5 +- src/core/transport/chttp2_transport.h | 2 + src/core/tsi/transport_security.c | 4 -- src/core/tsi/transport_security_interface.h | 4 +- vsprojects/vs2013/grpc.vcxproj | 5 ++ vsprojects/vs2013/grpc.vcxproj.filters | 9 +++ vsprojects/vs2013/grpc_shared.vcxproj | 5 ++ vsprojects/vs2013/grpc_shared.vcxproj.filters | 9 +++ vsprojects/vs2013/grpc_unsecure.vcxproj | 5 ++ .../vs2013/grpc_unsecure.vcxproj.filters | 9 +++ 28 files changed, 312 insertions(+), 68 deletions(-) create mode 100644 src/core/surface/init.h create mode 100644 src/core/surface/init_secure.c create mode 100644 src/core/surface/init_unsecure.c create mode 100644 src/core/surface/surface_trace.c diff --git a/Makefile b/Makefile index e390a3efe63..64871343e1e 100644 --- a/Makefile +++ b/Makefile @@ -2328,6 +2328,7 @@ LIBGRPC_SRC = \ src/core/security/secure_transport_setup.c \ src/core/security/security_context.c \ src/core/security/server_secure_chttp2.c \ + src/core/surface/init_secure.c \ src/core/surface/secure_channel_create.c \ src/core/surface/secure_server_create.c \ src/core/tsi/fake_transport_security.c \ @@ -2407,6 +2408,7 @@ LIBGRPC_SRC = \ src/core/surface/server.c \ src/core/surface/server_chttp2.c \ src/core/surface/server_create.c \ + src/core/surface/surface_trace.c \ src/core/transport/chttp2/alpn.c \ src/core/transport/chttp2/bin_encoder.c \ src/core/transport/chttp2/frame_data.c \ @@ -2472,6 +2474,7 @@ src/core/security/secure_endpoint.c: $(OPENSSL_DEP) src/core/security/secure_transport_setup.c: $(OPENSSL_DEP) src/core/security/security_context.c: $(OPENSSL_DEP) src/core/security/server_secure_chttp2.c: $(OPENSSL_DEP) +src/core/surface/init_secure.c: $(OPENSSL_DEP) src/core/surface/secure_channel_create.c: $(OPENSSL_DEP) src/core/surface/secure_server_create.c: $(OPENSSL_DEP) src/core/tsi/fake_transport_security.c: $(OPENSSL_DEP) @@ -2551,6 +2554,7 @@ src/core/surface/metadata_array.c: $(OPENSSL_DEP) src/core/surface/server.c: $(OPENSSL_DEP) src/core/surface/server_chttp2.c: $(OPENSSL_DEP) src/core/surface/server_create.c: $(OPENSSL_DEP) +src/core/surface/surface_trace.c: $(OPENSSL_DEP) src/core/transport/chttp2/alpn.c: $(OPENSSL_DEP) src/core/transport/chttp2/bin_encoder.c: $(OPENSSL_DEP) src/core/transport/chttp2/frame_data.c: $(OPENSSL_DEP) @@ -2633,6 +2637,7 @@ $(OBJDIR)/$(CONFIG)/src/core/security/secure_endpoint.o: $(OBJDIR)/$(CONFIG)/src/core/security/secure_transport_setup.o: $(OBJDIR)/$(CONFIG)/src/core/security/security_context.o: $(OBJDIR)/$(CONFIG)/src/core/security/server_secure_chttp2.o: +$(OBJDIR)/$(CONFIG)/src/core/surface/init_secure.o: $(OBJDIR)/$(CONFIG)/src/core/surface/secure_channel_create.o: $(OBJDIR)/$(CONFIG)/src/core/surface/secure_server_create.o: $(OBJDIR)/$(CONFIG)/src/core/tsi/fake_transport_security.o: @@ -2712,6 +2717,7 @@ $(OBJDIR)/$(CONFIG)/src/core/surface/metadata_array.o: $(OBJDIR)/$(CONFIG)/src/core/surface/server.o: $(OBJDIR)/$(CONFIG)/src/core/surface/server_chttp2.o: $(OBJDIR)/$(CONFIG)/src/core/surface/server_create.o: +$(OBJDIR)/$(CONFIG)/src/core/surface/surface_trace.o: $(OBJDIR)/$(CONFIG)/src/core/transport/chttp2/alpn.o: $(OBJDIR)/$(CONFIG)/src/core/transport/chttp2/bin_encoder.o: $(OBJDIR)/$(CONFIG)/src/core/transport/chttp2/frame_data.o: @@ -2811,6 +2817,7 @@ $(OBJDIR)/$(CONFIG)/test/core/util/slice_splitter.o: LIBGRPC_UNSECURE_SRC = \ + src/core/surface/init_unsecure.c \ src/core/channel/call_op_string.c \ src/core/channel/census_filter.c \ src/core/channel/channel_args.c \ @@ -2885,6 +2892,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/surface/server.c \ src/core/surface/server_chttp2.c \ src/core/surface/server_create.c \ + src/core/surface/surface_trace.c \ src/core/transport/chttp2/alpn.c \ src/core/transport/chttp2/bin_encoder.c \ src/core/transport/chttp2/frame_data.c \ @@ -2947,6 +2955,7 @@ ifneq ($(NO_DEPS),true) -include $(LIBGRPC_UNSECURE_OBJS:.o=.dep) endif +$(OBJDIR)/$(CONFIG)/src/core/surface/init_unsecure.o: $(OBJDIR)/$(CONFIG)/src/core/channel/call_op_string.o: $(OBJDIR)/$(CONFIG)/src/core/channel/census_filter.o: $(OBJDIR)/$(CONFIG)/src/core/channel/channel_args.o: @@ -3021,6 +3030,7 @@ $(OBJDIR)/$(CONFIG)/src/core/surface/metadata_array.o: $(OBJDIR)/$(CONFIG)/src/core/surface/server.o: $(OBJDIR)/$(CONFIG)/src/core/surface/server_chttp2.o: $(OBJDIR)/$(CONFIG)/src/core/surface/server_create.o: +$(OBJDIR)/$(CONFIG)/src/core/surface/surface_trace.o: $(OBJDIR)/$(CONFIG)/src/core/transport/chttp2/alpn.o: $(OBJDIR)/$(CONFIG)/src/core/transport/chttp2/bin_encoder.o: $(OBJDIR)/$(CONFIG)/src/core/transport/chttp2/frame_data.o: @@ -8076,13 +8086,24 @@ $(BINDIR)/$(CONFIG)/qps_client_async: openssl_dep_error else -$(BINDIR)/$(CONFIG)/qps_client_async: $(QPS_CLIENT_ASYNC_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+. + +$(BINDIR)/$(CONFIG)/qps_client_async: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/qps_client_async: $(PROTOBUF_DEP) $(QPS_CLIENT_ASYNC_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` $(Q) $(LDXX) $(LDFLAGS) $(QPS_CLIENT_ASYNC_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/qps_client_async endif +endif + $(OBJDIR)/$(CONFIG)/test/cpp/qps/qpstest.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a @@ -8153,13 +8174,24 @@ $(BINDIR)/$(CONFIG)/qps_server_async: openssl_dep_error else -$(BINDIR)/$(CONFIG)/qps_server_async: $(QPS_SERVER_ASYNC_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+. + +$(BINDIR)/$(CONFIG)/qps_server_async: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/qps_server_async: $(PROTOBUF_DEP) $(QPS_SERVER_ASYNC_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` $(Q) $(LDXX) $(LDFLAGS) $(QPS_SERVER_ASYNC_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/qps_server_async endif +endif + $(OBJDIR)/$(CONFIG)/test/cpp/qps/qpstest.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/qps/server_async.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a diff --git a/build.json b/build.json index 6be1d537ffa..e8ecd8eb43c 100644 --- a/build.json +++ b/build.json @@ -79,6 +79,7 @@ "src/core/surface/client.h", "src/core/surface/completion_queue.h", "src/core/surface/event_string.h", + "src/core/surface/init.h", "src/core/surface/lame_client.h", "src/core/surface/server.h", "src/core/surface/surface_trace.h", @@ -180,6 +181,7 @@ "src/core/surface/server.c", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", + "src/core/surface/surface_trace.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/bin_encoder.c", "src/core/transport/chttp2/frame_data.c", @@ -329,6 +331,7 @@ "src/core/security/secure_transport_setup.c", "src/core/security/security_context.c", "src/core/security/server_secure_chttp2.c", + "src/core/surface/init_secure.c", "src/core/surface/secure_channel_create.c", "src/core/surface/secure_server_create.c", "src/core/tsi/fake_transport_security.c", @@ -372,6 +375,9 @@ "name": "grpc_unsecure", "build": "all", "language": "c", + "src": [ + "src/core/surface/init_unsecure.c" + ], "deps": [ "gpr" ], diff --git a/src/core/channel/channel_stack.c b/src/core/channel/channel_stack.c index 0382a7a2f30..21df9771cea 100644 --- a/src/core/channel/channel_stack.c +++ b/src/core/channel/channel_stack.c @@ -36,6 +36,8 @@ #include +int grpc_trace_channel = 0; + /* Memory layouts. Channel stack is laid out as: { diff --git a/src/core/channel/channel_stack.h b/src/core/channel/channel_stack.h index c136f5c17ca..ef1da7b33b2 100644 --- a/src/core/channel/channel_stack.h +++ b/src/core/channel/channel_stack.h @@ -298,7 +298,9 @@ void grpc_call_element_recv_metadata(grpc_call_element *cur_elem, void grpc_call_element_send_cancel(grpc_call_element *cur_elem); void grpc_call_element_send_finish(grpc_call_element *cur_elem); +extern int grpc_trace_channel; + #define GRPC_CALL_LOG_OP(sev, elem, op) \ - if (grpc_trace_bits & GRPC_TRACE_CHANNEL) grpc_call_log_op(sev, elem, op) + if (grpc_trace_channel) grpc_call_log_op(sev, elem, op) #endif /* GRPC_INTERNAL_CORE_CHANNEL_CHANNEL_STACK_H */ diff --git a/src/core/debug/trace.c b/src/core/debug/trace.c index 6f84ee2c305..9389631fae3 100644 --- a/src/core/debug/trace.c +++ b/src/core/debug/trace.c @@ -39,8 +39,21 @@ #include #include "src/core/support/env.h" -#if GRPC_ENABLE_TRACING -gpr_uint32 grpc_trace_bits = 0; +typedef struct tracer { + const char *name; + int *flag; + struct tracer *next; +} tracer; +static tracer *tracers; + +void grpc_register_tracer(const char *name, int *flag) { + tracer *t = gpr_malloc(sizeof(*t)); + t->name = name; + t->flag = flag; + t->next = tracers; + *flag = 0; + tracers = t; +} static void add(const char *beg, const char *end, char ***ss, size_t *ns) { size_t n = *ns; @@ -67,28 +80,26 @@ static void parse(const char *s) { char **strings = NULL; size_t nstrings = 0; size_t i; + tracer *t; split(s, &strings, &nstrings); - grpc_trace_bits = 0; - for (i = 0; i < nstrings; i++) { const char *s = strings[i]; - if (0 == strcmp(s, "surface")) { - grpc_trace_bits |= GRPC_TRACE_SURFACE; - } else if (0 == strcmp(s, "channel")) { - grpc_trace_bits |= GRPC_TRACE_CHANNEL; - } else if (0 == strcmp(s, "tcp")) { - grpc_trace_bits |= GRPC_TRACE_TCP; - } else if (0 == strcmp(s, "secure_endpoint")) { - grpc_trace_bits |= GRPC_TRACE_SECURE_ENDPOINT; - } else if (0 == strcmp(s, "http")) { - grpc_trace_bits |= GRPC_TRACE_HTTP; - } else if (0 == strcmp(s, "ssl")) { - grpc_trace_bits |= GRPC_TRACE_SSL; - } else if (0 == strcmp(s, "all")) { - grpc_trace_bits = -1; + if (0 == strcmp(s, "all")) { + for (t = tracers; t; t = t->next) { + *t->flag = 1; + } } else { - gpr_log(GPR_ERROR, "Unknown trace var: '%s'", s); + int found = 0; + for (t = tracers; t; t = t->next) { + if (0 == strcmp(s, t->name)) { + *t->flag = 1; + found = 1; + } + } + if (!found) { + gpr_log(GPR_ERROR, "Unknown trace var: '%s'", s); + } } } @@ -98,17 +109,10 @@ static void parse(const char *s) { gpr_free(strings); } -void grpc_init_trace_bits() { - char *e = gpr_getenv("GRPC_TRACE"); - if (e == NULL) { - grpc_trace_bits = 0; - } else { +void grpc_tracer_init(const char *env_var) { + char *e = gpr_getenv(env_var); + if (e != NULL) { parse(e); gpr_free(e); } } -#else -void grpc_init_trace_bits() { -} -#endif - diff --git a/src/core/debug/trace.h b/src/core/debug/trace.h index e11630f7e96..c02f14b7f20 100644 --- a/src/core/debug/trace.h +++ b/src/core/debug/trace.h @@ -36,26 +36,7 @@ #include -/* set to zero to remove all debug trace code */ -#ifndef GRPC_ENABLE_TRACING -# define GRPC_ENABLE_TRACING 1 -#endif - -typedef enum { - GRPC_TRACE_SURFACE = 1 << 0, - GRPC_TRACE_CHANNEL = 1 << 1, - GRPC_TRACE_TCP = 1 << 2, - GRPC_TRACE_SECURE_ENDPOINT = 1 << 3, - GRPC_TRACE_HTTP = 1 << 4, - GRPC_TRACE_SSL = 1 << 5 -} grpc_trace_bit_value; - -#if GRPC_ENABLE_TRACING -extern gpr_uint32 grpc_trace_bits; -#else -# define grpc_trace_bits 0 -#endif - -void grpc_init_trace_bits(); +void grpc_register_tracer(const char *name, int *flag); +void grpc_tracer_init(const char *env_var_name); #endif /* GRPC_INTERNAL_CORE_DEBUG_TRACE_H */ diff --git a/src/core/iomgr/iomgr_posix.c b/src/core/iomgr/iomgr_posix.c index 14e3d182f66..758ae77b864 100644 --- a/src/core/iomgr/iomgr_posix.c +++ b/src/core/iomgr/iomgr_posix.c @@ -36,11 +36,14 @@ #ifdef GPR_POSIX_SOCKET #include "src/core/iomgr/iomgr_posix.h" +#include "src/core/debug/trace.h" #include "src/core/iomgr/fd_posix.h" +#include "src/core/iomgr/tcp_posix.h" void grpc_iomgr_platform_init(void) { grpc_fd_global_init(); grpc_pollset_global_init(); + grpc_register_tracer("tcp", &grpc_tcp_trace); } void grpc_iomgr_platform_shutdown(void) { diff --git a/src/core/iomgr/tcp_posix.c b/src/core/iomgr/tcp_posix.c index eceb0feadb1..597a2a62d37 100644 --- a/src/core/iomgr/tcp_posix.c +++ b/src/core/iomgr/tcp_posix.c @@ -63,6 +63,8 @@ typedef struct grpc_tcp_slice_state { int memory_owned; /* True if slices array is owned */ } grpc_tcp_slice_state; +int grpc_tcp_trace = 0; + static void slice_state_init(grpc_tcp_slice_state *state, gpr_slice *slices, size_t nslices, size_t valid_slices) { state->slices = slices; @@ -294,7 +296,7 @@ static void call_read_cb(grpc_tcp *tcp, gpr_slice *slices, size_t nslices, grpc_endpoint_cb_status status) { grpc_endpoint_read_cb cb = tcp->read_cb; - if (grpc_trace_bits & GRPC_TRACE_TCP) { + if (grpc_tcp_trace) { size_t i; gpr_log(GPR_DEBUG, "read: status=%d", status); for (i = 0; i < nslices; i++) { @@ -495,7 +497,7 @@ static grpc_endpoint_write_status grpc_tcp_write(grpc_endpoint *ep, grpc_tcp *tcp = (grpc_tcp *)ep; grpc_endpoint_write_status status; - if (grpc_trace_bits & GRPC_TRACE_TCP) { + if (grpc_tcp_trace) { size_t i; for (i = 0; i < nslices; i++) { diff --git a/src/core/iomgr/tcp_posix.h b/src/core/iomgr/tcp_posix.h index 7e8064bffc7..44279d5a26b 100644 --- a/src/core/iomgr/tcp_posix.h +++ b/src/core/iomgr/tcp_posix.h @@ -49,6 +49,8 @@ #define GRPC_TCP_DEFAULT_READ_SLICE_SIZE 8192 +extern int grpc_tcp_trace; + /* Create a tcp endpoint given a file desciptor and a read slice size. Takes ownership of fd. */ grpc_endpoint *grpc_tcp_create(grpc_fd *fd, size_t read_slice_size); diff --git a/src/core/security/secure_endpoint.c b/src/core/security/secure_endpoint.c index d6bdf5a709f..7bb1de44132 100644 --- a/src/core/security/secure_endpoint.c +++ b/src/core/security/secure_endpoint.c @@ -65,6 +65,8 @@ typedef struct { gpr_refcount ref; } secure_endpoint; +int grpc_trace_secure_endpoint = 0; + static void secure_endpoint_ref(secure_endpoint *ep) { gpr_ref(&ep->ref); } static void destroy(secure_endpoint *secure_ep) { @@ -96,7 +98,7 @@ static void flush_read_staging_buffer(secure_endpoint *ep, gpr_uint8 **cur, static void call_read_cb(secure_endpoint *ep, gpr_slice *slices, size_t nslices, grpc_endpoint_cb_status error) { - if (grpc_trace_bits & GRPC_TRACE_SECURE_ENDPOINT) { + if (grpc_trace_secure_endpoint) { size_t i; for (i = 0; i < nslices; i++) { char *data = @@ -231,7 +233,7 @@ static grpc_endpoint_write_status endpoint_write(grpc_endpoint *secure_ep, grpc_endpoint_write_status status; GPR_ASSERT(ep->output_buffer.count == 0); - if (grpc_trace_bits & GRPC_TRACE_SECURE_ENDPOINT) { + if (grpc_trace_secure_endpoint) { for (i = 0; i < nslices; i++) { char *data = gpr_hexdump((char *)GPR_SLICE_START_PTR(slices[i]), diff --git a/src/core/security/secure_endpoint.h b/src/core/security/secure_endpoint.h index 808889bf047..93c29b51110 100644 --- a/src/core/security/secure_endpoint.h +++ b/src/core/security/secure_endpoint.h @@ -39,6 +39,8 @@ struct tsi_frame_protector; +extern int grpc_trace_secure_endpoint; + /* Takes ownership of protector and to_wrap, and refs leftover_slices. */ grpc_endpoint *grpc_secure_endpoint_create( struct tsi_frame_protector *protector, grpc_endpoint *to_wrap, diff --git a/src/core/surface/init.c b/src/core/surface/init.c index 2d8f36e9c2f..4db66fb66eb 100644 --- a/src/core/surface/init.c +++ b/src/core/surface/init.c @@ -35,6 +35,10 @@ #include "src/core/iomgr/iomgr.h" #include "src/core/debug/trace.h" #include "src/core/statistics/census_interface.h" +#include "src/core/channel/channel_stack.h" +#include "src/core/surface/init.h" +#include "src/core/surface/surface_trace.h" +#include "src/core/transport/chttp2_transport.h" static gpr_once g_init = GPR_ONCE_INIT; static gpr_mu g_init_mu; @@ -50,7 +54,11 @@ void grpc_init(void) { gpr_mu_lock(&g_init_mu); if (++g_initializations == 1) { - grpc_init_trace_bits(); + grpc_register_tracer("channel", &grpc_trace_channel); + grpc_register_tracer("surface", &grpc_surface_trace); + grpc_register_tracer("http", &grpc_http_trace); + grpc_security_pre_init(); + grpc_tracer_init("GRPC_TRACE"); grpc_iomgr_init(); census_init(); } diff --git a/src/core/surface/init.h b/src/core/surface/init.h new file mode 100644 index 00000000000..ab40bedf875 --- /dev/null +++ b/src/core/surface/init.h @@ -0,0 +1,39 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_INTERNAL_CORE_SURFACE_INIT_H +#define GRPC_INTERNAL_CORE_SURFACE_INIT_H + +void grpc_security_pre_init(void); + +#endif /* GRPC_INTERNAL_CORE_SURFACE_INIT_H */ diff --git a/src/core/surface/init_secure.c b/src/core/surface/init_secure.c new file mode 100644 index 00000000000..5d7e5c4ddaf --- /dev/null +++ b/src/core/surface/init_secure.c @@ -0,0 +1,42 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/surface/init.h" +#include "src/core/debug/trace.h" +#include "src/core/security/secure_endpoint.h" +#include "src/core/tsi/transport_security_interface.h" + +void grpc_security_pre_init(void) { + grpc_register_tracer("secure_endpoint", &grpc_trace_secure_endpoint); + grpc_register_tracer("ssl", &tsi_tracing_enabled); +} diff --git a/src/core/surface/init_unsecure.c b/src/core/surface/init_unsecure.c new file mode 100644 index 00000000000..ddb70cef8e9 --- /dev/null +++ b/src/core/surface/init_unsecure.c @@ -0,0 +1,37 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/surface/init.h" + +void grpc_security_pre_init(void) { +} diff --git a/src/core/surface/surface_trace.c b/src/core/surface/surface_trace.c new file mode 100644 index 00000000000..57a0053162a --- /dev/null +++ b/src/core/surface/surface_trace.c @@ -0,0 +1,36 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/surface/surface_trace.h" + +int grpc_surface_trace = 0; diff --git a/src/core/surface/surface_trace.h b/src/core/surface/surface_trace.h index 50071ee317d..01302bb5d4d 100644 --- a/src/core/surface/surface_trace.h +++ b/src/core/surface/surface_trace.h @@ -37,8 +37,10 @@ #include "src/core/debug/trace.h" #include +extern int grpc_surface_trace; + #define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \ - if (grpc_trace_bits & GRPC_TRACE_SURFACE) { \ + if (grpc_surface_trace) { \ char *_ev = grpc_event_string(event); \ gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, _ev); \ gpr_free(_ev); \ diff --git a/src/core/transport/chttp2/frame_settings.c b/src/core/transport/chttp2/frame_settings.c index e6c4b7e38f1..8d3250c34ff 100644 --- a/src/core/transport/chttp2/frame_settings.c +++ b/src/core/transport/chttp2/frame_settings.c @@ -37,6 +37,7 @@ #include "src/core/debug/trace.h" #include "src/core/transport/chttp2/frame.h" +#include "src/core/transport/chttp2_transport.h" #include #include @@ -218,7 +219,7 @@ grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse( } } parser->incoming_settings[parser->id] = parser->value; - if (grpc_trace_bits & GRPC_TRACE_HTTP) { + if (grpc_http_trace) { gpr_log(GPR_DEBUG, "CHTTP2: got setting %d = %d", parser->id, parser->value); } diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 476cc4b226e..1c5efca6759 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -37,7 +37,6 @@ #include #include -#include "src/core/debug/trace.h" #include "src/core/support/string.h" #include "src/core/transport/chttp2/frame_data.h" #include "src/core/transport/chttp2/frame_goaway.h" @@ -64,11 +63,13 @@ #define CLIENT_CONNECT_STRING "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" #define CLIENT_CONNECT_STRLEN 24 +int grpc_http_trace = 0; + typedef struct transport transport; typedef struct stream stream; #define IF_TRACING(stmt) \ - if (!(grpc_trace_bits & GRPC_TRACE_HTTP)) \ + if (!(grpc_http_trace)) \ ; \ else \ stmt diff --git a/src/core/transport/chttp2_transport.h b/src/core/transport/chttp2_transport.h index c5b65bd4f75..a7f1b9a8646 100644 --- a/src/core/transport/chttp2_transport.h +++ b/src/core/transport/chttp2_transport.h @@ -37,6 +37,8 @@ #include "src/core/iomgr/endpoint.h" #include "src/core/transport/transport.h" +extern int grpc_http_trace; + void grpc_create_chttp2_transport(grpc_transport_setup_callback setup, void *arg, const grpc_channel_args *channel_args, diff --git a/src/core/tsi/transport_security.c b/src/core/tsi/transport_security.c index 04b30004fcd..c8c74c5de59 100644 --- a/src/core/tsi/transport_security.c +++ b/src/core/tsi/transport_security.c @@ -40,10 +40,6 @@ int tsi_tracing_enabled = 0; -void tsi_enable_tracing() { - tsi_tracing_enabled = 1; -} - /* --- Utils. --- */ char* tsi_strdup(const char* src) { diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h index 33a19bef0de..4e7ad00421d 100644 --- a/src/core/tsi/transport_security_interface.h +++ b/src/core/tsi/transport_security_interface.h @@ -63,8 +63,8 @@ const char* tsi_result_to_string(tsi_result result); /* --- tsi tracing --- */ -/* Call this function before any other tsi function to avoid races. */ -void tsi_enable_tracing(void); +/* set this early to avoid races */ +extern int tsi_tracing_enabled; /* --- tsi_frame_protector object --- diff --git a/vsprojects/vs2013/grpc.vcxproj b/vsprojects/vs2013/grpc.vcxproj index 48f975f99bb..60dc9802420 100644 --- a/vsprojects/vs2013/grpc.vcxproj +++ b/vsprojects/vs2013/grpc.vcxproj @@ -160,6 +160,7 @@ + @@ -219,6 +220,8 @@ + + @@ -377,6 +380,8 @@ + + diff --git a/vsprojects/vs2013/grpc.vcxproj.filters b/vsprojects/vs2013/grpc.vcxproj.filters index 867e54516c5..9fc70e74d9d 100644 --- a/vsprojects/vs2013/grpc.vcxproj.filters +++ b/vsprojects/vs2013/grpc.vcxproj.filters @@ -49,6 +49,9 @@ src\core\security + + src\core\surface + src\core\surface @@ -286,6 +289,9 @@ src\core\surface + + src\core\surface + src\core\transport\chttp2 @@ -590,6 +596,9 @@ src\core\surface + + src\core\surface + src\core\surface diff --git a/vsprojects/vs2013/grpc_shared.vcxproj b/vsprojects/vs2013/grpc_shared.vcxproj index 4b2f1e725e2..5c2e23b5139 100644 --- a/vsprojects/vs2013/grpc_shared.vcxproj +++ b/vsprojects/vs2013/grpc_shared.vcxproj @@ -164,6 +164,7 @@ + @@ -223,6 +224,8 @@ + + @@ -381,6 +384,8 @@ + + diff --git a/vsprojects/vs2013/grpc_shared.vcxproj.filters b/vsprojects/vs2013/grpc_shared.vcxproj.filters index 867e54516c5..9fc70e74d9d 100644 --- a/vsprojects/vs2013/grpc_shared.vcxproj.filters +++ b/vsprojects/vs2013/grpc_shared.vcxproj.filters @@ -49,6 +49,9 @@ src\core\security + + src\core\surface + src\core\surface @@ -286,6 +289,9 @@ src\core\surface + + src\core\surface + src\core\transport\chttp2 @@ -590,6 +596,9 @@ src\core\surface + + src\core\surface + src\core\surface diff --git a/vsprojects/vs2013/grpc_unsecure.vcxproj b/vsprojects/vs2013/grpc_unsecure.vcxproj index 0c81ec4768b..9181db0b4e1 100644 --- a/vsprojects/vs2013/grpc_unsecure.vcxproj +++ b/vsprojects/vs2013/grpc_unsecure.vcxproj @@ -145,6 +145,7 @@ + @@ -172,6 +173,8 @@ + + @@ -320,6 +323,8 @@ + + diff --git a/vsprojects/vs2013/grpc_unsecure.vcxproj.filters b/vsprojects/vs2013/grpc_unsecure.vcxproj.filters index 4b5370a5735..4583fa41eab 100644 --- a/vsprojects/vs2013/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vs2013/grpc_unsecure.vcxproj.filters @@ -1,6 +1,9 @@ + + src\core\surface + src\core\channel @@ -223,6 +226,9 @@ src\core\surface + + src\core\surface + src\core\transport\chttp2 @@ -482,6 +488,9 @@ src\core\surface + + src\core\surface + src\core\surface From 077e75cba9b0ebcfb8acc0eb9e9652cad99c8a59 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Sun, 1 Mar 2015 21:59:17 -0800 Subject: [PATCH 45/71] Fix memory allocation --- src/core/debug/trace.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/debug/trace.c b/src/core/debug/trace.c index 9389631fae3..32c35e7fb3a 100644 --- a/src/core/debug/trace.c +++ b/src/core/debug/trace.c @@ -115,4 +115,9 @@ void grpc_tracer_init(const char *env_var) { parse(e); gpr_free(e); } + while (tracers) { + tracer *t = tracers; + tracers = t->next; + gpr_free(t); + } } From a60a77b63f203751dd0b38d4bfa400bf72fab052 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Mon, 2 Mar 2015 08:30:49 +0000 Subject: [PATCH 46/71] Update Python codegen to early_adopter interface With this change the Python code generated by the Python code generator uses the grpc.early_adopter package and not the grpc.framework.face package. --- src/compiler/python_generator.cc | 204 ++++++++++++++++------------ test/compiler/python_plugin_test.py | 2 +- 2 files changed, 115 insertions(+), 91 deletions(-) diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc index b8d4aa509b4..b217c0d911f 100644 --- a/src/compiler/python_generator.cc +++ b/src/compiler/python_generator.cc @@ -237,54 +237,70 @@ bool PrintServerFactory(const ServiceDescriptor* service, Printer* out) { "Service", service->name()); { IndentScope raii_create_server_indent(out); - map> method_to_module_and_message; - out->Print("method_implementations = {\n"); + map method_description_constructors; + map> input_message_modules_and_classes; + map> output_message_modules_and_classes; for (int i = 0; i < service->method_count(); ++i) { - IndentScope raii_implementations_indent(out); - const MethodDescriptor* meth = service->method(i); - string meth_type = - string(meth->client_streaming() ? "stream" : "unary") + - string(meth->server_streaming() ? "_stream" : "_unary") + "_inline"; - out->Print("\"$Method$\": utilities.$Type$(servicer.$Method$),\n", - "Method", meth->name(), - "Type", meth_type); - // Maintain information on the input type of the service method for later - // use in constructing the service assembly's activated fore link. - const Descriptor* input_type = meth->input_type(); - pair module_and_message; - if (!GetModuleAndMessagePath(input_type, &module_and_message)) { + const MethodDescriptor* method = service->method(i); + const string method_description_constructor = + string(method->client_streaming() ? "stream_" : "unary_") + + string(method->server_streaming() ? "stream_" : "unary_") + + "service_description"; + pair input_message_module_and_class; + if (!GetModuleAndMessagePath(method->input_type(), + &input_message_module_and_class)) { return false; } - method_to_module_and_message.insert( - make_pair(meth->name(), module_and_message)); - } - out->Print("}\n"); - // Ensure that we've imported all of the relevant messages. - for (auto& meth_vals : method_to_module_and_message) { - out->Print("import $Module$\n", - "Module", meth_vals.second.first); - } - out->Print("request_deserializers = {\n"); - for (auto& meth_vals : method_to_module_and_message) { - IndentScope raii_serializers_indent(out); - string full_input_type_path = meth_vals.second.first + "." + - meth_vals.second.second; - out->Print("\"$Method$\": $Type$.FromString,\n", - "Method", meth_vals.first, - "Type", full_input_type_path); + pair output_message_module_and_class; + if (!GetModuleAndMessagePath(method->output_type(), + &output_message_module_and_class)) { + return false; + } + // Import the modules that define the messages used in RPCs. + out->Print("import $Module$\n", "Module", + input_message_module_and_class.first); + out->Print("import $Module$\n", "Module", + output_message_module_and_class.first); + method_description_constructors.insert( + make_pair(method->name(), method_description_constructor)); + input_message_modules_and_classes.insert( + make_pair(method->name(), input_message_module_and_class)); + output_message_modules_and_classes.insert( + make_pair(method->name(), output_message_module_and_class)); } - out->Print("}\n"); - out->Print("response_serializers = {\n"); - for (auto& meth_vals : method_to_module_and_message) { - IndentScope raii_serializers_indent(out); - out->Print("\"$Method$\": lambda x: x.SerializeToString(),\n", - "Method", meth_vals.first); + out->Print("method_service_descriptions = {\n"); + for (auto& name_and_description_constructor : + method_description_constructors) { + IndentScope raii_descriptions_indent(out); + const string method_name = name_and_description_constructor.first; + auto input_message_module_and_class = + input_message_modules_and_classes.find(method_name); + auto output_message_module_and_class = + output_message_modules_and_classes.find(method_name); + out->Print("\"$Method$\": utilities.$Constructor$(\n", "Method", + method_name, "Constructor", + name_and_description_constructor.second); + { + IndentScope raii_description_arguments_indent(out); + out->Print("servicer.$Method$,\n", "Method", method_name); + out->Print( + "$InputTypeModule$.$InputTypeClass$.FromString,\n", + "InputTypeModule", input_message_module_and_class->second.first, + "InputTypeClass", input_message_module_and_class->second.second); + out->Print( + "$OutputTypeModule$.$OutputTypeClass$.SerializeToString,\n", + "OutputTypeModule", output_message_module_and_class->second.first, + "OutputTypeClass", output_message_module_and_class->second.second); + } + out->Print("),\n"); } out->Print("}\n"); - out->Print("link = fore.activated_fore_link(port, request_deserializers, " - "response_serializers, root_certificates, key_chain_pairs)\n"); - out->Print("return implementations.assemble_service(" - "method_implementations, link)\n"); + // out->Print("return implementations.insecure_server(" + // "method_service_descriptions, port)\n"); + out->Print( + "return implementations.secure_server(" + "method_service_descriptions, port, root_certificates," + " key_chain_pairs)\n"); } return true; } @@ -296,66 +312,74 @@ bool PrintStubFactory(const ServiceDescriptor* service, Printer* out) { out->Print(dict, "def early_adopter_create_$Service$_stub(host, port):\n"); { IndentScope raii_create_server_indent(out); - map> method_to_module_and_message; - out->Print("method_implementations = {\n"); + map method_description_constructors; + map> input_message_modules_and_classes; + map> output_message_modules_and_classes; for (int i = 0; i < service->method_count(); ++i) { - IndentScope raii_implementations_indent(out); - const MethodDescriptor* meth = service->method(i); - string meth_type = - string(meth->client_streaming() ? "stream" : "unary") + - string(meth->server_streaming() ? "_stream" : "_unary") + "_inline"; - // TODO(atash): once the expected input to assemble_dynamic_inline_stub is - // cleaned up, change this to the expected argument's dictionary values. - out->Print("\"$Method$\": utilities.$Type$(None),\n", - "Method", meth->name(), - "Type", meth_type); - // Maintain information on the input type of the service method for later - // use in constructing the service assembly's activated fore link. - const Descriptor* output_type = meth->output_type(); - pair module_and_message; - if (!GetModuleAndMessagePath(output_type, &module_and_message)) { + const MethodDescriptor* method = service->method(i); + const string method_description_constructor = + string(method->client_streaming() ? "stream_" : "unary_") + + string(method->server_streaming() ? "stream_" : "unary_") + + "invocation_description"; + pair input_message_module_and_class; + if (!GetModuleAndMessagePath(method->input_type(), + &input_message_module_and_class)) { return false; } - method_to_module_and_message.insert( - make_pair(meth->name(), module_and_message)); - } - out->Print("}\n"); - // Ensure that we've imported all of the relevant messages. - for (auto& meth_vals : method_to_module_and_message) { - out->Print("import $Module$\n", - "Module", meth_vals.second.first); - } - out->Print("response_deserializers = {\n"); - for (auto& meth_vals : method_to_module_and_message) { - IndentScope raii_serializers_indent(out); - string full_output_type_path = meth_vals.second.first + "." + - meth_vals.second.second; - out->Print("\"$Method$\": $Type$.FromString,\n", - "Method", meth_vals.first, - "Type", full_output_type_path); + pair output_message_module_and_class; + if (!GetModuleAndMessagePath(method->output_type(), + &output_message_module_and_class)) { + return false; + } + // Import the modules that define the messages used in RPCs. + out->Print("import $Module$\n", "Module", + input_message_module_and_class.first); + out->Print("import $Module$\n", "Module", + output_message_module_and_class.first); + method_description_constructors.insert( + make_pair(method->name(), method_description_constructor)); + input_message_modules_and_classes.insert( + make_pair(method->name(), input_message_module_and_class)); + output_message_modules_and_classes.insert( + make_pair(method->name(), output_message_module_and_class)); } - out->Print("}\n"); - out->Print("request_serializers = {\n"); - for (auto& meth_vals : method_to_module_and_message) { - IndentScope raii_serializers_indent(out); - out->Print("\"$Method$\": lambda x: x.SerializeToString(),\n", - "Method", meth_vals.first); + out->Print("method_invocation_descriptions = {\n"); + for (auto& name_and_description_constructor : + method_description_constructors) { + IndentScope raii_descriptions_indent(out); + const string method_name = name_and_description_constructor.first; + auto input_message_module_and_class = + input_message_modules_and_classes.find(method_name); + auto output_message_module_and_class = + output_message_modules_and_classes.find(method_name); + out->Print("\"$Method$\": utilities.$Constructor$(\n", "Method", + method_name, "Constructor", + name_and_description_constructor.second); + { + IndentScope raii_description_arguments_indent(out); + out->Print( + "$InputTypeModule$.$InputTypeClass$.SerializeToString,\n", + "InputTypeModule", input_message_module_and_class->second.first, + "InputTypeClass", input_message_module_and_class->second.second); + out->Print( + "$OutputTypeModule$.$OutputTypeClass$.FromString,\n", + "OutputTypeModule", output_message_module_and_class->second.first, + "OutputTypeClass", output_message_module_and_class->second.second); + } + out->Print("),\n"); } out->Print("}\n"); - out->Print("link = rear.activated_rear_link(" - "host, port, request_serializers, response_deserializers)\n"); - out->Print("return implementations.assemble_dynamic_inline_stub(" - "method_implementations, link)\n"); + out->Print( + "return implementations.insecure_stub(" + "method_invocation_descriptions, host, port)\n"); } return true; } bool PrintPreamble(const FileDescriptor* file, Printer* out) { out->Print("import abc\n"); - out->Print("from grpc._adapter import fore\n"); - out->Print("from grpc._adapter import rear\n"); - out->Print("from grpc.framework.assembly import implementations\n"); - out->Print("from grpc.framework.assembly import utilities\n"); + out->Print("from grpc.early_adopter import implementations\n"); + out->Print("from grpc.early_adopter import utilities\n"); return true; } diff --git a/test/compiler/python_plugin_test.py b/test/compiler/python_plugin_test.py index 1981f49fbb8..f16682862c3 100644 --- a/test/compiler/python_plugin_test.py +++ b/test/compiler/python_plugin_test.py @@ -37,7 +37,7 @@ import sys import time import unittest -from grpc.framework.face import exceptions +from grpc.early_adopter import exceptions from grpc.framework.foundation import future # Identifiers of entities we expect to find in the generated module. From 748fe3ffe29a97a5f3dc1ca8daac9c9e18ac3cd0 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 2 Mar 2015 07:48:50 -0800 Subject: [PATCH 47/71] Potential fix for stuck RPCs at shutdown --- src/core/transport/chttp2_transport.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 476cc4b226e..4230b523b16 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -309,6 +309,7 @@ static void push_setting(transport *t, grpc_chttp2_setting_id id, static int prepare_callbacks(transport *t); static void run_callbacks(transport *t, const grpc_transport_callbacks *cb); +static void call_cb_closed(transport *t, const grpc_transport_callbacks *cb); static int prepare_write(transport *t); static void perform_write(transport *t, grpc_endpoint *ep); @@ -516,13 +517,13 @@ static void init_transport(transport *t, grpc_transport_setup_callback setup, static void destroy_transport(grpc_transport *gt) { transport *t = (transport *)gt; - gpr_mu_lock(&t->mu); + lock(t); t->destroying = 1; while (t->calling_back) { gpr_cv_wait(&t->cv, &t->mu, gpr_inf_future); } - t->cb = NULL; - gpr_mu_unlock(&t->mu); + drop_connection(t); + unlock(t); unref_transport(t); } @@ -772,7 +773,7 @@ static void unlock(transport *t) { } if (call_closed) { - cb->closed(t->cb_user_data, &t->base); + call_cb_closed(t, cb); } /* write some bytes if necessary */ @@ -1765,6 +1766,10 @@ static void run_callbacks(transport *t, const grpc_transport_callbacks *cb) { } } +static void call_cb_closed(transport *t, const grpc_transport_callbacks *cb) { + cb->closed(t->cb_user_data, &t->base); +} + static void add_to_pollset(grpc_transport *gt, grpc_pollset *pollset) { transport *t = (transport *)gt; lock(t); From 5cdf37eb7b76cc06d02ef9a7ba03bf40c6c372a4 Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Mon, 2 Mar 2015 01:05:22 +0000 Subject: [PATCH 48/71] Removed execute permissions from README files. --- src/csharp/README.md | 0 src/php/README.md | 0 src/php/tests/data/README | 0 src/python/README.md | 0 src/python/interop/interop/credentials/README | 0 src/ruby/README.md | 0 src/ruby/bin/interop/README.md | 0 src/ruby/spec/testdata/README | 0 8 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/csharp/README.md mode change 100755 => 100644 src/php/README.md mode change 100755 => 100644 src/php/tests/data/README mode change 100755 => 100644 src/python/README.md mode change 100755 => 100644 src/python/interop/interop/credentials/README mode change 100755 => 100644 src/ruby/README.md mode change 100755 => 100644 src/ruby/bin/interop/README.md mode change 100755 => 100644 src/ruby/spec/testdata/README diff --git a/src/csharp/README.md b/src/csharp/README.md old mode 100755 new mode 100644 diff --git a/src/php/README.md b/src/php/README.md old mode 100755 new mode 100644 diff --git a/src/php/tests/data/README b/src/php/tests/data/README old mode 100755 new mode 100644 diff --git a/src/python/README.md b/src/python/README.md old mode 100755 new mode 100644 diff --git a/src/python/interop/interop/credentials/README b/src/python/interop/interop/credentials/README old mode 100755 new mode 100644 diff --git a/src/ruby/README.md b/src/ruby/README.md old mode 100755 new mode 100644 diff --git a/src/ruby/bin/interop/README.md b/src/ruby/bin/interop/README.md old mode 100755 new mode 100644 diff --git a/src/ruby/spec/testdata/README b/src/ruby/spec/testdata/README old mode 100755 new mode 100644 From f2350183be15f1ba2260e85e7c972cbee016f0d2 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 2 Mar 2015 16:39:39 +0000 Subject: [PATCH 49/71] Make debugging a little easier --- src/core/channel/connected_channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/channel/connected_channel.c b/src/core/channel/connected_channel.c index fa186551648..62611e08f31 100644 --- a/src/core/channel/connected_channel.c +++ b/src/core/channel/connected_channel.c @@ -48,12 +48,12 @@ /* the protobuf library will (by default) start warning at 100megs */ #define DEFAULT_MAX_MESSAGE_LENGTH (100 * 1024 * 1024) -typedef struct { +typedef struct connected_channel_channel_data { grpc_transport *transport; gpr_uint32 max_message_length; } channel_data; -typedef struct { +typedef struct connected_channel_call_data { grpc_call_element *elem; grpc_stream_op_buffer outgoing_sopb; From b9eb180d4d5801c24d8578b8a0c85bfbe667c9bd Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 2 Mar 2015 16:41:32 +0000 Subject: [PATCH 50/71] Fix some shutdown races --- src/core/transport/chttp2_transport.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 4230b523b16..1ad4819fd12 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -519,12 +519,22 @@ static void destroy_transport(grpc_transport *gt) { lock(t); t->destroying = 1; - while (t->calling_back) { + /* Wait for pending stuff to finish. + We need to be not calling back to ensure that closed() gets a chance to + trigger if needed during unlock() before we die. + We need to be not writing as cancellation finalization may produce some + callbacks that NEED to be made to close out some streams when t->writing + becomes 0. */ + while (t->calling_back || t->writing) { gpr_cv_wait(&t->cv, &t->mu, gpr_inf_future); } drop_connection(t); unlock(t); + lock(t); + GPR_ASSERT(!t->cb); + unlock(t); + unref_transport(t); } @@ -681,6 +691,7 @@ static void stream_list_add_tail(transport *t, stream *s, stream_list_id id) { } static void stream_list_join(transport *t, stream *s, stream_list_id id) { + if (id == PENDING_CALLBACKS) GPR_ASSERT(t->cb != NULL || t->error_state == ERROR_STATE_NONE); if (s->included[id]) { return; } @@ -739,7 +750,7 @@ static void unlock(transport *t) { if (perform_callbacks) { t->calling_back = 1; } - if (t->error_state == ERROR_STATE_SEEN) { + if (t->error_state == ERROR_STATE_SEEN && !t->writing) { call_closed = 1; t->calling_back = 1; t->cb = NULL; /* no more callbacks */ @@ -904,13 +915,16 @@ static void finish_write_common(transport *t, int success) { } while ((s = stream_list_remove_head(t, WRITTEN_CLOSED))) { s->sent_write_closed = 1; - stream_list_join(t, s, PENDING_CALLBACKS); + if (!s->cancelled) stream_list_join(t, s, PENDING_CALLBACKS); } t->outbuf.count = 0; t->outbuf.length = 0; /* leave the writing flag up on shutdown to prevent further writes in unlock() from starting */ t->writing = 0; + if (t->destroying) { + gpr_cv_signal(&t->cv); + } if (!t->reading) { grpc_endpoint_destroy(t->ep); t->ep = NULL; From 03dc06cb66afc6bc0c769caa687c47e3721d700b Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 2 Mar 2015 09:00:21 -0800 Subject: [PATCH 51/71] Rename flag --- src/core/surface/init_secure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/surface/init_secure.c b/src/core/surface/init_secure.c index 5d7e5c4ddaf..fa20e91583c 100644 --- a/src/core/surface/init_secure.c +++ b/src/core/surface/init_secure.c @@ -38,5 +38,5 @@ void grpc_security_pre_init(void) { grpc_register_tracer("secure_endpoint", &grpc_trace_secure_endpoint); - grpc_register_tracer("ssl", &tsi_tracing_enabled); + grpc_register_tracer("transport_security", &tsi_tracing_enabled); } From 39b9a029cf6309fffbc2ccf8f4e0f6e2b74cc5e6 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 2 Mar 2015 09:00:57 -0800 Subject: [PATCH 52/71] Capitalization --- src/core/tsi/transport_security_interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h index 4e7ad00421d..0edff542350 100644 --- a/src/core/tsi/transport_security_interface.h +++ b/src/core/tsi/transport_security_interface.h @@ -63,7 +63,7 @@ const char* tsi_result_to_string(tsi_result result); /* --- tsi tracing --- */ -/* set this early to avoid races */ +/* Set this early to avoid races */ extern int tsi_tracing_enabled; /* --- tsi_frame_protector object --- From 479f2b25fb577b84519631ab0b3108859cd78594 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 2 Mar 2015 17:29:33 +0000 Subject: [PATCH 53/71] Speed up test, reduce flakiness --- test/core/end2end/no_server_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/end2end/no_server_test.c b/test/core/end2end/no_server_test.c index d953552c0a2..ffc651ab058 100644 --- a/test/core/end2end/no_server_test.c +++ b/test/core/end2end/no_server_test.c @@ -41,7 +41,7 @@ static void *tag(gpr_intptr i) { return (void *)i; } int main(int argc, char **argv) { grpc_channel *chan; grpc_call *call; - gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5); + gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2); grpc_completion_queue *cq; cq_verifier *cqv; grpc_event *ev; From 5b53e35ba42738a63f41df5df26239716e2d6169 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Mon, 2 Mar 2015 09:11:30 -0800 Subject: [PATCH 54/71] Remove HTTP mappings from status.h The mappings are a combination of useless, inaccurate, and harmful. Leave them out until they are helpful and correct. Fundamental issues: - If in need of mappings, a user would need HTTP -> gRPC code mappings. But the docs don't provide that since the mappings are not 1:1. - There _is no_ gRPC -> HTTP code mapping taking place in gRPC. This may change in the future, but until then the docs are misleading. But even given those were resolved, there are additional issues. Two obvious examples: - 501 Not Implemented is refering to HTTP methods such as GET and POST not being implement. That should not be used for gRPC methods not found (UNIMPLEMENTED). - 404 Not Found is for when the resource is not found. In gRPC, the resource is the gRPC method, not the parameters (NOT_FOUND). If there is a REST conversion layer on top of gRPC, then 404 would be appropriate, but that just shows that the mapping can not be canonical. --- include/grpc++/status_code_enum.h | 73 +++++++----------------------- include/grpc/status.h | 73 +++++++----------------------- src/csharp/Grpc.Core/StatusCode.cs | 73 +++++++----------------------- 3 files changed, 51 insertions(+), 168 deletions(-) diff --git a/include/grpc++/status_code_enum.h b/include/grpc++/status_code_enum.h index 2728fb0ec1f..2211c964cda 100644 --- a/include/grpc++/status_code_enum.h +++ b/include/grpc++/status_code_enum.h @@ -37,51 +37,37 @@ namespace grpc { enum StatusCode { - /* Not an error; returned on success - - HTTP Mapping: 200 OK */ + /* Not an error; returned on success */ OK = 0, - /* The operation was cancelled (typically by the caller). - - HTTP Mapping: 499 Client Closed Request */ + /* The operation was cancelled (typically by the caller). */ CANCELLED = 1, /* Unknown error. An example of where this error may be returned is if a Status value received from another address space belongs to an error-space that is not known in this address space. Also errors raised by APIs that do not return enough error information - may be converted to this error. - - HTTP Mapping: 500 Internal Server Error */ + may be converted to this error. */ UNKNOWN = 2, /* Client specified an invalid argument. Note that this differs from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are problematic regardless of the state of the system - (e.g., a malformed file name). - - HTTP Mapping: 400 Bad Request */ + (e.g., a malformed file name). */ INVALID_ARGUMENT = 3, /* Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long - enough for the deadline to expire. - - HTTP Mapping: 504 Gateway Timeout */ + enough for the deadline to expire. */ DEADLINE_EXCEEDED = 4, - /* Some requested entity (e.g., file or directory) was not found. - - HTTP Mapping: 404 Not Found */ + /* Some requested entity (e.g., file or directory) was not found. */ NOT_FOUND = 5, /* Some entity that we attempted to create (e.g., file or directory) - already exists. - - HTTP Mapping: 409 Conflict */ + already exists. */ ALREADY_EXISTS = 6, /* The caller does not have permission to execute the specified @@ -89,21 +75,15 @@ enum StatusCode { caused by exhausting some resource (use RESOURCE_EXHAUSTED instead for those errors). PERMISSION_DENIED must not be used if the caller can not be identified (use UNAUTHENTICATED - instead for those errors). - - HTTP Mapping: 403 Forbidden */ + instead for those errors). */ PERMISSION_DENIED = 7, /* The request does not have valid authentication credentials for the - operation. - - HTTP Mapping: 401 Unauthorized */ + operation. */ UNAUTHENTICATED = 16, /* Some resource has been exhausted, perhaps a per-user quota, or - perhaps the entire file system is out of space. - - HTTP Mapping: 429 Too Many Requests */ + perhaps the entire file system is out of space. */ RESOURCE_EXHAUSTED = 8, /* Operation was rejected because the system is not in a state @@ -124,23 +104,14 @@ enum StatusCode { (d) Use FAILED_PRECONDITION if the client performs conditional REST Get/Update/Delete on a resource and the resource on the server does not match the condition. E.g., conflicting - read-modify-write on the same resource. - - HTTP Mapping: 400 Bad Request - - NOTE: HTTP spec says 412 Precondition Failed should only be used if - the request contains Etag related headers. So if the server does see - Etag related headers in the request, it may choose to return 412 - instead of 400 for this error code. */ + read-modify-write on the same resource. */ FAILED_PRECONDITION = 9, /* The operation was aborted, typically due to a concurrency issue like sequencer check failures, transaction aborts, etc. See litmus test above for deciding between FAILED_PRECONDITION, - ABORTED, and UNAVAILABLE. - - HTTP Mapping: 409 Conflict */ + ABORTED, and UNAVAILABLE. */ ABORTED = 10, /* Operation was attempted past the valid range. E.g., seeking or @@ -157,21 +128,15 @@ enum StatusCode { OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error) when it applies so that callers who are iterating through a space can easily look for an OUT_OF_RANGE error to detect when - they are done. - - HTTP Mapping: 400 Bad Request */ + they are done. */ OUT_OF_RANGE = 11, - /* Operation is not implemented or not supported/enabled in this service. - - HTTP Mapping: 501 Not Implemented */ + /* Operation is not implemented or not supported/enabled in this service. */ UNIMPLEMENTED = 12, /* Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, - something is very broken. - - HTTP Mapping: 500 Internal Server Error */ + something is very broken. */ INTERNAL = 13, /* The service is currently unavailable. This is a most likely a @@ -179,14 +144,10 @@ enum StatusCode { a backoff. See litmus test above for deciding between FAILED_PRECONDITION, - ABORTED, and UNAVAILABLE. - - HTTP Mapping: 503 Service Unavailable */ + ABORTED, and UNAVAILABLE. */ UNAVAILABLE = 14, - /* Unrecoverable data loss or corruption. - - HTTP Mapping: 500 Internal Server Error */ + /* Unrecoverable data loss or corruption. */ DATA_LOSS = 15, /* Force users to include a default branch: */ diff --git a/include/grpc/status.h b/include/grpc/status.h index a1a4d2ff0e2..456b9006e7b 100644 --- a/include/grpc/status.h +++ b/include/grpc/status.h @@ -39,51 +39,37 @@ extern "C" { #endif typedef enum { - /* Not an error; returned on success - - HTTP Mapping: 200 OK */ + /* Not an error; returned on success */ GRPC_STATUS_OK = 0, - /* The operation was cancelled (typically by the caller). - - HTTP Mapping: 499 Client Closed Request */ + /* The operation was cancelled (typically by the caller). */ GRPC_STATUS_CANCELLED = 1, /* Unknown error. An example of where this error may be returned is if a Status value received from another address space belongs to an error-space that is not known in this address space. Also errors raised by APIs that do not return enough error information - may be converted to this error. - - HTTP Mapping: 500 Internal Server Error */ + may be converted to this error. */ GRPC_STATUS_UNKNOWN = 2, /* Client specified an invalid argument. Note that this differs from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are problematic regardless of the state of the system - (e.g., a malformed file name). - - HTTP Mapping: 400 Bad Request */ + (e.g., a malformed file name). */ GRPC_STATUS_INVALID_ARGUMENT = 3, /* Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long - enough for the deadline to expire. - - HTTP Mapping: 504 Gateway Timeout */ + enough for the deadline to expire. */ GRPC_STATUS_DEADLINE_EXCEEDED = 4, - /* Some requested entity (e.g., file or directory) was not found. - - HTTP Mapping: 404 Not Found */ + /* Some requested entity (e.g., file or directory) was not found. */ GRPC_STATUS_NOT_FOUND = 5, /* Some entity that we attempted to create (e.g., file or directory) - already exists. - - HTTP Mapping: 409 Conflict */ + already exists. */ GRPC_STATUS_ALREADY_EXISTS = 6, /* The caller does not have permission to execute the specified @@ -91,21 +77,15 @@ typedef enum { caused by exhausting some resource (use RESOURCE_EXHAUSTED instead for those errors). PERMISSION_DENIED must not be used if the caller can not be identified (use UNAUTHENTICATED - instead for those errors). - - HTTP Mapping: 403 Forbidden */ + instead for those errors). */ GRPC_STATUS_PERMISSION_DENIED = 7, /* The request does not have valid authentication credentials for the - operation. - - HTTP Mapping: 401 Unauthorized */ + operation. */ GRPC_STATUS_UNAUTHENTICATED = 16, /* Some resource has been exhausted, perhaps a per-user quota, or - perhaps the entire file system is out of space. - - HTTP Mapping: 429 Too Many Requests */ + perhaps the entire file system is out of space. */ GRPC_STATUS_RESOURCE_EXHAUSTED = 8, /* Operation was rejected because the system is not in a state @@ -126,23 +106,14 @@ typedef enum { (d) Use FAILED_PRECONDITION if the client performs conditional REST Get/Update/Delete on a resource and the resource on the server does not match the condition. E.g., conflicting - read-modify-write on the same resource. - - HTTP Mapping: 400 Bad Request - - NOTE: HTTP spec says 412 Precondition Failed should only be used if - the request contains Etag related headers. So if the server does see - Etag related headers in the request, it may choose to return 412 - instead of 400 for this error code. */ + read-modify-write on the same resource. */ GRPC_STATUS_FAILED_PRECONDITION = 9, /* The operation was aborted, typically due to a concurrency issue like sequencer check failures, transaction aborts, etc. See litmus test above for deciding between FAILED_PRECONDITION, - ABORTED, and UNAVAILABLE. - - HTTP Mapping: 409 Conflict */ + ABORTED, and UNAVAILABLE. */ GRPC_STATUS_ABORTED = 10, /* Operation was attempted past the valid range. E.g., seeking or @@ -159,21 +130,15 @@ typedef enum { OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error) when it applies so that callers who are iterating through a space can easily look for an OUT_OF_RANGE error to detect when - they are done. - - HTTP Mapping: 400 Bad Request */ + they are done. */ GRPC_STATUS_OUT_OF_RANGE = 11, - /* Operation is not implemented or not supported/enabled in this service. - - HTTP Mapping: 501 Not Implemented */ + /* Operation is not implemented or not supported/enabled in this service. */ GRPC_STATUS_UNIMPLEMENTED = 12, /* Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, - something is very broken. - - HTTP Mapping: 500 Internal Server Error */ + something is very broken. */ GRPC_STATUS_INTERNAL = 13, /* The service is currently unavailable. This is a most likely a @@ -181,14 +146,10 @@ typedef enum { a backoff. See litmus test above for deciding between FAILED_PRECONDITION, - ABORTED, and UNAVAILABLE. - - HTTP Mapping: 503 Service Unavailable */ + ABORTED, and UNAVAILABLE. */ GRPC_STATUS_UNAVAILABLE = 14, - /* Unrecoverable data loss or corruption. - - HTTP Mapping: 500 Internal Server Error */ + /* Unrecoverable data loss or corruption. */ GRPC_STATUS_DATA_LOSS = 15, /* Force users to include a default branch: */ diff --git a/src/csharp/Grpc.Core/StatusCode.cs b/src/csharp/Grpc.Core/StatusCode.cs index 1fbf9c1b687..1987e52789a 100644 --- a/src/csharp/Grpc.Core/StatusCode.cs +++ b/src/csharp/Grpc.Core/StatusCode.cs @@ -41,64 +41,44 @@ namespace Grpc.Core /// public enum StatusCode { - /* Not an error; returned on success - - HTTP Mapping: 200 OK */ + /* Not an error; returned on success */ OK = 0, - /* The operation was cancelled (typically by the caller). - - HTTP Mapping: 499 Client Closed Request */ + /* The operation was cancelled (typically by the caller). */ Cancelled = 1, /* Unknown error. An example of where this error may be returned is if a Status value received from another address space belongs to an error-space that is not known in this address space. Also errors raised by APIs that do not return enough error information - may be converted to this error. - - HTTP Mapping: 500 Internal Server Error */ + may be converted to this error. */ Unknown = 2, /* Client specified an invalid argument. Note that this differs from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are problematic regardless of the state of the system - (e.g., a malformed file name). - - HTTP Mapping: 400 Bad Request */ + (e.g., a malformed file name). */ InvalidArgument = 3, /* Deadline expired before operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long - enough for the deadline to expire. - - HTTP Mapping: 504 Gateway Timeout */ + enough for the deadline to expire. */ DeadlineExceeded = 4, - /* Some requested entity (e.g., file or directory) was not found. - - HTTP Mapping: 404 Not Found */ + /* Some requested entity (e.g., file or directory) was not found. */ NotFound = 5, /* Some entity that we attempted to create (e.g., file or directory) - already exists. - - HTTP Mapping: 409 Conflict */ + already exists. */ AlreadyExists = 6, /* The caller does not have permission to execute the specified operation. PERMISSION_DENIED must not be used for rejections caused by exhausting some resource (use RESOURCE_EXHAUSTED instead for those errors). PERMISSION_DENIED must not be used if the caller can not be identified (use UNAUTHENTICATED - instead for those errors). - - HTTP Mapping: 403 Forbidden */ + instead for those errors). */ PermissionDenied = 7, /* The request does not have valid authentication credentials for the - operation. - - HTTP Mapping: 401 Unauthorized */ + operation. */ Unauthenticated = 16, /* Some resource has been exhausted, perhaps a per-user quota, or - perhaps the entire file system is out of space. - - HTTP Mapping: 429 Too Many Requests */ + perhaps the entire file system is out of space. */ ResourceExhausted = 8, /* Operation was rejected because the system is not in a state required for the operation's execution. For example, directory @@ -118,22 +98,13 @@ namespace Grpc.Core (d) Use FAILED_PRECONDITION if the client performs conditional REST Get/Update/Delete on a resource and the resource on the server does not match the condition. E.g., conflicting - read-modify-write on the same resource. - - HTTP Mapping: 400 Bad Request - - NOTE: HTTP spec says 412 Precondition Failed should only be used if - the request contains Etag related headers. So if the server does see - Etag related headers in the request, it may choose to return 412 - instead of 400 for this error code. */ + read-modify-write on the same resource. */ FailedPrecondition = 9, /* The operation was aborted, typically due to a concurrency issue like sequencer check failures, transaction aborts, etc. See litmus test above for deciding between FAILED_PRECONDITION, - ABORTED, and UNAVAILABLE. - - HTTP Mapping: 409 Conflict */ + ABORTED, and UNAVAILABLE. */ Aborted = 10, /* Operation was attempted past the valid range. E.g., seeking or reading past end of file. @@ -149,32 +120,22 @@ namespace Grpc.Core OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error) when it applies so that callers who are iterating through a space can easily look for an OUT_OF_RANGE error to detect when - they are done. - - HTTP Mapping: 400 Bad Request */ + they are done. */ OutOfRange = 11, - /* Operation is not implemented or not supported/enabled in this service. - - HTTP Mapping: 501 Not Implemented */ + /* Operation is not implemented or not supported/enabled in this service. */ Unimplemented = 12, /* Internal errors. Means some invariants expected by underlying system has been broken. If you see one of these errors, - something is very broken. - - HTTP Mapping: 500 Internal Server Error */ + something is very broken. */ Internal = 13, /* The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff. See litmus test above for deciding between FAILED_PRECONDITION, - ABORTED, and UNAVAILABLE. - - HTTP Mapping: 503 Service Unavailable */ + ABORTED, and UNAVAILABLE. */ Unavailable = 14, - /* Unrecoverable data loss or corruption. - - HTTP Mapping: 500 Internal Server Error */ + /* Unrecoverable data loss or corruption. */ DataLoss = 15 } } From f5fd4ba0a910c7349c089f3d7c73f3333b015153 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 2 Mar 2015 18:01:21 +0000 Subject: [PATCH 55/71] Completion queue cleanup Make debugging a little easier, and remove an unnecessary assert --- src/core/surface/completion_queue.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c index c4b8d60782f..6a1d83ce5d4 100644 --- a/src/core/surface/completion_queue.c +++ b/src/core/surface/completion_queue.c @@ -71,6 +71,7 @@ struct grpc_completion_queue { grpc_pollset pollset; /* 0 initially, 1 once we've begun shutting down */ int shutdown; + int shutdown_called; /* Head of a linked list of queued events (prev points to the last element) */ event *queue; /* Fixed size chained hash table of events for pluck() */ @@ -107,7 +108,6 @@ static event *add_locked(grpc_completion_queue *cc, grpc_completion_type type, grpc_event_finish_func on_finish, void *user_data) { event *ev = gpr_malloc(sizeof(event)); gpr_uintptr bucket = ((gpr_uintptr)tag) % NUM_TAG_BUCKETS; - GPR_ASSERT(!cc->shutdown); ev->base.type = type; ev->base.tag = tag; ev->base.call = call; @@ -150,6 +150,7 @@ static void end_op_locked(grpc_completion_queue *cc, #endif if (gpr_unref(&cc->refs)) { GPR_ASSERT(!cc->shutdown); + GPR_ASSERT(cc->shutdown_called); cc->shutdown = 1; gpr_cv_broadcast(GRPC_POLLSET_CV(&cc->pollset)); } @@ -380,6 +381,10 @@ grpc_event *grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag, /* Shutdown simply drops a ref that we reserved at creation time; if we drop to zero here, then enter shutdown mode and wake up any waiters */ void grpc_completion_queue_shutdown(grpc_completion_queue *cc) { + gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset)); + cc->shutdown_called = 1; + gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset)); + if (gpr_unref(&cc->refs)) { gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset)); GPR_ASSERT(!cc->shutdown); From 1a138c34ed6da4203317b430a126e7231abca820 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 2 Mar 2015 18:01:58 +0000 Subject: [PATCH 56/71] Dont add new requests when shutting down --- test/core/fling/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/core/fling/server.c b/test/core/fling/server.c index 59c303015a3..5c1ab14d034 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.c @@ -275,7 +275,7 @@ int main(int argc, char **argv) { case FLING_SERVER_SEND_STATUS_FOR_STREAMING: /* Send status and close completed at server */ grpc_call_destroy(call); - request_call(); + if (!shutdown_started) request_call(); break; case FLING_SERVER_READ_FOR_UNARY: /* Finished payload read for unary. Start all reamaining @@ -288,7 +288,7 @@ int main(int argc, char **argv) { grpc_byte_buffer_destroy(payload_buffer); payload_buffer = NULL; grpc_call_destroy(call); - request_call(); + if (!shutdown_started) request_call(); break; } break; From 45115845cc116022647e62b2e7627b261a6c4f4b Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 2 Mar 2015 10:05:10 -0800 Subject: [PATCH 57/71] Mark fling_*test non-flaky Also, make the flaky: tag a little more visible in build.json --- Makefile | 26 ++++++++++++++++++++++++-- build.json | 14 ++++++-------- tools/buildgen/build-cleaner.py | 1 + tools/run_tests/tests.json | 4 ++-- 4 files changed, 33 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index e390a3efe63..3601a4dd1c9 100644 --- a/Makefile +++ b/Makefile @@ -8076,13 +8076,24 @@ $(BINDIR)/$(CONFIG)/qps_client_async: openssl_dep_error else -$(BINDIR)/$(CONFIG)/qps_client_async: $(QPS_CLIENT_ASYNC_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+. + +$(BINDIR)/$(CONFIG)/qps_client_async: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/qps_client_async: $(PROTOBUF_DEP) $(QPS_CLIENT_ASYNC_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` $(Q) $(LDXX) $(LDFLAGS) $(QPS_CLIENT_ASYNC_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/qps_client_async endif +endif + $(OBJDIR)/$(CONFIG)/test/cpp/qps/qpstest.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a @@ -8153,13 +8164,24 @@ $(BINDIR)/$(CONFIG)/qps_server_async: openssl_dep_error else -$(BINDIR)/$(CONFIG)/qps_server_async: $(QPS_SERVER_ASYNC_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+. + +$(BINDIR)/$(CONFIG)/qps_server_async: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/qps_server_async: $(PROTOBUF_DEP) $(QPS_SERVER_ASYNC_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` $(Q) $(LDXX) $(LDFLAGS) $(QPS_SERVER_ASYNC_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/qps_server_async endif +endif + $(OBJDIR)/$(CONFIG)/test/cpp/qps/qpstest.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/qps/server_async.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a diff --git a/build.json b/build.json index 6be1d537ffa..2bbb012fbdb 100644 --- a/build.json +++ b/build.json @@ -572,6 +572,7 @@ }, { "name": "census_statistics_multiple_writers_circular_buffer_test", + "flaky": true, "build": "test", "language": "c", "src": [ @@ -582,8 +583,7 @@ "grpc", "gpr_test_util", "gpr" - ], - "flaky": true + ] }, { "name": "census_statistics_multiple_writers_test", @@ -629,6 +629,7 @@ }, { "name": "census_statistics_small_log_test", + "flaky": true, "build": "test", "language": "c", "src": [ @@ -639,8 +640,7 @@ "grpc", "gpr_test_util", "gpr" - ], - "flaky": true + ] }, { "name": "census_stats_store_test", @@ -868,8 +868,7 @@ "grpc", "gpr_test_util", "gpr" - ], - "flaky": true + ] }, { "name": "fling_test", @@ -883,8 +882,7 @@ "grpc", "gpr_test_util", "gpr" - ], - "flaky": true + ] }, { "name": "gen_hpack_tables", diff --git a/tools/buildgen/build-cleaner.py b/tools/buildgen/build-cleaner.py index 880f3e26a48..1d9157aad7d 100755 --- a/tools/buildgen/build-cleaner.py +++ b/tools/buildgen/build-cleaner.py @@ -41,6 +41,7 @@ _TOP_LEVEL_KEYS = ['settings', 'filegroups', 'libs', 'targets'] _VERSION_KEYS = ['major', 'minor', 'micro', 'build'] _ELEM_KEYS = [ 'name', + 'flaky', 'build', 'run', 'language', diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 772856b9c7f..06bf58f93e8 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -102,12 +102,12 @@ "name": "fd_posix_test" }, { - "flaky": true, + "flaky": false, "language": "c", "name": "fling_stream_test" }, { - "flaky": true, + "flaky": false, "language": "c", "name": "fling_test" }, From 0af2a46d7c1e49c11d9f57c5d4655cdcc1b2d058 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 2 Mar 2015 10:10:40 -0800 Subject: [PATCH 58/71] Add more logging --- .travis.yml | 1 - tools/run_tests/run_python.sh | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 47ab5e888dc..dd5fc84fb5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,6 @@ env: matrix: - CONFIG=opt TEST=python script: - - which python - rvm use $RUBY_VERSION - gem install bundler - ./tools/run_tests/run_tests.py -l $TEST -t -j 16 -c $CONFIG -s 2.0 diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index f7438f6207f..94e61f36928 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -37,6 +37,8 @@ root=`pwd` export LD_LIBRARY_PATH=$root/libs/opt source python2.7_virtual_environment/bin/activate echo $PATH +ls -l python2.7_virtual_environment +ls -l python2.7_virtual_environment/bin which python2.7 # TODO(issue 215): Properly itemize these in run_tests.py so that they can be parallelized. # TODO(atash): Enable dynamic unused port discovery for this test. From fa4efbd157df67447e8c33ae86e65a02a6dabc27 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 27 Feb 2015 16:54:09 -0800 Subject: [PATCH 59/71] added docker files for c# --- tools/dockerfile/grpc_csharp_mono/Dockerfile | 59 +++++++++++++++++++ .../grpc_csharp_mono_base/Dockerfile | 53 +++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 tools/dockerfile/grpc_csharp_mono/Dockerfile create mode 100644 tools/dockerfile/grpc_csharp_mono_base/Dockerfile diff --git a/tools/dockerfile/grpc_csharp_mono/Dockerfile b/tools/dockerfile/grpc_csharp_mono/Dockerfile new file mode 100644 index 00000000000..d0e2d2be7e4 --- /dev/null +++ b/tools/dockerfile/grpc_csharp_mono/Dockerfile @@ -0,0 +1,59 @@ +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Dockerfile for gRPC C# (on Mono). +FROM grpc/csharp_mono_base + +# Pull the latest sources +RUN cd /var/local/git/grpc \ + && git pull --recurse-submodules \ + && git submodule update --init --recursive + +# Install the gRPC C# extension library +RUN make install_grpc_csharp_ext -j12 -C /var/local/git/grpc + +# TODO: download NuGet from web. The problem is there seems to be no direct link +# we could use :-) +ADD NuGet.exe NuGet.exe + +# Restore the NuGet dependencies +RUN cd /var/local/git/grpc/src/csharp && mono /NuGet.exe restore Grpc.sln + +# Build gRPC solution +RUN cd /var/local/git/grpc/src/csharp && xbuild Grpc.sln + +# Add a cacerts directory containing the Google root pem file, allowing the +# ruby client to access the production test instance +ADD cacerts cacerts + +# Add a service_account directory containing the auth creds file +ADD service_account service_account + +# TODO: add command to run the interop server +CMD ["/bin/bash", "-l"] diff --git a/tools/dockerfile/grpc_csharp_mono_base/Dockerfile b/tools/dockerfile/grpc_csharp_mono_base/Dockerfile new file mode 100644 index 00000000000..74919a7fdb5 --- /dev/null +++ b/tools/dockerfile/grpc_csharp_mono_base/Dockerfile @@ -0,0 +1,53 @@ +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Base Dockerfile for gRPC C# (on Mono). +# +# Includes gRPC C# installation dependencies, things that are unlikely to vary. +FROM grpc/base + +# Update to a newer version of mono +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list + +# Install dependencies +RUN apt-get update && apt-get install -y \ + mono-devel \ + nunit \ + nunit-console \ + monodevelop + +# Get the source from GitHub +RUN git clone git@github.com:grpc/grpc.git /var/local/git/grpc +RUN cd /var/local/git/grpc && \ + git pull --recurse-submodules && \ + git submodule update --init --recursive + +# Define the default command. +CMD ["bash","-l"] From a2af8a1a981aaa052e45f53ffa364d3dc5782b50 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 2 Mar 2015 10:31:40 -0800 Subject: [PATCH 60/71] Changed how python versions are specified --- tools/run_tests/build_python.sh | 2 +- tools/run_tests/run_python.sh | 34 ++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh index 56761b802e0..6ce2d354bfc 100755 --- a/tools/run_tests/build_python.sh +++ b/tools/run_tests/build_python.sh @@ -34,7 +34,7 @@ set -ex cd $(dirname $0)/../.. root=`pwd` -virtualenv python2.7_virtual_environment +virtualenv -p /usr/bin/python2.7 python2.7_virtual_environment source python2.7_virtual_environment/bin/activate echo $PATH which pip diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index 94e61f36928..16fee1a7619 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -39,24 +39,24 @@ source python2.7_virtual_environment/bin/activate echo $PATH ls -l python2.7_virtual_environment ls -l python2.7_virtual_environment/bin -which python2.7 +which python # TODO(issue 215): Properly itemize these in run_tests.py so that they can be parallelized. # TODO(atash): Enable dynamic unused port discovery for this test. -python2.7 -B test/compiler/python_plugin_test.py --build_mode=opt -python2.7 -B -m grpc._adapter._blocking_invocation_inline_service_test -python2.7 -B -m grpc._adapter._c_test -python2.7 -B -m grpc._adapter._event_invocation_synchronous_event_service_test -python2.7 -B -m grpc._adapter._future_invocation_asynchronous_event_service_test -python2.7 -B -m grpc._adapter._links_test -python2.7 -B -m grpc._adapter._lonely_rear_link_test -python2.7 -B -m grpc._adapter._low_test -python2.7 -B -m grpc.early_adopter.implementations_test -python2.7 -B -m grpc.framework.assembly.implementations_test -python2.7 -B -m grpc.framework.base.packets.implementations_test -python2.7 -B -m grpc.framework.face.blocking_invocation_inline_service_test -python2.7 -B -m grpc.framework.face.event_invocation_synchronous_event_service_test -python2.7 -B -m grpc.framework.face.future_invocation_asynchronous_event_service_test -python2.7 -B -m grpc.framework.foundation._later_test -python2.7 -B -m grpc.framework.foundation._logging_pool_test +python -B test/compiler/python_plugin_test.py --build_mode=opt +python -B -m grpc._adapter._blocking_invocation_inline_service_test +python -B -m grpc._adapter._c_test +python -B -m grpc._adapter._event_invocation_synchronous_event_service_test +python -B -m grpc._adapter._future_invocation_asynchronous_event_service_test +python -B -m grpc._adapter._links_test +python -B -m grpc._adapter._lonely_rear_link_test +python -B -m grpc._adapter._low_test +python -B -m grpc.early_adopter.implementations_test +python -B -m grpc.framework.assembly.implementations_test +python -B -m grpc.framework.base.packets.implementations_test +python -B -m grpc.framework.face.blocking_invocation_inline_service_test +python -B -m grpc.framework.face.event_invocation_synchronous_event_service_test +python -B -m grpc.framework.face.future_invocation_asynchronous_event_service_test +python -B -m grpc.framework.foundation._later_test +python -B -m grpc.framework.foundation._logging_pool_test # TODO(nathaniel): Get tests working under 3.4 (requires 3.X-friendly protobuf) # python3.4 -B -m unittest discover -s src/python -p '*.py' From cedab130c2de43a5bde281f03ee25012c47c2034 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 2 Mar 2015 10:42:24 -0800 Subject: [PATCH 61/71] Put tests back in a useful state --- .travis.yml | 6 ++++++ tools/run_tests/build_python.sh | 2 -- tools/run_tests/run_python.sh | 36 +++++++++++++++------------------ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index dd5fc84fb5f..1099aa5dfc4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,12 @@ env: global: - RUBY_VERSION=2.1 matrix: + - CONFIG=dbg TEST=c + - CONFIG=dbg TEST=c++ + - CONFIG=opt TEST=c + - CONFIG=opt TEST=c++ + - CONFIG=opt TEST=node + - CONFIG=opt TEST=ruby - CONFIG=opt TEST=python script: - rvm use $RUBY_VERSION diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh index 6ce2d354bfc..770dc9dc721 100755 --- a/tools/run_tests/build_python.sh +++ b/tools/run_tests/build_python.sh @@ -36,7 +36,5 @@ cd $(dirname $0)/../.. root=`pwd` virtualenv -p /usr/bin/python2.7 python2.7_virtual_environment source python2.7_virtual_environment/bin/activate -echo $PATH -which pip pip install enum34==1.0.4 futures==2.2.0 protobuf==3.0.0-alpha-1 CFLAGS=-I$root/include LDFLAGS=-L$root/libs/opt pip install src/python/src diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index 16fee1a7619..58e55b0a41b 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -36,27 +36,23 @@ cd $(dirname $0)/../.. root=`pwd` export LD_LIBRARY_PATH=$root/libs/opt source python2.7_virtual_environment/bin/activate -echo $PATH -ls -l python2.7_virtual_environment -ls -l python2.7_virtual_environment/bin -which python # TODO(issue 215): Properly itemize these in run_tests.py so that they can be parallelized. # TODO(atash): Enable dynamic unused port discovery for this test. -python -B test/compiler/python_plugin_test.py --build_mode=opt -python -B -m grpc._adapter._blocking_invocation_inline_service_test -python -B -m grpc._adapter._c_test -python -B -m grpc._adapter._event_invocation_synchronous_event_service_test -python -B -m grpc._adapter._future_invocation_asynchronous_event_service_test -python -B -m grpc._adapter._links_test -python -B -m grpc._adapter._lonely_rear_link_test -python -B -m grpc._adapter._low_test -python -B -m grpc.early_adopter.implementations_test -python -B -m grpc.framework.assembly.implementations_test -python -B -m grpc.framework.base.packets.implementations_test -python -B -m grpc.framework.face.blocking_invocation_inline_service_test -python -B -m grpc.framework.face.event_invocation_synchronous_event_service_test -python -B -m grpc.framework.face.future_invocation_asynchronous_event_service_test -python -B -m grpc.framework.foundation._later_test -python -B -m grpc.framework.foundation._logging_pool_test +# python2.7 -B test/compiler/python_plugin_test.py --build_mode=opt +python2.7 -B -m grpc._adapter._blocking_invocation_inline_service_test +python2.7 -B -m grpc._adapter._c_test +python2.7 -B -m grpc._adapter._event_invocation_synchronous_event_service_test +python2.7 -B -m grpc._adapter._future_invocation_asynchronous_event_service_test +python2.7 -B -m grpc._adapter._links_test +python2.7 -B -m grpc._adapter._lonely_rear_link_test +python2.7 -B -m grpc._adapter._low_test +python2.7 -B -m grpc.early_adopter.implementations_test +python2.7 -B -m grpc.framework.assembly.implementations_test +python2.7 -B -m grpc.framework.base.packets.implementations_test +python2.7 -B -m grpc.framework.face.blocking_invocation_inline_service_test +python2.7 -B -m grpc.framework.face.event_invocation_synchronous_event_service_test +python2.7 -B -m grpc.framework.face.future_invocation_asynchronous_event_service_test +python2.7 -B -m grpc.framework.foundation._later_test +python2.7 -B -m grpc.framework.foundation._logging_pool_test # TODO(nathaniel): Get tests working under 3.4 (requires 3.X-friendly protobuf) # python3.4 -B -m unittest discover -s src/python -p '*.py' From bb88a048cdc5f0f7157eab9fef5168f27ade624b Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 2 Mar 2015 10:56:33 -0800 Subject: [PATCH 62/71] Add clarifying comment --- src/core/transport/chttp2_transport.c | 6 ++++++ tools/run_tests/run_lcov.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 1ad4819fd12..8d4a9789633 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -531,6 +531,12 @@ static void destroy_transport(grpc_transport *gt) { drop_connection(t); unlock(t); + /* The drop_connection() above puts the transport into an error state, and + the follow-up unlock should then (as part of the cleanup work it does) + ensure that cb is NULL, and therefore not call back anything further. + This check validates this very subtle behavior. + It's shutdown path, so I don't believe an extra lock pair is going to be + problematic for performance. */ lock(t); GPR_ASSERT(!t->cb); unlock(t); diff --git a/tools/run_tests/run_lcov.sh b/tools/run_tests/run_lcov.sh index 292aec45482..69b1de6b897 100755 --- a/tools/run_tests/run_lcov.sh +++ b/tools/run_tests/run_lcov.sh @@ -35,7 +35,7 @@ out=`realpath ${1:-coverage}` root=`realpath $(dirname $0)/../..` tmp=`mktemp` cd $root -tools/run_tests/run_tests.py -c gcov -l c c++ +tools/run_tests/run_tests.py -c gcov -l c c++ || true lcov --capture --directory . --output-file $tmp genhtml $tmp --output-directory $out rm $tmp From d6fea899b8115cdbd707f88b690a35ab39b9d518 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 2 Mar 2015 11:09:46 -0800 Subject: [PATCH 63/71] Added TODO to re-enable commented test --- tools/run_tests/run_python.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index 58e55b0a41b..9c7dea008db 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -38,6 +38,7 @@ export LD_LIBRARY_PATH=$root/libs/opt source python2.7_virtual_environment/bin/activate # TODO(issue 215): Properly itemize these in run_tests.py so that they can be parallelized. # TODO(atash): Enable dynamic unused port discovery for this test. +# TODO(mlumish): Re-enable this test when we can install protoc # python2.7 -B test/compiler/python_plugin_test.py --build_mode=opt python2.7 -B -m grpc._adapter._blocking_invocation_inline_service_test python2.7 -B -m grpc._adapter._c_test From fa9b1a415e2daa79e5cf5050432521a4515a0938 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 2 Mar 2015 11:37:40 -0800 Subject: [PATCH 64/71] Fix flake --- src/core/transport/chttp2_transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 8d4a9789633..6b7273e3e48 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -1000,7 +1000,8 @@ static void send_batch(grpc_transport *gt, grpc_stream *gs, grpc_stream_op *ops, } else { grpc_sopb_append(&t->nuke_later_sopb, ops, ops_count); } - if (is_last && s->outgoing_sopb.nops == 0 && s->read_closed) { + if (is_last && s->outgoing_sopb.nops == 0 && s->read_closed && + !s->published_close) { stream_list_join(t, s, PENDING_CALLBACKS); } From 985c5bf2e075697fc89e8cb13f10a9324ee148a9 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 2 Mar 2015 11:50:23 -0800 Subject: [PATCH 65/71] Added logging for python tests --- .travis.yml | 6 ------ tools/run_tests/run_python.sh | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index de320b59a3a..eeb3dc2c859 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,12 +8,6 @@ env: global: - RUBY_VERSION=2.1 matrix: - - CONFIG=dbg TEST=c - - CONFIG=dbg TEST=c++ - - CONFIG=opt TEST=c - - CONFIG=opt TEST=c++ - - CONFIG=opt TEST=node - - CONFIG=opt TEST=ruby - CONFIG=opt TEST=python script: - rvm use $RUBY_VERSION diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index 9c7dea008db..d534eab7cab 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -36,6 +36,8 @@ cd $(dirname $0)/../.. root=`pwd` export LD_LIBRARY_PATH=$root/libs/opt source python2.7_virtual_environment/bin/activate +ldd python2.7 +ldd python2.7_virtual_environment/local/lib/python2.7/site-packages/grpc/_adapter/_c.so # TODO(issue 215): Properly itemize these in run_tests.py so that they can be parallelized. # TODO(atash): Enable dynamic unused port discovery for this test. # TODO(mlumish): Re-enable this test when we can install protoc From fb0b99ea8fb9e41afc1a645069a43f0e51b8d563 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 2 Mar 2015 11:56:00 -0800 Subject: [PATCH 66/71] Fixed ldd logging --- tools/run_tests/run_python.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index d534eab7cab..37ac340650b 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -36,8 +36,8 @@ cd $(dirname $0)/../.. root=`pwd` export LD_LIBRARY_PATH=$root/libs/opt source python2.7_virtual_environment/bin/activate -ldd python2.7 -ldd python2.7_virtual_environment/local/lib/python2.7/site-packages/grpc/_adapter/_c.so +ldd $PWD/python2.7_virtual_environment/bin/python +ldd $PWD/python2.7_virtual_environment/local/lib/python2.7/site-packages/grpc/_adapter/_c.so # TODO(issue 215): Properly itemize these in run_tests.py so that they can be parallelized. # TODO(atash): Enable dynamic unused port discovery for this test. # TODO(mlumish): Re-enable this test when we can install protoc From 238c23b453fc3abe4777d560d86d44e40bbe5e1e Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 2 Mar 2015 12:13:20 -0800 Subject: [PATCH 67/71] Added more logging --- tools/run_tests/run_python.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index 37ac340650b..2df4e257bfe 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -38,6 +38,8 @@ export LD_LIBRARY_PATH=$root/libs/opt source python2.7_virtual_environment/bin/activate ldd $PWD/python2.7_virtual_environment/bin/python ldd $PWD/python2.7_virtual_environment/local/lib/python2.7/site-packages/grpc/_adapter/_c.so +objdump -T /lib/x86_64-linux-gnu/libc.so.6 +objdump -T /lib/x86_64-linux-gnu/libc.so.6 | grep clock_gettime # TODO(issue 215): Properly itemize these in run_tests.py so that they can be parallelized. # TODO(atash): Enable dynamic unused port discovery for this test. # TODO(mlumish): Re-enable this test when we can install protoc From 4eb6e31566fa79b32e5e569fbf25a60021c5f362 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 2 Mar 2015 13:07:38 -0800 Subject: [PATCH 68/71] Added rt link to python's setup.py --- src/python/src/setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/python/src/setup.py b/src/python/src/setup.py index 26121dcfab6..dbfffa2065b 100644 --- a/src/python/src/setup.py +++ b/src/python/src/setup.py @@ -49,6 +49,7 @@ _EXTENSION_INCLUDE_DIRECTORIES = ( _EXTENSION_LIBRARIES = ( 'gpr', 'grpc', + 'rt', ) _EXTENSION_MODULE = _core.Extension( From 4a171f8e2d2d108a385ec6fb9304354c7f11b743 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 2 Mar 2015 13:17:53 -0800 Subject: [PATCH 69/71] Fixed python link order --- src/python/src/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/src/setup.py b/src/python/src/setup.py index dbfffa2065b..cdb82a9dc35 100644 --- a/src/python/src/setup.py +++ b/src/python/src/setup.py @@ -47,8 +47,8 @@ _EXTENSION_INCLUDE_DIRECTORIES = ( ) _EXTENSION_LIBRARIES = ( - 'gpr', 'grpc', + 'gpr', 'rt', ) From 5c4052d771e4fe91eb2947a857d2a10eeae192fd Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 2 Mar 2015 13:28:12 -0800 Subject: [PATCH 70/71] Removed logging, returned other tests to .travis.yml --- .travis.yml | 6 ++++++ tools/run_tests/build_python.sh | 1 + tools/run_tests/run_python.sh | 4 ---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index eeb3dc2c859..de320b59a3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,12 @@ env: global: - RUBY_VERSION=2.1 matrix: + - CONFIG=dbg TEST=c + - CONFIG=dbg TEST=c++ + - CONFIG=opt TEST=c + - CONFIG=opt TEST=c++ + - CONFIG=opt TEST=node + - CONFIG=opt TEST=ruby - CONFIG=opt TEST=python script: - rvm use $RUBY_VERSION diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh index 770dc9dc721..de633083c35 100755 --- a/tools/run_tests/build_python.sh +++ b/tools/run_tests/build_python.sh @@ -34,6 +34,7 @@ set -ex cd $(dirname $0)/../.. root=`pwd` +rm -rf python2.7_virtual_environment virtualenv -p /usr/bin/python2.7 python2.7_virtual_environment source python2.7_virtual_environment/bin/activate pip install enum34==1.0.4 futures==2.2.0 protobuf==3.0.0-alpha-1 diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index 2df4e257bfe..9c7dea008db 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -36,10 +36,6 @@ cd $(dirname $0)/../.. root=`pwd` export LD_LIBRARY_PATH=$root/libs/opt source python2.7_virtual_environment/bin/activate -ldd $PWD/python2.7_virtual_environment/bin/python -ldd $PWD/python2.7_virtual_environment/local/lib/python2.7/site-packages/grpc/_adapter/_c.so -objdump -T /lib/x86_64-linux-gnu/libc.so.6 -objdump -T /lib/x86_64-linux-gnu/libc.so.6 | grep clock_gettime # TODO(issue 215): Properly itemize these in run_tests.py so that they can be parallelized. # TODO(atash): Enable dynamic unused port discovery for this test. # TODO(mlumish): Re-enable this test when we can install protoc From b61813614345056d56effcffdf69fd8a937d3a89 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 2 Mar 2015 14:32:25 -0800 Subject: [PATCH 71/71] Improved Makefile protoc message --- Makefile | 136 ++++++++++++++++++------------------ templates/Makefile.template | 8 +-- 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/Makefile b/Makefile index 64871343e1e..ace93ea84e2 100644 --- a/Makefile +++ b/Makefile @@ -2115,7 +2115,7 @@ ifeq ($(INSTALL_OK),true) @echo "Your system looks ready to go." @echo else - @echo "Your system doesn't have protoc 3.0.0+ installed. While this" + @echo "We couldn't find protoc 3.0.0+ installed on your system. While this" @echo "won't prevent grpc from working, you won't be able to compile" @echo "and run any meaningful code with it." @echo @@ -2124,7 +2124,8 @@ else @echo @echo " https://github.com/google/protobuf/releases" @echo - @echo "Once you've done so, you can re-run this check by doing:" + @echo "Once you've done so, or if you think this message is in error," + @echo "you can re-run this check by doing:" @echo @echo " make verify-install" endif @@ -2203,7 +2204,7 @@ $(LIBDIR)/$(CONFIG)/libgpr.a: $(ZLIB_DEP) $(LIBGPR_OBJS) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgpr.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBGPR_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgpr.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgpr.a endif @@ -2294,7 +2295,7 @@ $(LIBDIR)/$(CONFIG)/libgpr_test_util.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBGPR_TEST $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBGPR_TEST_UTIL_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgpr_test_util.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgpr_test_util.a endif @@ -2590,7 +2591,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBGRPC_OBJS) $(Q) ar rcs $(LIBDIR)/$(CONFIG)/libgrpc.a tmp-merge/* $(Q) rm -rf tmp-merge ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc.a endif @@ -2789,7 +2790,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBGRPC_TE $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBGRPC_TEST_UTIL_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a endif @@ -2928,7 +2929,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a: $(ZLIB_DEP) $(LIBGRPC_UNSECURE_OBJS) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBGRPC_UNSECURE_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a endif @@ -3157,7 +3158,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc++.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBUF_DEP) $(LI $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBGRPC++_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++.a endif @@ -3253,7 +3254,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBUF $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBGRPC++_TEST_UTIL_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a endif @@ -3320,7 +3321,7 @@ $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBU $(Q) rm -f $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBPUBSUB_CLIENT_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a endif @@ -3377,7 +3378,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBGRPC_C $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a $(LIBGRPC_CSHARP_EXT_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a endif @@ -3440,7 +3441,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fake_security.a: $(ZLIB_DEP) $(OPE $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fake_security.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fake_security.a $(LIBEND2END_FIXTURE_CHTTP2_FAKE_SECURITY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fake_security.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fake_security.a endif @@ -3486,7 +3487,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack.a: $(ZLIB_DEP) $(OPENSSL $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack.a $(LIBEND2END_FIXTURE_CHTTP2_FULLSTACK_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack.a endif @@ -3532,7 +3533,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack_uds.a: $(ZLIB_DEP) $(OPE $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack_uds.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack_uds.a $(LIBEND2END_FIXTURE_CHTTP2_FULLSTACK_UDS_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack_uds.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack_uds.a endif @@ -3578,7 +3579,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_fullstack.a: $(ZLIB_DEP $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_fullstack.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_fullstack.a $(LIBEND2END_FIXTURE_CHTTP2_SIMPLE_SSL_FULLSTACK_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_fullstack.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_fullstack.a endif @@ -3624,7 +3625,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack.a $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack.a $(LIBEND2END_FIXTURE_CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack.a endif @@ -3670,7 +3671,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair.a: $(ZLIB_DEP) $(OPENS $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair.a $(LIBEND2END_FIXTURE_CHTTP2_SOCKET_PAIR_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair.a endif @@ -3716,7 +3717,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time.a: $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time.a $(LIBEND2END_FIXTURE_CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time.a endif @@ -3745,7 +3746,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept.a: $(ZLIB_DEP) $(LIBEND2 $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept.a $(LIBEND2END_TEST_CANCEL_AFTER_ACCEPT_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept.a endif @@ -3770,7 +3771,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_and_writes_closed.a: $(Z $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_and_writes_closed.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_and_writes_closed.a $(LIBEND2END_TEST_CANCEL_AFTER_ACCEPT_AND_WRITES_CLOSED_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_and_writes_closed.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_and_writes_closed.a endif @@ -3795,7 +3796,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_invoke.a: $(ZLIB_DEP) $(LIBEND2 $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_invoke.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_invoke.a $(LIBEND2END_TEST_CANCEL_AFTER_INVOKE_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_invoke.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_invoke.a endif @@ -3820,7 +3821,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_before_invoke.a: $(ZLIB_DEP) $(LIBEND $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_before_invoke.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_before_invoke.a $(LIBEND2END_TEST_CANCEL_BEFORE_INVOKE_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_before_invoke.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_before_invoke.a endif @@ -3845,7 +3846,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_in_a_vacuum.a: $(ZLIB_DEP) $(LIBEND2E $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_in_a_vacuum.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_in_a_vacuum.a $(LIBEND2END_TEST_CANCEL_IN_A_VACUUM_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_in_a_vacuum.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_in_a_vacuum.a endif @@ -3870,7 +3871,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_census_simple_request.a: $(ZLIB_DEP) $(LIBEN $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_census_simple_request.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_census_simple_request.a $(LIBEND2END_TEST_CENSUS_SIMPLE_REQUEST_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_census_simple_request.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_census_simple_request.a endif @@ -3895,7 +3896,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_disappearing_server.a: $(ZLIB_DEP) $(LIBEND2 $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_disappearing_server.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_disappearing_server.a $(LIBEND2END_TEST_DISAPPEARING_SERVER_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_disappearing_server.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_disappearing_server.a endif @@ -3920,7 +3921,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_inflight_call $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_inflight_calls.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_inflight_calls.a $(LIBEND2END_TEST_EARLY_SERVER_SHUTDOWN_FINISHES_INFLIGHT_CALLS_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_inflight_calls.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_inflight_calls.a endif @@ -3945,7 +3946,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_tags.a: $(ZLI $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_tags.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_tags.a $(LIBEND2END_TEST_EARLY_SERVER_SHUTDOWN_FINISHES_TAGS_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_tags.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_tags.a endif @@ -3970,7 +3971,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_empty_batch.a: $(ZLIB_DEP) $(LIBEND2END_TEST $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_empty_batch.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_empty_batch.a $(LIBEND2END_TEST_EMPTY_BATCH_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_empty_batch.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_empty_batch.a endif @@ -3995,7 +3996,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_graceful_server_shutdown.a: $(ZLIB_DEP) $(LI $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_graceful_server_shutdown.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_graceful_server_shutdown.a $(LIBEND2END_TEST_GRACEFUL_SERVER_SHUTDOWN_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_graceful_server_shutdown.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_graceful_server_shutdown.a endif @@ -4020,7 +4021,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_invoke_large_request.a: $(ZLIB_DEP) $(LIBEND $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_invoke_large_request.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_invoke_large_request.a $(LIBEND2END_TEST_INVOKE_LARGE_REQUEST_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_invoke_large_request.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_invoke_large_request.a endif @@ -4045,7 +4046,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_max_concurrent_streams.a: $(ZLIB_DEP) $(LIBE $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_max_concurrent_streams.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_max_concurrent_streams.a $(LIBEND2END_TEST_MAX_CONCURRENT_STREAMS_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_max_concurrent_streams.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_max_concurrent_streams.a endif @@ -4070,7 +4071,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_no_op.a: $(ZLIB_DEP) $(LIBEND2END_TEST_NO_OP $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_no_op.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_no_op.a $(LIBEND2END_TEST_NO_OP_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_no_op.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_no_op.a endif @@ -4095,7 +4096,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_ping_pong_streaming.a: $(ZLIB_DEP) $(LIBEND2 $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_ping_pong_streaming.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_ping_pong_streaming.a $(LIBEND2END_TEST_PING_PONG_STREAMING_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_ping_pong_streaming.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_ping_pong_streaming.a endif @@ -4120,7 +4121,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_binary_metadata_and_pa $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_binary_metadata_and_payload.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_binary_metadata_and_payload.a $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_BINARY_METADATA_AND_PAYLOAD_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_binary_metadata_and_payload.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_binary_metadata_and_payload.a endif @@ -4145,7 +4146,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_metadata_and_payload.a $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_metadata_and_payload.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_metadata_and_payload.a $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_METADATA_AND_PAYLOAD_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_metadata_and_payload.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_metadata_and_payload.a endif @@ -4170,7 +4171,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_payload.a: $(ZLIB_DEP) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_payload.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_payload.a $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_PAYLOAD_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_payload.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_payload.a endif @@ -4195,7 +4196,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_large_metadata.a: $(ZLIB_DEP) $ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_large_metadata.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_large_metadata.a $(LIBEND2END_TEST_REQUEST_WITH_LARGE_METADATA_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_large_metadata.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_large_metadata.a endif @@ -4220,7 +4221,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_payload.a: $(ZLIB_DEP) $(LIBEND $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_payload.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_payload.a $(LIBEND2END_TEST_REQUEST_WITH_PAYLOAD_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_payload.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_payload.a endif @@ -4245,7 +4246,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_simple_delayed_request.a: $(ZLIB_DEP) $(LIBE $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_simple_delayed_request.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_simple_delayed_request.a $(LIBEND2END_TEST_SIMPLE_DELAYED_REQUEST_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_simple_delayed_request.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_simple_delayed_request.a endif @@ -4270,7 +4271,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_simple_request.a: $(ZLIB_DEP) $(LIBEND2END_T $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_simple_request.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_simple_request.a $(LIBEND2END_TEST_SIMPLE_REQUEST_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_simple_request.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_simple_request.a endif @@ -4295,7 +4296,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_thread_stress.a: $(ZLIB_DEP) $(LIBEND2END_TE $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_thread_stress.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_thread_stress.a $(LIBEND2END_TEST_THREAD_STRESS_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_thread_stress.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_thread_stress.a endif @@ -4320,7 +4321,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_writes_done_hangs_with_pending_read.a: $(ZLI $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_writes_done_hangs_with_pending_read.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_writes_done_hangs_with_pending_read.a $(LIBEND2END_TEST_WRITES_DONE_HANGS_WITH_PENDING_READ_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_writes_done_hangs_with_pending_read.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_writes_done_hangs_with_pending_read.a endif @@ -4345,7 +4346,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_legacy.a: $(ZLIB_DEP) $( $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_legacy.a $(LIBEND2END_TEST_CANCEL_AFTER_ACCEPT_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_legacy.a endif @@ -4370,7 +4371,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_and_writes_closed_legacy $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_and_writes_closed_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_and_writes_closed_legacy.a $(LIBEND2END_TEST_CANCEL_AFTER_ACCEPT_AND_WRITES_CLOSED_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_and_writes_closed_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_and_writes_closed_legacy.a endif @@ -4395,7 +4396,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_invoke_legacy.a: $(ZLIB_DEP) $( $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_invoke_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_invoke_legacy.a $(LIBEND2END_TEST_CANCEL_AFTER_INVOKE_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_invoke_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_invoke_legacy.a endif @@ -4420,7 +4421,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_before_invoke_legacy.a: $(ZLIB_DEP) $ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_before_invoke_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_before_invoke_legacy.a $(LIBEND2END_TEST_CANCEL_BEFORE_INVOKE_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_before_invoke_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_before_invoke_legacy.a endif @@ -4445,7 +4446,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_in_a_vacuum_legacy.a: $(ZLIB_DEP) $(L $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_in_a_vacuum_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_in_a_vacuum_legacy.a $(LIBEND2END_TEST_CANCEL_IN_A_VACUUM_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_in_a_vacuum_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_in_a_vacuum_legacy.a endif @@ -4470,7 +4471,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_census_simple_request_legacy.a: $(ZLIB_DEP) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_census_simple_request_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_census_simple_request_legacy.a $(LIBEND2END_TEST_CENSUS_SIMPLE_REQUEST_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_census_simple_request_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_census_simple_request_legacy.a endif @@ -4495,7 +4496,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_disappearing_server_legacy.a: $(ZLIB_DEP) $( $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_disappearing_server_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_disappearing_server_legacy.a $(LIBEND2END_TEST_DISAPPEARING_SERVER_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_disappearing_server_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_disappearing_server_legacy.a endif @@ -4520,7 +4521,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_inflight_call $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_inflight_calls_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_inflight_calls_legacy.a $(LIBEND2END_TEST_EARLY_SERVER_SHUTDOWN_FINISHES_INFLIGHT_CALLS_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_inflight_calls_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_inflight_calls_legacy.a endif @@ -4545,7 +4546,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_tags_legacy.a $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_tags_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_tags_legacy.a $(LIBEND2END_TEST_EARLY_SERVER_SHUTDOWN_FINISHES_TAGS_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_tags_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_tags_legacy.a endif @@ -4570,7 +4571,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_graceful_server_shutdown_legacy.a: $(ZLIB_DE $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_graceful_server_shutdown_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_graceful_server_shutdown_legacy.a $(LIBEND2END_TEST_GRACEFUL_SERVER_SHUTDOWN_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_graceful_server_shutdown_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_graceful_server_shutdown_legacy.a endif @@ -4595,7 +4596,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_invoke_large_request_legacy.a: $(ZLIB_DEP) $ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_invoke_large_request_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_invoke_large_request_legacy.a $(LIBEND2END_TEST_INVOKE_LARGE_REQUEST_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_invoke_large_request_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_invoke_large_request_legacy.a endif @@ -4620,7 +4621,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_max_concurrent_streams_legacy.a: $(ZLIB_DEP) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_max_concurrent_streams_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_max_concurrent_streams_legacy.a $(LIBEND2END_TEST_MAX_CONCURRENT_STREAMS_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_max_concurrent_streams_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_max_concurrent_streams_legacy.a endif @@ -4645,7 +4646,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_no_op_legacy.a: $(ZLIB_DEP) $(LIBEND2END_TES $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_no_op_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_no_op_legacy.a $(LIBEND2END_TEST_NO_OP_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_no_op_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_no_op_legacy.a endif @@ -4670,7 +4671,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_ping_pong_streaming_legacy.a: $(ZLIB_DEP) $( $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_ping_pong_streaming_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_ping_pong_streaming_legacy.a $(LIBEND2END_TEST_PING_PONG_STREAMING_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_ping_pong_streaming_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_ping_pong_streaming_legacy.a endif @@ -4695,7 +4696,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_binary_metadata_and_pa $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_binary_metadata_and_payload_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_binary_metadata_and_payload_legacy.a $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_BINARY_METADATA_AND_PAYLOAD_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_binary_metadata_and_payload_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_binary_metadata_and_payload_legacy.a endif @@ -4720,7 +4721,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_metadata_and_payload_l $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_metadata_and_payload_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_metadata_and_payload_legacy.a $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_METADATA_AND_PAYLOAD_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_metadata_and_payload_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_metadata_and_payload_legacy.a endif @@ -4745,7 +4746,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_payload_legacy.a: $(ZL $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_payload_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_payload_legacy.a $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_PAYLOAD_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_payload_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_payload_legacy.a endif @@ -4770,7 +4771,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_trailing_metadata_and_ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_trailing_metadata_and_payload_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_trailing_metadata_and_payload_legacy.a $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_TRAILING_METADATA_AND_PAYLOAD_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_trailing_metadata_and_payload_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_trailing_metadata_and_payload_legacy.a endif @@ -4795,7 +4796,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_large_metadata_legacy.a: $(ZLIB $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_large_metadata_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_large_metadata_legacy.a $(LIBEND2END_TEST_REQUEST_WITH_LARGE_METADATA_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_large_metadata_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_large_metadata_legacy.a endif @@ -4820,7 +4821,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_payload_legacy.a: $(ZLIB_DEP) $ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_payload_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_payload_legacy.a $(LIBEND2END_TEST_REQUEST_WITH_PAYLOAD_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_payload_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_payload_legacy.a endif @@ -4845,7 +4846,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_simple_delayed_request_legacy.a: $(ZLIB_DEP) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_simple_delayed_request_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_simple_delayed_request_legacy.a $(LIBEND2END_TEST_SIMPLE_DELAYED_REQUEST_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_simple_delayed_request_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_simple_delayed_request_legacy.a endif @@ -4870,7 +4871,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_simple_request_legacy.a: $(ZLIB_DEP) $(LIBEN $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_simple_request_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_simple_request_legacy.a $(LIBEND2END_TEST_SIMPLE_REQUEST_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_simple_request_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_simple_request_legacy.a endif @@ -4895,7 +4896,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_thread_stress_legacy.a: $(ZLIB_DEP) $(LIBEND $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_thread_stress_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_thread_stress_legacy.a $(LIBEND2END_TEST_THREAD_STRESS_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_thread_stress_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_thread_stress_legacy.a endif @@ -4920,7 +4921,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_test_writes_done_hangs_with_pending_read_legacy.a $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_test_writes_done_hangs_with_pending_read_legacy.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_test_writes_done_hangs_with_pending_read_legacy.a $(LIBEND2END_TEST_WRITES_DONE_HANGS_WITH_PENDING_READ_LEGACY_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_writes_done_hangs_with_pending_read_legacy.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_test_writes_done_hangs_with_pending_read_legacy.a endif @@ -4966,7 +4967,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_certs.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBEND2END_ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBEND2END_CERTS_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_certs.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_certs.a endif @@ -18037,4 +18038,3 @@ endif .PHONY: all strip tools dep_error openssl_dep_error openssl_dep_message git_update stop buildtests buildtests_c buildtests_cxx test test_c test_cxx install install_c install_cxx install-headers install-headers_c install-headers_cxx install-shared install-shared_c install-shared_cxx install-static install-static_c install-static_cxx strip strip-shared strip-static strip_c strip-shared_c strip-static_c strip_cxx strip-shared_cxx strip-static_cxx dep_c dep_cxx bins_dep_c bins_dep_cxx clean - diff --git a/templates/Makefile.template b/templates/Makefile.template index 2e50e5d41ec..24fd450dff5 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -859,7 +859,7 @@ ifeq ($(INSTALL_OK),true) @echo "Your system looks ready to go." @echo else - @echo "Your system doesn't have protoc 3.0.0+ installed. While this" + @echo "We couldn't find protoc 3.0.0+ installed on your system. While this" @echo "won't prevent grpc from working, you won't be able to compile" @echo "and run any meaningful code with it." @echo @@ -868,7 +868,8 @@ else @echo @echo " https://github.com/google/protobuf/releases" @echo - @echo "Once you've done so, you can re-run this check by doing:" + @echo "Once you've done so, or if you think this message is in error," + @echo "you can re-run this check by doing:" @echo @echo " make verify-install" endif @@ -1003,7 +1004,7 @@ $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP)\ % endif % endif ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/lib${lib.name}.a + $(Q) ranlib $(LIBDIR)/$(CONFIG)/lib${lib.name}.a endif <% @@ -1222,4 +1223,3 @@ strip_c strip-shared_c strip-static_c \ strip_cxx strip-shared_cxx strip-static_cxx \ dep_c dep_cxx bins_dep_c bins_dep_cxx \ clean -