From 78b6cdd660fa68a6e76750741116de454c33133c Mon Sep 17 00:00:00 2001 From: Ronak Jain Date: Tue, 18 Oct 2016 16:55:11 +0530 Subject: [PATCH 01/52] replaced protobuf tag --- src/compiler/cpp_generator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index d0c35ea1ab3..78195ca18c3 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -102,7 +102,7 @@ grpc::string GetHeaderPrologue(File *file, const Parameters & /*params*/) { vars["filename_base"] = file->filename_without_ext(); vars["message_header_ext"] = file->message_header_ext(); - printer->Print(vars, "// Generated by the gRPC protobuf plugin.\n"); + printer->Print(vars, "// Generated by the gRPC C++ plugin.\n"); printer->Print(vars, "// If you make any local change, they will be lost.\n"); printer->Print(vars, "// source: $filename$\n"); @@ -919,7 +919,7 @@ grpc::string GetSourcePrologue(File *file, const Parameters & /*params*/) { vars["message_header_ext"] = file->message_header_ext(); vars["service_header_ext"] = file->service_header_ext(); - printer->Print(vars, "// Generated by the gRPC protobuf plugin.\n"); + printer->Print(vars, "// Generated by the gRPC C++ plugin.\n"); printer->Print(vars, "// If you make any local change, they will be lost.\n"); printer->Print(vars, "// source: $filename$\n\n"); From a3f8097b348a5abda9d6fc9c2689bedfb185e9d5 Mon Sep 17 00:00:00 2001 From: Ronak Jain Date: Wed, 14 Dec 2016 22:52:38 +0530 Subject: [PATCH 02/52] replaced protobuf tag in compile_test_golden --- test/cpp/codegen/compiler_test_golden | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cpp/codegen/compiler_test_golden b/test/cpp/codegen/compiler_test_golden index 7b0fd6ce804..2aba036f8f2 100644 --- a/test/cpp/codegen/compiler_test_golden +++ b/test/cpp/codegen/compiler_test_golden @@ -1,4 +1,4 @@ -// Generated by the gRPC protobuf plugin. +// Generated by the gRPC C++ plugin. // If you make any local change, they will be lost. // source: src/proto/grpc/testing/compiler_test.proto // Original file comments: From aa76d3d3b642304ba05026593fc8b9cf8b49e072 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Wed, 15 Feb 2017 14:00:01 -0800 Subject: [PATCH 03/52] Enclose sin6_scope_id in uri --- src/core/ext/client_channel/parse_address.c | 26 ++++++++++++++++--- src/core/ext/client_channel/uri_parser.c | 28 +++++++++++++-------- src/core/lib/iomgr/sockaddr_utils.c | 12 ++++++++- src/core/lib/iomgr/tcp_client_posix.c | 3 +++ test/core/client_channel/uri_parser_test.c | 2 ++ test/core/iomgr/sockaddr_utils_test.c | 16 ++++++++++++ test/core/slice/percent_encoding_test.c | 1 + 7 files changed, 74 insertions(+), 14 deletions(-) diff --git a/src/core/ext/client_channel/parse_address.c b/src/core/ext/client_channel/parse_address.c index b1d55ad0f5f..eb1df84bc64 100644 --- a/src/core/ext/client_channel/parse_address.c +++ b/src/core/ext/client_channel/parse_address.c @@ -44,6 +44,7 @@ #include #include #include +#include "src/core/lib/support/string.h" #ifdef GRPC_HAVE_UNIX_SOCKET @@ -119,9 +120,28 @@ int parse_ipv6(grpc_uri *uri, grpc_resolved_address *resolved_addr) { memset(in6, 0, sizeof(*in6)); resolved_addr->len = sizeof(*in6); in6->sin6_family = AF_INET6; - if (inet_pton(AF_INET6, host, &in6->sin6_addr) == 0) { - gpr_log(GPR_ERROR, "invalid ipv6 address: '%s'", host); - goto done; + + char *host_end = (char *)gpr_memrchr(host, '%', strlen(host)); + if (host_end != NULL) { + size_t host_without_scope_len = (size_t)(host_end - host); + char host_without_scope[host_without_scope_len + 1]; + strncpy(host_without_scope, host, host_without_scope_len); + host_without_scope[host_without_scope_len] = '\0'; + if (inet_pton(AF_INET6, host_without_scope, &in6->sin6_addr) == 0) { + gpr_log(GPR_ERROR, "invalid ipv6 address: '%s'", host_without_scope); + goto done; + } + if (gpr_parse_bytes_to_uint32(host_end + 1, + strlen(host) - host_without_scope_len - 1, + &in6->sin6_scope_id) == 0) { + gpr_log(GPR_ERROR, "invalid ipv6 scope id: '%s'", host_end + 1); + goto done; + } + } else { + if (inet_pton(AF_INET6, host, &in6->sin6_addr) == 0) { + gpr_log(GPR_ERROR, "invalid ipv6 address: '%s'", host); + goto done; + } } if (port != NULL) { diff --git a/src/core/ext/client_channel/uri_parser.c b/src/core/ext/client_channel/uri_parser.c index f8c946b2757..e521afd0c64 100644 --- a/src/core/ext/client_channel/uri_parser.c +++ b/src/core/ext/client_channel/uri_parser.c @@ -42,6 +42,7 @@ #include #include +#include "src/core/lib/slice/percent_encoding.h" #include "src/core/lib/support/string.h" /** a size_t default value... maps to all 1's */ @@ -68,11 +69,16 @@ static grpc_uri *bad_uri(const char *uri_text, size_t pos, const char *section, return NULL; } -/** Returns a copy of \a src[begin, end) */ -static char *copy_component(const char *src, size_t begin, size_t end) { - char *out = gpr_malloc(end - begin + 1); - memcpy(out, src + begin, end - begin); - out[end - begin] = 0; +/** Returns a copy of percent decoded \a src[begin, end) */ +static char *decode_and_copy_component(const char *src, size_t begin, + size_t end) { + grpc_slice component = + grpc_slice_from_copied_buffer(src + begin, end - begin); + grpc_slice decoded_component = + grpc_permissive_percent_decode_slice(component); + char *out = grpc_slice_to_c_string(decoded_component); + grpc_slice_unref(component); + grpc_slice_unref(decoded_component); return out; } @@ -264,11 +270,13 @@ grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors) { uri = gpr_malloc(sizeof(*uri)); memset(uri, 0, sizeof(*uri)); - uri->scheme = copy_component(uri_text, scheme_begin, scheme_end); - uri->authority = copy_component(uri_text, authority_begin, authority_end); - uri->path = copy_component(uri_text, path_begin, path_end); - uri->query = copy_component(uri_text, query_begin, query_end); - uri->fragment = copy_component(uri_text, fragment_begin, fragment_end); + uri->scheme = decode_and_copy_component(uri_text, scheme_begin, scheme_end); + uri->authority = + decode_and_copy_component(uri_text, authority_begin, authority_end); + uri->path = decode_and_copy_component(uri_text, path_begin, path_end); + uri->query = decode_and_copy_component(uri_text, query_begin, query_end); + uri->fragment = + decode_and_copy_component(uri_text, fragment_begin, fragment_end); parse_query_parts(uri); return uri; diff --git a/src/core/lib/iomgr/sockaddr_utils.c b/src/core/lib/iomgr/sockaddr_utils.c index 44bc2f968be..f23f9888d5b 100644 --- a/src/core/lib/iomgr/sockaddr_utils.c +++ b/src/core/lib/iomgr/sockaddr_utils.c @@ -162,6 +162,7 @@ int grpc_sockaddr_to_string(char **out, char ntop_buf[INET6_ADDRSTRLEN]; const void *ip = NULL; int port; + uint32_t sin6_scope_id = 0; int ret; *out = NULL; @@ -177,10 +178,19 @@ int grpc_sockaddr_to_string(char **out, const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr; ip = &addr6->sin6_addr; port = ntohs(addr6->sin6_port); + sin6_scope_id = addr6->sin6_scope_id; } if (ip != NULL && grpc_inet_ntop(addr->sa_family, ip, ntop_buf, sizeof(ntop_buf)) != NULL) { - ret = gpr_join_host_port(out, ntop_buf, port); + if (sin6_scope_id != 0) { + char *host_with_scope; + /* Enclose sin6_scope_id with the format defined in RFC 6784 section 2. */ + gpr_asprintf(&host_with_scope, "%s%%25%" PRIu32, ntop_buf, sin6_scope_id); + ret = gpr_join_host_port(out, host_with_scope, port); + gpr_free(host_with_scope); + } else { + ret = gpr_join_host_port(out, ntop_buf, port); + } } else { ret = gpr_asprintf(out, "(sockaddr family=%d)", addr->sa_family); } diff --git a/src/core/lib/iomgr/tcp_client_posix.c b/src/core/lib/iomgr/tcp_client_posix.c index 9a77c92016b..b40c31a5da3 100644 --- a/src/core/lib/iomgr/tcp_client_posix.c +++ b/src/core/lib/iomgr/tcp_client_posix.c @@ -37,6 +37,9 @@ #include "src/core/lib/iomgr/tcp_client_posix.h" +#include "src/core/lib/iomgr/sockaddr.h" +#include "src/core/lib/iomgr/socket_utils_posix.h" + #include #include #include diff --git a/test/core/client_channel/uri_parser_test.c b/test/core/client_channel/uri_parser_test.c index 5f32d3270c1..489e4ecd518 100644 --- a/test/core/client_channel/uri_parser_test.c +++ b/test/core/client_channel/uri_parser_test.c @@ -142,6 +142,8 @@ int main(int argc, char **argv) { test_succeeds("http:?legit#twice", "http", "", "", "legit", "twice"); test_succeeds("http://foo?bar#lol?", "http", "foo", "", "bar", "lol?"); test_succeeds("http://foo?bar#lol?/", "http", "foo", "", "bar", "lol?/"); + test_succeeds("ipv6:[2001:db8::1%252]:12345", "ipv6", "", + "[2001:db8::1%2]:12345", "", ""); test_fails("xyz"); test_fails("http:?dangling-pct-%0"); diff --git a/test/core/iomgr/sockaddr_utils_test.c b/test/core/iomgr/sockaddr_utils_test.c index 8569c697fe9..70a6c323e57 100644 --- a/test/core/iomgr/sockaddr_utils_test.c +++ b/test/core/iomgr/sockaddr_utils_test.c @@ -70,6 +70,12 @@ static grpc_resolved_address make_addr6(const uint8_t *data, size_t data_len) { return resolved_addr6; } +static void set_addr6_scope_id(grpc_resolved_address *addr, uint32_t scope_id) { + struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)addr->addr; + GPR_ASSERT(addr6->sin6_family == AF_INET6); + addr6->sin6_scope_id = scope_id; +} + static const uint8_t kMapped[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 192, 0, 2, 1}; @@ -222,6 +228,16 @@ static void test_sockaddr_to_string(void) { expect_sockaddr_str("[2001:db8::1]:12345", &input6, 1); expect_sockaddr_uri("ipv6:[2001:db8::1]:12345", &input6); + set_addr6_scope_id(&input6, 2); + expect_sockaddr_str("[2001:db8::1%252]:12345", &input6, 0); + expect_sockaddr_str("[2001:db8::1%252]:12345", &input6, 1); + expect_sockaddr_uri("ipv6:[2001:db8::1%252]:12345", &input6); + + set_addr6_scope_id(&input6, 101); + expect_sockaddr_str("[2001:db8::1%25101]:12345", &input6, 0); + expect_sockaddr_str("[2001:db8::1%25101]:12345", &input6, 1); + expect_sockaddr_uri("ipv6:[2001:db8::1%25101]:12345", &input6); + input6 = make_addr6(kMapped, sizeof(kMapped)); expect_sockaddr_str("[::ffff:192.0.2.1]:12345", &input6, 0); expect_sockaddr_str("192.0.2.1:12345", &input6, 1); diff --git a/test/core/slice/percent_encoding_test.c b/test/core/slice/percent_encoding_test.c index d71c99f54c5..8859be8b5af 100644 --- a/test/core/slice/percent_encoding_test.c +++ b/test/core/slice/percent_encoding_test.c @@ -146,6 +146,7 @@ int main(int argc, char **argv) { TEST_VECTOR("\x0f", "%0F", grpc_url_percent_encoding_unreserved_bytes); TEST_VECTOR("\xff", "%FF", grpc_url_percent_encoding_unreserved_bytes); TEST_VECTOR("\xee", "%EE", grpc_url_percent_encoding_unreserved_bytes); + TEST_VECTOR("%2", "%252", grpc_url_percent_encoding_unreserved_bytes); TEST_NONCONFORMANT_VECTOR("%", "%", grpc_url_percent_encoding_unreserved_bytes); TEST_NONCONFORMANT_VECTOR("%A", "%A", From a9d8a157be8afa34e7d8bc92e6110ea226a4509f Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Wed, 15 Feb 2017 15:27:44 -0800 Subject: [PATCH 04/52] Add parse_address_test --- CMakeLists.txt | 24 +++ Makefile | 36 ++++ build.yaml | 10 + test/core/client_channel/parse_address_test.c | 109 ++++++++++ .../generated/sources_and_headers.json | 17 ++ tools/run_tests/generated/tests.json | 22 ++ vsprojects/buildtests_c.sln | 27 +++ .../parse_address_test.vcxproj | 199 ++++++++++++++++++ .../parse_address_test.vcxproj.filters | 21 ++ 9 files changed, 465 insertions(+) create mode 100644 test/core/client_channel/parse_address_test.c create mode 100644 vsprojects/vcxproj/test/parse_address_test/parse_address_test.vcxproj create mode 100644 vsprojects/vcxproj/test/parse_address_test/parse_address_test.vcxproj.filters diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f37b64c8e3..a9abd236fb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6895,6 +6895,30 @@ target_link_libraries(no_server_test endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) +add_executable(parse_address_test + test/core/client_channel/parse_address_test.c +) + +target_include_directories(parse_address_test + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${BORINGSSL_ROOT_DIR}/include + PRIVATE ${PROTOBUF_ROOT_DIR}/src + PRIVATE ${ZLIB_ROOT_DIR} + PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib + PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include +) + +target_link_libraries(parse_address_test + grpc_test_util + grpc + gpr_test_util + gpr +) + +endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_TESTS) + add_executable(percent_encoding_test test/core/slice/percent_encoding_test.c ) diff --git a/Makefile b/Makefile index d9d7f4090bd..9a950dc8d85 100644 --- a/Makefile +++ b/Makefile @@ -1033,6 +1033,7 @@ murmur_hash_test: $(BINDIR)/$(CONFIG)/murmur_hash_test nanopb_fuzzer_response_test: $(BINDIR)/$(CONFIG)/nanopb_fuzzer_response_test nanopb_fuzzer_serverlist_test: $(BINDIR)/$(CONFIG)/nanopb_fuzzer_serverlist_test no_server_test: $(BINDIR)/$(CONFIG)/no_server_test +parse_address_test: $(BINDIR)/$(CONFIG)/parse_address_test percent_decode_fuzzer: $(BINDIR)/$(CONFIG)/percent_decode_fuzzer percent_encode_fuzzer: $(BINDIR)/$(CONFIG)/percent_encode_fuzzer percent_encoding_test: $(BINDIR)/$(CONFIG)/percent_encoding_test @@ -1378,6 +1379,7 @@ buildtests_c: privatelibs_c \ $(BINDIR)/$(CONFIG)/multiple_server_queues_test \ $(BINDIR)/$(CONFIG)/murmur_hash_test \ $(BINDIR)/$(CONFIG)/no_server_test \ + $(BINDIR)/$(CONFIG)/parse_address_test \ $(BINDIR)/$(CONFIG)/percent_encoding_test \ $(BINDIR)/$(CONFIG)/resolve_address_test \ $(BINDIR)/$(CONFIG)/resource_quota_test \ @@ -1784,6 +1786,8 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/murmur_hash_test || ( echo test murmur_hash_test failed ; exit 1 ) $(E) "[RUN] Testing no_server_test" $(Q) $(BINDIR)/$(CONFIG)/no_server_test || ( echo test no_server_test failed ; exit 1 ) + $(E) "[RUN] Testing parse_address_test" + $(Q) $(BINDIR)/$(CONFIG)/parse_address_test || ( echo test parse_address_test failed ; exit 1 ) $(E) "[RUN] Testing percent_encoding_test" $(Q) $(BINDIR)/$(CONFIG)/percent_encoding_test || ( echo test percent_encoding_test failed ; exit 1 ) $(E) "[RUN] Testing resolve_address_test" @@ -11040,6 +11044,38 @@ endif endif +PARSE_ADDRESS_TEST_SRC = \ + test/core/client_channel/parse_address_test.c \ + +PARSE_ADDRESS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PARSE_ADDRESS_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/parse_address_test: openssl_dep_error + +else + + + +$(BINDIR)/$(CONFIG)/parse_address_test: $(PARSE_ADDRESS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LD) $(LDFLAGS) $(PARSE_ADDRESS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/parse_address_test + +endif + +$(OBJDIR)/$(CONFIG)/test/core/client_channel/parse_address_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_parse_address_test: $(PARSE_ADDRESS_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(PARSE_ADDRESS_TEST_OBJS:.o=.dep) +endif +endif + + PERCENT_DECODE_FUZZER_SRC = \ test/core/slice/percent_decode_fuzzer.c \ diff --git a/build.yaml b/build.yaml index 9c55cb37849..7887440e079 100644 --- a/build.yaml +++ b/build.yaml @@ -2451,6 +2451,16 @@ targets: - grpc - gpr_test_util - gpr +- name: parse_address_test + build: test + language: c + src: + - test/core/client_channel/parse_address_test.c + deps: + - grpc_test_util + - grpc + - gpr_test_util + - gpr - name: percent_decode_fuzzer build: fuzzer language: c diff --git a/test/core/client_channel/parse_address_test.c b/test/core/client_channel/parse_address_test.c new file mode 100644 index 00000000000..79079acb5d1 --- /dev/null +++ b/test/core/client_channel/parse_address_test.c @@ -0,0 +1,109 @@ +/* + * + * Copyright 2017, 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/ext/client_channel/parse_address.h" +#include "src/core/lib/iomgr/sockaddr.h" + +#include +#ifdef GRPC_HAVE_UNIX_SOCKET +#include +#endif + +#include + +#include "src/core/lib/iomgr/socket_utils.h" +#include "test/core/util/test_config.h" + +#ifdef GRPC_HAVE_UNIX_SOCKET + +static void test_parse_unix(const char *uri_text, const char *pathname) { + grpc_uri *uri = grpc_uri_parse(uri_text, 0); + grpc_resolved_address addr; + + GPR_ASSERT(1 == parse_unix(uri, &addr)); + struct sockaddr_un *addr_un = (struct sockaddr_un *)addr.addr; + GPR_ASSERT(AF_UNIX == addr_un->sun_family); + GPR_ASSERT(0 == strcmp(addr_un->sun_path, pathname)); + + grpc_uri_destroy(uri); +} + +#else /* GRPC_HAVE_UNIX_SOCKET */ + +static void test_parse_unix(const char *uri_text, const char *pathname) {} + +#endif /* GRPC_HAVE_UNIX_SOCKET */ + +static void test_parse_ipv4(const char *uri_text, const char *host, + unsigned short port) { + grpc_uri *uri = grpc_uri_parse(uri_text, 0); + grpc_resolved_address addr; + char ntop_buf[INET_ADDRSTRLEN]; + + GPR_ASSERT(1 == parse_ipv4(uri, &addr)); + struct sockaddr_in *addr_in = (struct sockaddr_in *)addr.addr; + GPR_ASSERT(AF_INET == addr_in->sin_family); + GPR_ASSERT(NULL != grpc_inet_ntop(AF_INET, &addr_in->sin_addr, ntop_buf, + sizeof(ntop_buf))); + GPR_ASSERT(0 == strcmp(ntop_buf, host)); + GPR_ASSERT(ntohs(addr_in->sin_port) == port); + + grpc_uri_destroy(uri); +} + +static void test_parse_ipv6(const char *uri_text, const char *host, + unsigned short port, u_int32_t scope_id) { + grpc_uri *uri = grpc_uri_parse(uri_text, 0); + grpc_resolved_address addr; + char ntop_buf[INET6_ADDRSTRLEN]; + + GPR_ASSERT(1 == parse_ipv6(uri, &addr)); + struct sockaddr_in6 *addr_in6 = (struct sockaddr_in6 *)addr.addr; + GPR_ASSERT(AF_INET6 == addr_in6->sin6_family); + GPR_ASSERT(NULL != grpc_inet_ntop(AF_INET6, &addr_in6->sin6_addr, ntop_buf, + sizeof(ntop_buf))); + GPR_ASSERT(0 == strcmp(ntop_buf, host)); + GPR_ASSERT(ntohs(addr_in6->sin6_port) == port); + GPR_ASSERT(addr_in6->sin6_scope_id == scope_id); + + grpc_uri_destroy(uri); +} + +int main(int argc, char **argv) { + grpc_test_init(argc, argv); + + test_parse_unix("unix:/path/name", "/path/name"); + test_parse_ipv4("ipv4:192.0.2.1:12345", "192.0.2.1", 12345); + test_parse_ipv6("ipv6:[2001:db8::1]:12345", "2001:db8::1", 12345, 0); + test_parse_ipv6("ipv6:[2001:db8::1%252]:12345", "2001:db8::1", 12345, 2); +} diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 9bc82486d2b..2f8cfaec886 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -1676,6 +1676,23 @@ "third_party": false, "type": "target" }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "is_filegroup": false, + "language": "c", + "name": "parse_address_test", + "src": [ + "test/core/client_channel/parse_address_test.c" + ], + "third_party": false, + "type": "target" + }, { "deps": [ "gpr", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 2c7b0a6c822..1a0b25ba3a6 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -1695,6 +1695,28 @@ "windows" ] }, + { + "args": [], + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": false, + "language": "c", + "name": "parse_address_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ] + }, { "args": [], "ci_platforms": [ diff --git a/vsprojects/buildtests_c.sln b/vsprojects/buildtests_c.sln index f484f29a4b2..73dd221f448 100644 --- a/vsprojects/buildtests_c.sln +++ b/vsprojects/buildtests_c.sln @@ -1277,6 +1277,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "no_server_test", "vcxproj\t {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parse_address_test", "vcxproj\test\parse_address_test\parse_address_test.vcxproj", "{EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}" + ProjectSection(myProperties) = preProject + lib = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} = {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} + {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} + {EAB0A629-17A9-44DB-B5FF-E91A721FE037} = {EAB0A629-17A9-44DB-B5FF-E91A721FE037} + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "percent_encoding_test", "vcxproj\test\percent_encoding_test\percent_encoding_test.vcxproj", "{CCFC6A58-623D-9013-BFEB-C809809E2429}" ProjectSection(myProperties) = preProject lib = "False" @@ -3511,6 +3522,22 @@ Global {A66AC548-E2B9-74CD-293C-43526EE51DCE}.Release-DLL|Win32.Build.0 = Release|Win32 {A66AC548-E2B9-74CD-293C-43526EE51DCE}.Release-DLL|x64.ActiveCfg = Release|x64 {A66AC548-E2B9-74CD-293C-43526EE51DCE}.Release-DLL|x64.Build.0 = Release|x64 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Debug|Win32.ActiveCfg = Debug|Win32 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Debug|x64.ActiveCfg = Debug|x64 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Release|Win32.ActiveCfg = Release|Win32 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Release|x64.ActiveCfg = Release|x64 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Debug|Win32.Build.0 = Debug|Win32 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Debug|x64.Build.0 = Debug|x64 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Release|Win32.Build.0 = Release|Win32 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Release|x64.Build.0 = Release|x64 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Debug-DLL|Win32.Build.0 = Debug|Win32 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Debug-DLL|x64.ActiveCfg = Debug|x64 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Debug-DLL|x64.Build.0 = Debug|x64 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Release-DLL|Win32.ActiveCfg = Release|Win32 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Release-DLL|Win32.Build.0 = Release|Win32 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Release-DLL|x64.ActiveCfg = Release|x64 + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463}.Release-DLL|x64.Build.0 = Release|x64 {CCFC6A58-623D-9013-BFEB-C809809E2429}.Debug|Win32.ActiveCfg = Debug|Win32 {CCFC6A58-623D-9013-BFEB-C809809E2429}.Debug|x64.ActiveCfg = Debug|x64 {CCFC6A58-623D-9013-BFEB-C809809E2429}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/vsprojects/vcxproj/test/parse_address_test/parse_address_test.vcxproj b/vsprojects/vcxproj/test/parse_address_test/parse_address_test.vcxproj new file mode 100644 index 00000000000..17046708f92 --- /dev/null +++ b/vsprojects/vcxproj/test/parse_address_test/parse_address_test.vcxproj @@ -0,0 +1,199 @@ + + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {EDEA8257-AEA8-1B0A-F95B-8D6CD7286463} + true + $(SolutionDir)IntDir\$(MSBuildProjectName)\ + + + + v100 + + + v110 + + + v120 + + + v140 + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + parse_address_test + static + Debug + static + Debug + + + parse_address_test + static + Release + static + Release + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + true + None + false + + + Console + true + false + + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + true + None + false + + + Console + true + false + + + + + + NotUsing + Level3 + MaxSpeed + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + true + MultiThreaded + true + None + false + + + Console + true + false + true + true + + + + + + NotUsing + Level3 + MaxSpeed + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + true + MultiThreaded + true + None + false + + + Console + true + false + true + true + + + + + + + + + + {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} + + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + + + {EAB0A629-17A9-44DB-B5FF-E91A721FE037} + + + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + diff --git a/vsprojects/vcxproj/test/parse_address_test/parse_address_test.vcxproj.filters b/vsprojects/vcxproj/test/parse_address_test/parse_address_test.vcxproj.filters new file mode 100644 index 00000000000..e4e446da997 --- /dev/null +++ b/vsprojects/vcxproj/test/parse_address_test/parse_address_test.vcxproj.filters @@ -0,0 +1,21 @@ + + + + + test\core\client_channel + + + + + + {1613c595-3fdf-b7ab-6d5f-667bbd7eefc7} + + + {cdfde21c-75c2-08ee-3d98-8ca67b5c31e0} + + + {60d8328d-ca06-b3cf-cf1d-889b6677def1} + + + + From c40d1d84f9d492561cb71ea3f5304ef780d7e574 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Wed, 15 Feb 2017 20:42:06 -0800 Subject: [PATCH 05/52] Use the internal slice api Address review comments --- .../client_channel/client_channel_plugin.c | 2 +- .../client_channel/http_connect_handshaker.c | 13 ++++---- src/core/ext/client_channel/parse_address.c | 4 ++- .../ext/client_channel/resolver_registry.c | 22 +++++++------ .../ext/client_channel/resolver_registry.h | 5 +-- src/core/ext/client_channel/subchannel.c | 12 ++++--- src/core/ext/client_channel/subchannel.h | 3 +- src/core/ext/client_channel/uri_parser.c | 33 +++++++++++-------- src/core/ext/client_channel/uri_parser.h | 4 ++- src/core/ext/lb_policy/grpclb/grpclb.c | 2 +- .../chttp2/client/chttp2_connector.c | 2 +- src/core/lib/iomgr/tcp_client_posix.c | 3 -- test/core/client_channel/parse_address_test.c | 15 ++++++--- .../dns_resolver_connectivity_test.c | 2 +- .../resolvers/dns_resolver_test.c | 4 +-- .../resolvers/sockaddr_resolver_test.c | 4 +-- test/core/client_channel/uri_fuzzer_test.c | 5 ++- test/core/client_channel/uri_parser_test.c | 21 +++++++++--- 18 files changed, 95 insertions(+), 61 deletions(-) diff --git a/src/core/ext/client_channel/client_channel_plugin.c b/src/core/ext/client_channel/client_channel_plugin.c index d50bba60f6a..9220ec5878d 100644 --- a/src/core/ext/client_channel/client_channel_plugin.c +++ b/src/core/ext/client_channel/client_channel_plugin.c @@ -62,7 +62,7 @@ static bool set_default_host_if_unset(grpc_exec_ctx *exec_ctx, } } char *default_authority = grpc_get_default_authority( - grpc_channel_stack_builder_get_target(builder)); + exec_ctx, grpc_channel_stack_builder_get_target(builder)); if (default_authority != NULL) { grpc_arg arg; arg.type = GRPC_ARG_STRING; diff --git a/src/core/ext/client_channel/http_connect_handshaker.c b/src/core/ext/client_channel/http_connect_handshaker.c index fba32561acf..b83cec00dc9 100644 --- a/src/core/ext/client_channel/http_connect_handshaker.c +++ b/src/core/ext/client_channel/http_connect_handshaker.c @@ -280,9 +280,9 @@ static void http_connect_handshaker_do_handshake( const grpc_arg* arg = grpc_channel_args_find(args->args, GRPC_ARG_SERVER_URI); GPR_ASSERT(arg != NULL); GPR_ASSERT(arg->type == GRPC_ARG_STRING); - char* canonical_uri = - grpc_resolver_factory_add_default_prefix_if_needed(arg->value.string); - grpc_uri* uri = grpc_uri_parse(canonical_uri, 1); + char* canonical_uri = grpc_resolver_factory_add_default_prefix_if_needed( + exec_ctx, arg->value.string); + grpc_uri* uri = grpc_uri_parse(exec_ctx, canonical_uri, 1); char* server_name = uri->path; if (server_name[0] == '/') ++server_name; // Save state in the handshaker object. @@ -344,10 +344,11 @@ grpc_handshaker* grpc_http_connect_handshaker_create(const char* proxy_server, return &handshaker->base; } -char* grpc_get_http_proxy_server() { +char* grpc_get_http_proxy_server(grpc_exec_ctx* exec_ctx) { char* uri_str = gpr_getenv("http_proxy"); if (uri_str == NULL) return NULL; - grpc_uri* uri = grpc_uri_parse(uri_str, false /* suppress_errors */); + grpc_uri* uri = + grpc_uri_parse(exec_ctx, uri_str, false /* suppress_errors */); char* proxy_name = NULL; if (uri == NULL || uri->authority == NULL) { gpr_log(GPR_ERROR, "cannot parse value of 'http_proxy' env var"); @@ -375,7 +376,7 @@ done: static void handshaker_factory_add_handshakers( grpc_exec_ctx* exec_ctx, grpc_handshaker_factory* factory, const grpc_channel_args* args, grpc_handshake_manager* handshake_mgr) { - char* proxy_name = grpc_get_http_proxy_server(); + char* proxy_name = grpc_get_http_proxy_server(exec_ctx); if (proxy_name != NULL) { grpc_handshake_manager_add( handshake_mgr, diff --git a/src/core/ext/client_channel/parse_address.c b/src/core/ext/client_channel/parse_address.c index eb1df84bc64..a9baa736579 100644 --- a/src/core/ext/client_channel/parse_address.c +++ b/src/core/ext/client_channel/parse_address.c @@ -121,10 +121,12 @@ int parse_ipv6(grpc_uri *uri, grpc_resolved_address *resolved_addr) { resolved_addr->len = sizeof(*in6); in6->sin6_family = AF_INET6; + /* Handle the RFC6874 syntax for IPv6 zone identifiers. */ char *host_end = (char *)gpr_memrchr(host, '%', strlen(host)); if (host_end != NULL) { + GPR_ASSERT(host_end >= host); + char host_without_scope[INET6_ADDRSTRLEN]; size_t host_without_scope_len = (size_t)(host_end - host); - char host_without_scope[host_without_scope_len + 1]; strncpy(host_without_scope, host, host_without_scope_len); host_without_scope[host_without_scope_len] = '\0'; if (inet_pton(AF_INET6, host_without_scope, &in6->sin6_addr) == 0) { diff --git a/src/core/ext/client_channel/resolver_registry.c b/src/core/ext/client_channel/resolver_registry.c index 5110a7cad9e..e04c7332d60 100644 --- a/src/core/ext/client_channel/resolver_registry.c +++ b/src/core/ext/client_channel/resolver_registry.c @@ -108,22 +108,23 @@ static grpc_resolver_factory *lookup_factory_by_uri(grpc_uri *uri) { return lookup_factory(uri->scheme); } -static grpc_resolver_factory *resolve_factory(const char *target, +static grpc_resolver_factory *resolve_factory(grpc_exec_ctx *exec_ctx, + const char *target, grpc_uri **uri, char **canonical_target) { grpc_resolver_factory *factory = NULL; GPR_ASSERT(uri != NULL); - *uri = grpc_uri_parse(target, 1); + *uri = grpc_uri_parse(exec_ctx, target, 1); factory = lookup_factory_by_uri(*uri); if (factory == NULL) { grpc_uri_destroy(*uri); gpr_asprintf(canonical_target, "%s%s", g_default_resolver_prefix, target); - *uri = grpc_uri_parse(*canonical_target, 1); + *uri = grpc_uri_parse(exec_ctx, *canonical_target, 1); factory = lookup_factory_by_uri(*uri); if (factory == NULL) { - grpc_uri_destroy(grpc_uri_parse(target, 0)); - grpc_uri_destroy(grpc_uri_parse(*canonical_target, 0)); + grpc_uri_destroy(grpc_uri_parse(exec_ctx, target, 0)); + grpc_uri_destroy(grpc_uri_parse(exec_ctx, *canonical_target, 0)); gpr_log(GPR_ERROR, "don't know how to resolve '%s' or '%s'", target, *canonical_target); } @@ -137,7 +138,7 @@ grpc_resolver *grpc_resolver_create(grpc_exec_ctx *exec_ctx, const char *target, grpc_uri *uri = NULL; char *canonical_target = NULL; grpc_resolver_factory *factory = - resolve_factory(target, &uri, &canonical_target); + resolve_factory(exec_ctx, target, &uri, &canonical_target); grpc_resolver *resolver; grpc_resolver_args resolver_args; memset(&resolver_args, 0, sizeof(resolver_args)); @@ -151,21 +152,22 @@ grpc_resolver *grpc_resolver_create(grpc_exec_ctx *exec_ctx, const char *target, return resolver; } -char *grpc_get_default_authority(const char *target) { +char *grpc_get_default_authority(grpc_exec_ctx *exec_ctx, const char *target) { grpc_uri *uri = NULL; char *canonical_target = NULL; grpc_resolver_factory *factory = - resolve_factory(target, &uri, &canonical_target); + resolve_factory(exec_ctx, target, &uri, &canonical_target); char *authority = grpc_resolver_factory_get_default_authority(factory, uri); grpc_uri_destroy(uri); gpr_free(canonical_target); return authority; } -char *grpc_resolver_factory_add_default_prefix_if_needed(const char *target) { +char *grpc_resolver_factory_add_default_prefix_if_needed( + grpc_exec_ctx *exec_ctx, const char *target) { grpc_uri *uri = NULL; char *canonical_target = NULL; - resolve_factory(target, &uri, &canonical_target); + resolve_factory(exec_ctx, target, &uri, &canonical_target); grpc_uri_destroy(uri); return canonical_target == NULL ? gpr_strdup(target) : canonical_target; } diff --git a/src/core/ext/client_channel/resolver_registry.h b/src/core/ext/client_channel/resolver_registry.h index a4606463ebd..cb8c59333c0 100644 --- a/src/core/ext/client_channel/resolver_registry.h +++ b/src/core/ext/client_channel/resolver_registry.h @@ -73,10 +73,11 @@ grpc_resolver_factory *grpc_resolver_factory_lookup(const char *name); /** Given a target, return a (freshly allocated with gpr_malloc) string representing the default authority to pass from a client. */ -char *grpc_get_default_authority(const char *target); +char *grpc_get_default_authority(grpc_exec_ctx *exec_ctx, const char *target); /** Returns a newly allocated string containing \a target, adding the default prefix if needed. */ -char *grpc_resolver_factory_add_default_prefix_if_needed(const char *target); +char *grpc_resolver_factory_add_default_prefix_if_needed( + grpc_exec_ctx *exec_ctx, const char *target); #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_REGISTRY_H */ diff --git a/src/core/ext/client_channel/subchannel.c b/src/core/ext/client_channel/subchannel.c index 8bd284507d2..38e6b8013ad 100644 --- a/src/core/ext/client_channel/subchannel.c +++ b/src/core/ext/client_channel/subchannel.c @@ -330,7 +330,7 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx, } c->pollset_set = grpc_pollset_set_create(); grpc_resolved_address *addr = gpr_malloc(sizeof(*addr)); - grpc_get_subchannel_address_arg(args->args, addr); + grpc_get_subchannel_address_arg(exec_ctx, args->args, addr); grpc_set_initial_connect_string(&addr, &c->initial_connect_string); static const char *keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS}; grpc_arg new_arg = grpc_create_subchannel_address_arg(addr); @@ -777,8 +777,9 @@ grpc_call_stack *grpc_subchannel_call_get_call_stack( return SUBCHANNEL_CALL_TO_CALL_STACK(subchannel_call); } -static void grpc_uri_to_sockaddr(char *uri_str, grpc_resolved_address *addr) { - grpc_uri *uri = grpc_uri_parse(uri_str, 0 /* suppress_errors */); +static void grpc_uri_to_sockaddr(grpc_exec_ctx *exec_ctx, const char *uri_str, + grpc_resolved_address *addr) { + grpc_uri *uri = grpc_uri_parse(exec_ctx, uri_str, 0 /* suppress_errors */); GPR_ASSERT(uri != NULL); if (strcmp(uri->scheme, "ipv4") == 0) { GPR_ASSERT(parse_ipv4(uri, addr)); @@ -790,7 +791,8 @@ static void grpc_uri_to_sockaddr(char *uri_str, grpc_resolved_address *addr) { grpc_uri_destroy(uri); } -void grpc_get_subchannel_address_arg(const grpc_channel_args *args, +void grpc_get_subchannel_address_arg(grpc_exec_ctx *exec_ctx, + const grpc_channel_args *args, grpc_resolved_address *addr) { const grpc_arg *addr_arg = grpc_channel_args_find(args, GRPC_ARG_SUBCHANNEL_ADDRESS); @@ -798,7 +800,7 @@ void grpc_get_subchannel_address_arg(const grpc_channel_args *args, GPR_ASSERT(addr_arg->type == GRPC_ARG_STRING); memset(addr, 0, sizeof(*addr)); if (*addr_arg->value.string != '\0') { - grpc_uri_to_sockaddr(addr_arg->value.string, addr); + grpc_uri_to_sockaddr(exec_ctx, addr_arg->value.string, addr); } } diff --git a/src/core/ext/client_channel/subchannel.h b/src/core/ext/client_channel/subchannel.h index 684675eb37d..279524bccd0 100644 --- a/src/core/ext/client_channel/subchannel.h +++ b/src/core/ext/client_channel/subchannel.h @@ -175,7 +175,8 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx, const grpc_subchannel_args *args); /// Sets \a addr from \a args. -void grpc_get_subchannel_address_arg(const grpc_channel_args *args, +void grpc_get_subchannel_address_arg(grpc_exec_ctx *exec_ctx, + const grpc_channel_args *args, grpc_resolved_address *addr); /// Returns a new channel arg encoding the subchannel address as a string. diff --git a/src/core/ext/client_channel/uri_parser.c b/src/core/ext/client_channel/uri_parser.c index e521afd0c64..5b3dea8e59f 100644 --- a/src/core/ext/client_channel/uri_parser.c +++ b/src/core/ext/client_channel/uri_parser.c @@ -35,7 +35,6 @@ #include -#include #include #include #include @@ -43,6 +42,8 @@ #include #include "src/core/lib/slice/percent_encoding.h" +#include "src/core/lib/slice/slice_internal.h" +#include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/lib/support/string.h" /** a size_t default value... maps to all 1's */ @@ -70,15 +71,15 @@ static grpc_uri *bad_uri(const char *uri_text, size_t pos, const char *section, } /** Returns a copy of percent decoded \a src[begin, end) */ -static char *decode_and_copy_component(const char *src, size_t begin, - size_t end) { +static char *decode_and_copy_component(grpc_exec_ctx *exec_ctx, const char *src, + size_t begin, size_t end) { grpc_slice component = grpc_slice_from_copied_buffer(src + begin, end - begin); grpc_slice decoded_component = grpc_permissive_percent_decode_slice(component); - char *out = grpc_slice_to_c_string(decoded_component); - grpc_slice_unref(component); - grpc_slice_unref(decoded_component); + char *out = grpc_dump_slice(decoded_component, GPR_DUMP_ASCII); + grpc_slice_unref_internal(exec_ctx, component); + grpc_slice_unref_internal(exec_ctx, decoded_component); return out; } @@ -181,7 +182,8 @@ static void parse_query_parts(grpc_uri *uri) { } } -grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors) { +grpc_uri *grpc_uri_parse(grpc_exec_ctx *exec_ctx, const char *uri_text, + int suppress_errors) { grpc_uri *uri; size_t scheme_begin = 0; size_t scheme_end = NOT_SET; @@ -270,13 +272,16 @@ grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors) { uri = gpr_malloc(sizeof(*uri)); memset(uri, 0, sizeof(*uri)); - uri->scheme = decode_and_copy_component(uri_text, scheme_begin, scheme_end); - uri->authority = - decode_and_copy_component(uri_text, authority_begin, authority_end); - uri->path = decode_and_copy_component(uri_text, path_begin, path_end); - uri->query = decode_and_copy_component(uri_text, query_begin, query_end); - uri->fragment = - decode_and_copy_component(uri_text, fragment_begin, fragment_end); + uri->scheme = + decode_and_copy_component(exec_ctx, uri_text, scheme_begin, scheme_end); + uri->authority = decode_and_copy_component(exec_ctx, uri_text, + authority_begin, authority_end); + uri->path = + decode_and_copy_component(exec_ctx, uri_text, path_begin, path_end); + uri->query = + decode_and_copy_component(exec_ctx, uri_text, query_begin, query_end); + uri->fragment = decode_and_copy_component(exec_ctx, uri_text, fragment_begin, + fragment_end); parse_query_parts(uri); return uri; diff --git a/src/core/ext/client_channel/uri_parser.h b/src/core/ext/client_channel/uri_parser.h index 5fe0e8f35e3..efd4302c1c6 100644 --- a/src/core/ext/client_channel/uri_parser.h +++ b/src/core/ext/client_channel/uri_parser.h @@ -35,6 +35,7 @@ #define GRPC_CORE_EXT_CLIENT_CHANNEL_URI_PARSER_H #include +#include "src/core/lib/iomgr/exec_ctx.h" typedef struct { char *scheme; @@ -51,7 +52,8 @@ typedef struct { } grpc_uri; /** parse a uri, return NULL on failure */ -grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors); +grpc_uri *grpc_uri_parse(grpc_exec_ctx *exec_ctx, const char *uri_text, + int suppress_errors); /** return the part of a query string after the '=' in "?key=xxx&...", or NULL * if key is not present */ diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c index 567e65ac69e..8ccebd7608f 100644 --- a/src/core/ext/lb_policy/grpclb/grpclb.c +++ b/src/core/ext/lb_policy/grpclb/grpclb.c @@ -774,7 +774,7 @@ static grpc_lb_policy *glb_create(grpc_exec_ctx *exec_ctx, arg = grpc_channel_args_find(args->args, GRPC_ARG_SERVER_URI); GPR_ASSERT(arg != NULL); GPR_ASSERT(arg->type == GRPC_ARG_STRING); - grpc_uri *uri = grpc_uri_parse(arg->value.string, true); + grpc_uri *uri = grpc_uri_parse(exec_ctx, arg->value.string, true); GPR_ASSERT(uri->path[0] != '\0'); glb_policy->server_name = gpr_strdup(uri->path[0] == '/' ? uri->path + 1 : uri->path); diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.c b/src/core/ext/transport/chttp2/client/chttp2_connector.c index 013c96dc703..6e262b06540 100644 --- a/src/core/ext/transport/chttp2/client/chttp2_connector.c +++ b/src/core/ext/transport/chttp2/client/chttp2_connector.c @@ -222,7 +222,7 @@ static void chttp2_connector_connect(grpc_exec_ctx *exec_ctx, grpc_closure *notify) { chttp2_connector *c = (chttp2_connector *)con; grpc_resolved_address addr; - grpc_get_subchannel_address_arg(args->channel_args, &addr); + grpc_get_subchannel_address_arg(exec_ctx, args->channel_args, &addr); gpr_mu_lock(&c->mu); GPR_ASSERT(c->notify == NULL); c->notify = notify; diff --git a/src/core/lib/iomgr/tcp_client_posix.c b/src/core/lib/iomgr/tcp_client_posix.c index b40c31a5da3..9a77c92016b 100644 --- a/src/core/lib/iomgr/tcp_client_posix.c +++ b/src/core/lib/iomgr/tcp_client_posix.c @@ -37,9 +37,6 @@ #include "src/core/lib/iomgr/tcp_client_posix.h" -#include "src/core/lib/iomgr/sockaddr.h" -#include "src/core/lib/iomgr/socket_utils_posix.h" - #include #include #include diff --git a/test/core/client_channel/parse_address_test.c b/test/core/client_channel/parse_address_test.c index 79079acb5d1..37dd0fba52c 100644 --- a/test/core/client_channel/parse_address_test.c +++ b/test/core/client_channel/parse_address_test.c @@ -41,13 +41,15 @@ #include +#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/socket_utils.h" #include "test/core/util/test_config.h" #ifdef GRPC_HAVE_UNIX_SOCKET static void test_parse_unix(const char *uri_text, const char *pathname) { - grpc_uri *uri = grpc_uri_parse(uri_text, 0); + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0); grpc_resolved_address addr; GPR_ASSERT(1 == parse_unix(uri, &addr)); @@ -56,6 +58,7 @@ static void test_parse_unix(const char *uri_text, const char *pathname) { GPR_ASSERT(0 == strcmp(addr_un->sun_path, pathname)); grpc_uri_destroy(uri); + grpc_exec_ctx_finish(&exec_ctx); } #else /* GRPC_HAVE_UNIX_SOCKET */ @@ -66,7 +69,8 @@ static void test_parse_unix(const char *uri_text, const char *pathname) {} static void test_parse_ipv4(const char *uri_text, const char *host, unsigned short port) { - grpc_uri *uri = grpc_uri_parse(uri_text, 0); + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0); grpc_resolved_address addr; char ntop_buf[INET_ADDRSTRLEN]; @@ -79,11 +83,13 @@ static void test_parse_ipv4(const char *uri_text, const char *host, GPR_ASSERT(ntohs(addr_in->sin_port) == port); grpc_uri_destroy(uri); + grpc_exec_ctx_finish(&exec_ctx); } static void test_parse_ipv6(const char *uri_text, const char *host, - unsigned short port, u_int32_t scope_id) { - grpc_uri *uri = grpc_uri_parse(uri_text, 0); + unsigned short port, uint32_t scope_id) { + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0); grpc_resolved_address addr; char ntop_buf[INET6_ADDRSTRLEN]; @@ -97,6 +103,7 @@ static void test_parse_ipv6(const char *uri_text, const char *host, GPR_ASSERT(addr_in6->sin6_scope_id == scope_id); grpc_uri_destroy(uri); + grpc_exec_ctx_finish(&exec_ctx); } int main(int argc, char **argv) { diff --git a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c index f0c6843a688..c60ceb38170 100644 --- a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c +++ b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c @@ -66,7 +66,7 @@ static grpc_error *my_resolve_address(const char *name, const char *addr, static grpc_resolver *create_resolver(grpc_exec_ctx *exec_ctx, const char *name) { grpc_resolver_factory *factory = grpc_resolver_factory_lookup("dns"); - grpc_uri *uri = grpc_uri_parse(name, 0); + grpc_uri *uri = grpc_uri_parse(exec_ctx, name, 0); GPR_ASSERT(uri); grpc_resolver_args args; memset(&args, 0, sizeof(args)); diff --git a/test/core/client_channel/resolvers/dns_resolver_test.c b/test/core/client_channel/resolvers/dns_resolver_test.c index 5603a57b5fc..706f3ce6adf 100644 --- a/test/core/client_channel/resolvers/dns_resolver_test.c +++ b/test/core/client_channel/resolvers/dns_resolver_test.c @@ -40,7 +40,7 @@ static void test_succeeds(grpc_resolver_factory *factory, const char *string) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_uri *uri = grpc_uri_parse(string, 0); + grpc_uri *uri = grpc_uri_parse(&exec_ctx, string, 0); grpc_resolver_args args; grpc_resolver *resolver; gpr_log(GPR_DEBUG, "test: '%s' should be valid for '%s'", string, @@ -57,7 +57,7 @@ static void test_succeeds(grpc_resolver_factory *factory, const char *string) { static void test_fails(grpc_resolver_factory *factory, const char *string) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_uri *uri = grpc_uri_parse(string, 0); + grpc_uri *uri = grpc_uri_parse(&exec_ctx, string, 0); grpc_resolver_args args; grpc_resolver *resolver; gpr_log(GPR_DEBUG, "test: '%s' should be invalid for '%s'", string, diff --git a/test/core/client_channel/resolvers/sockaddr_resolver_test.c b/test/core/client_channel/resolvers/sockaddr_resolver_test.c index 10df78537c8..f36f4dd58cd 100644 --- a/test/core/client_channel/resolvers/sockaddr_resolver_test.c +++ b/test/core/client_channel/resolvers/sockaddr_resolver_test.c @@ -54,7 +54,7 @@ void on_resolution_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { static void test_succeeds(grpc_resolver_factory *factory, const char *string) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_uri *uri = grpc_uri_parse(string, 0); + grpc_uri *uri = grpc_uri_parse(&exec_ctx, string, 0); grpc_resolver_args args; grpc_resolver *resolver; gpr_log(GPR_DEBUG, "test: '%s' should be valid for '%s'", string, @@ -80,7 +80,7 @@ static void test_succeeds(grpc_resolver_factory *factory, const char *string) { static void test_fails(grpc_resolver_factory *factory, const char *string) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_uri *uri = grpc_uri_parse(string, 0); + grpc_uri *uri = grpc_uri_parse(&exec_ctx, string, 0); grpc_resolver_args args; grpc_resolver *resolver; gpr_log(GPR_DEBUG, "test: '%s' should be invalid for '%s'", string, diff --git a/test/core/client_channel/uri_fuzzer_test.c b/test/core/client_channel/uri_fuzzer_test.c index d2e3fb40eac..baadd4fc652 100644 --- a/test/core/client_channel/uri_fuzzer_test.c +++ b/test/core/client_channel/uri_fuzzer_test.c @@ -38,6 +38,7 @@ #include #include "src/core/ext/client_channel/uri_parser.h" +#include "src/core/lib/iomgr/exec_ctx.h" bool squelch = true; bool leak_check = true; @@ -47,10 +48,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { memcpy(s, data, size); s[size] = 0; + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_uri *x; - if ((x = grpc_uri_parse(s, 1))) { + if ((x = grpc_uri_parse(&exec_ctx, s, 1))) { grpc_uri_destroy(x); } + grpc_exec_ctx_finish(&exec_ctx); gpr_free(s); return 0; } diff --git a/test/core/client_channel/uri_parser_test.c b/test/core/client_channel/uri_parser_test.c index 489e4ecd518..8a127f72eb7 100644 --- a/test/core/client_channel/uri_parser_test.c +++ b/test/core/client_channel/uri_parser_test.c @@ -37,29 +37,35 @@ #include +#include "src/core/lib/iomgr/exec_ctx.h" #include "test/core/util/test_config.h" static void test_succeeds(const char *uri_text, const char *scheme, const char *authority, const char *path, const char *query, const char *fragment) { - grpc_uri *uri = grpc_uri_parse(uri_text, 0); + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0); GPR_ASSERT(uri); GPR_ASSERT(0 == strcmp(scheme, uri->scheme)); GPR_ASSERT(0 == strcmp(authority, uri->authority)); GPR_ASSERT(0 == strcmp(path, uri->path)); GPR_ASSERT(0 == strcmp(query, uri->query)); GPR_ASSERT(0 == strcmp(fragment, uri->fragment)); + grpc_exec_ctx_finish(&exec_ctx); grpc_uri_destroy(uri); } static void test_fails(const char *uri_text) { - GPR_ASSERT(NULL == grpc_uri_parse(uri_text, 0)); + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GPR_ASSERT(NULL == grpc_uri_parse(&exec_ctx, uri_text, 0)); + grpc_exec_ctx_finish(&exec_ctx); } static void test_query_parts() { { + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; const char *uri_text = "http://foo/path?a&b=B&c=&#frag"; - grpc_uri *uri = grpc_uri_parse(uri_text, 0); + grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0); GPR_ASSERT(uri); GPR_ASSERT(0 == strcmp("http", uri->scheme)); @@ -86,12 +92,14 @@ static void test_query_parts() { GPR_ASSERT(NULL == grpc_uri_get_query_arg(uri, "")); GPR_ASSERT(0 == strcmp("frag", uri->fragment)); + grpc_exec_ctx_finish(&exec_ctx); grpc_uri_destroy(uri); } { /* test the current behavior of multiple query part values */ + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; const char *uri_text = "http://auth/path?foo=bar=baz&foobar=="; - grpc_uri *uri = grpc_uri_parse(uri_text, 0); + grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0); GPR_ASSERT(uri); GPR_ASSERT(0 == strcmp("http", uri->scheme)); @@ -103,12 +111,14 @@ static void test_query_parts() { GPR_ASSERT(0 == strcmp("bar", grpc_uri_get_query_arg(uri, "foo"))); GPR_ASSERT(0 == strcmp("", grpc_uri_get_query_arg(uri, "foobar"))); + grpc_exec_ctx_finish(&exec_ctx); grpc_uri_destroy(uri); } { /* empty query */ + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; const char *uri_text = "http://foo/path"; - grpc_uri *uri = grpc_uri_parse(uri_text, 0); + grpc_uri *uri = grpc_uri_parse(&exec_ctx, uri_text, 0); GPR_ASSERT(uri); GPR_ASSERT(0 == strcmp("http", uri->scheme)); @@ -119,6 +129,7 @@ static void test_query_parts() { GPR_ASSERT(NULL == uri->query_parts); GPR_ASSERT(NULL == uri->query_parts_values); GPR_ASSERT(0 == strcmp("", uri->fragment)); + grpc_exec_ctx_finish(&exec_ctx); grpc_uri_destroy(uri); } } From fd6cc7de7b340ca89f03c291741ca3b1e73cf3a4 Mon Sep 17 00:00:00 2001 From: Ken Payson Date: Thu, 23 Feb 2017 14:25:40 -0800 Subject: [PATCH 06/52] Bump version to v1.1.3 --- CMakeLists.txt | 2 +- Makefile | 4 ++-- build.yaml | 2 +- gRPC-Core.podspec | 2 +- gRPC-ProtoRPC.podspec | 2 +- gRPC-RxLibrary.podspec | 2 +- gRPC.podspec | 2 +- package.json | 2 +- package.xml | 4 ++-- src/cpp/common/version_cc.cc | 2 +- src/csharp/Grpc.Auth/project.json | 4 ++-- src/csharp/Grpc.Core/VersionInfo.cs | 4 ++-- src/csharp/Grpc.Core/project.json | 2 +- src/csharp/Grpc.HealthCheck/project.json | 4 ++-- src/csharp/Grpc.Reflection/project.json | 4 ++-- src/csharp/build_packages_dotnetcli.bat | 2 +- src/csharp/build_packages_dotnetcli.sh | 4 ++-- src/node/health_check/package.json | 4 ++-- src/node/tools/package.json | 2 +- src/objective-c/!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/GRPCClient/private/version.h | 2 +- src/php/composer.json | 2 +- src/python/grpcio/grpc_version.py | 2 +- src/python/grpcio_health_checking/grpc_version.py | 2 +- src/python/grpcio_reflection/grpc_version.py | 2 +- src/python/grpcio_tests/grpc_version.py | 2 +- src/ruby/lib/grpc/version.rb | 2 +- src/ruby/tools/version.rb | 2 +- tools/distrib/python/grpcio_tools/grpc_version.py | 2 +- tools/doxygen/Doxyfile.c++ | 2 +- tools/doxygen/Doxyfile.c++.internal | 2 +- 31 files changed, 39 insertions(+), 39 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6951c33a2fe..7b9975ba466 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ cmake_minimum_required(VERSION 2.8) set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.1.2") +set(PACKAGE_VERSION "1.1.3") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") diff --git a/Makefile b/Makefile index 578a5dd24f3..c0325782991 100644 --- a/Makefile +++ b/Makefile @@ -442,8 +442,8 @@ Q = @ endif CORE_VERSION = 2.0.0 -CPP_VERSION = 1.1.2 -CSHARP_VERSION = 1.1.2 +CPP_VERSION = 1.1.3 +CSHARP_VERSION = 1.1.3 CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) diff --git a/build.yaml b/build.yaml index de1c6de4b9d..d6dde41a8b0 100644 --- a/build.yaml +++ b/build.yaml @@ -14,7 +14,7 @@ settings: '#10': See the expand_version.py for all the quirks here core_version: 2.0.0 g_stands_for: good - version: 1.1.2 + version: 1.1.3 filegroups: - name: census public_headers: diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index aa3472d89b5..b0bcd402fff 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -37,7 +37,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.1.2' + version = '1.1.3' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'http://www.grpc.io' diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 2fb5a4940aa..be4d3cf7c3e 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.1.2' + version = '1.1.3' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'http://www.grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index 104a75c6385..b0946bc8589 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.1.2' + version = '1.1.3' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'http://www.grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index 23d14dfe215..176b66462d7 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -35,7 +35,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.1.2' + version = '1.1.3' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'http://www.grpc.io' diff --git a/package.json b/package.json index 66e2ab0d01c..c38403bf3fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grpc", - "version": "1.1.2", + "version": "1.1.3", "author": "Google Inc.", "description": "gRPC Library for Node", "homepage": "http://www.grpc.io/", diff --git a/package.xml b/package.xml index c96a5efab40..580a15ea967 100644 --- a/package.xml +++ b/package.xml @@ -13,8 +13,8 @@ 2017-01-13 - 1.1.2 - 1.1.2 + 1.1.3 + 1.1.3 beta diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc index fde49766484..6f8c5148743 100644 --- a/src/cpp/common/version_cc.cc +++ b/src/cpp/common/version_cc.cc @@ -37,5 +37,5 @@ #include namespace grpc { -grpc::string Version() { return "1.1.2"; } +grpc::string Version() { return "1.1.3"; } } diff --git a/src/csharp/Grpc.Auth/project.json b/src/csharp/Grpc.Auth/project.json index cb865edf06c..c10d5d36e05 100644 --- a/src/csharp/Grpc.Auth/project.json +++ b/src/csharp/Grpc.Auth/project.json @@ -1,5 +1,5 @@ { - "version": "1.1.2", + "version": "1.1.3", "title": "gRPC C# Auth", "authors": [ "Google Inc." ], "copyright": "Copyright 2015, Google Inc.", @@ -21,7 +21,7 @@ } }, "dependencies": { - "Grpc.Core": "1.1.2", + "Grpc.Core": "1.1.3", "Google.Apis.Auth": "1.16.0" }, "frameworks": { diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs index b6612dc8966..9ecebf39c97 100644 --- a/src/csharp/Grpc.Core/VersionInfo.cs +++ b/src/csharp/Grpc.Core/VersionInfo.cs @@ -48,11 +48,11 @@ namespace Grpc.Core /// /// Current AssemblyFileVersion of gRPC C# assemblies /// - public const string CurrentAssemblyFileVersion = "1.1.2.0"; + public const string CurrentAssemblyFileVersion = "1.1.3.0"; /// /// Current version of gRPC C# /// - public const string CurrentVersion = "1.1.2"; + public const string CurrentVersion = "1.1.3"; } } diff --git a/src/csharp/Grpc.Core/project.json b/src/csharp/Grpc.Core/project.json index 9bcda4529d1..f33d87f923b 100644 --- a/src/csharp/Grpc.Core/project.json +++ b/src/csharp/Grpc.Core/project.json @@ -1,5 +1,5 @@ { - "version": "1.1.2", + "version": "1.1.3", "title": "gRPC C# Core", "authors": [ "Google Inc." ], "copyright": "Copyright 2015, Google Inc.", diff --git a/src/csharp/Grpc.HealthCheck/project.json b/src/csharp/Grpc.HealthCheck/project.json index dd5f109641a..7789097c7ac 100644 --- a/src/csharp/Grpc.HealthCheck/project.json +++ b/src/csharp/Grpc.HealthCheck/project.json @@ -1,5 +1,5 @@ { - "version": "1.1.2", + "version": "1.1.3", "title": "gRPC C# Healthchecking", "authors": [ "Google Inc." ], "copyright": "Copyright 2015, Google Inc.", @@ -21,7 +21,7 @@ } }, "dependencies": { - "Grpc.Core": "1.1.2", + "Grpc.Core": "1.1.3", "Google.Protobuf": "3.0.0" }, "frameworks": { diff --git a/src/csharp/Grpc.Reflection/project.json b/src/csharp/Grpc.Reflection/project.json index ee951cf3c2c..5a9964b8382 100644 --- a/src/csharp/Grpc.Reflection/project.json +++ b/src/csharp/Grpc.Reflection/project.json @@ -1,5 +1,5 @@ { - "version": "1.1.2", + "version": "1.1.3", "title": "gRPC C# Reflection", "authors": [ "Google Inc." ], "copyright": "Copyright 2016, Google Inc.", @@ -21,7 +21,7 @@ } }, "dependencies": { - "Grpc.Core": "1.1.2", + "Grpc.Core": "1.1.3", "Google.Protobuf": "3.0.0" }, "frameworks": { diff --git a/src/csharp/build_packages_dotnetcli.bat b/src/csharp/build_packages_dotnetcli.bat index fac14193773..22b9d8035aa 100755 --- a/src/csharp/build_packages_dotnetcli.bat +++ b/src/csharp/build_packages_dotnetcli.bat @@ -28,7 +28,7 @@ @rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @rem Current package versions -set VERSION=1.1.2 +set VERSION=1.1.3 set PROTOBUF_VERSION=3.0.0 @rem Adjust the location of nuget.exe diff --git a/src/csharp/build_packages_dotnetcli.sh b/src/csharp/build_packages_dotnetcli.sh index 03f53af51c0..9d3ac9493a3 100755 --- a/src/csharp/build_packages_dotnetcli.sh +++ b/src/csharp/build_packages_dotnetcli.sh @@ -65,7 +65,7 @@ dotnet pack --configuration Release Grpc.Auth/project.json --output ../../artifa dotnet pack --configuration Release Grpc.HealthCheck/project.json --output ../../artifacts dotnet pack --configuration Release Grpc.Reflection/project.json --output ../../artifacts -nuget pack Grpc.nuspec -Version "1.1.2" -OutputDirectory ../../artifacts -nuget pack Grpc.Tools.nuspec -Version "1.1.2" -OutputDirectory ../../artifacts +nuget pack Grpc.nuspec -Version "1.1.3" -OutputDirectory ../../artifacts +nuget pack Grpc.Tools.nuspec -Version "1.1.3" -OutputDirectory ../../artifacts (cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg) diff --git a/src/node/health_check/package.json b/src/node/health_check/package.json index 812f4956975..54c119f6b89 100644 --- a/src/node/health_check/package.json +++ b/src/node/health_check/package.json @@ -1,6 +1,6 @@ { "name": "grpc-health-check", - "version": "1.1.2", + "version": "1.1.3", "author": "Google Inc.", "description": "Health check service for use with gRPC", "repository": { @@ -15,7 +15,7 @@ } ], "dependencies": { - "grpc": "^1.1.2", + "grpc": "^1.1.3", "lodash": "^3.9.3", "google-protobuf": "^3.0.0" }, diff --git a/src/node/tools/package.json b/src/node/tools/package.json index 650b06e6afd..ff4b6172e7b 100644 --- a/src/node/tools/package.json +++ b/src/node/tools/package.json @@ -1,6 +1,6 @@ { "name": "grpc-tools", - "version": "1.1.2", + "version": "1.1.3", "author": "Google Inc.", "description": "Tools for developing with gRPC on Node.js", "homepage": "http://www.grpc.io/", diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 8d6c408dce2..6cc4f289a8f 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.1.2' + v = '1.1.3' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index f7e96044fc6..20278ea7f87 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -38,4 +38,4 @@ // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.1.2" +#define GRPC_OBJC_VERSION_STRING @"1.1.3" diff --git a/src/php/composer.json b/src/php/composer.json index faf2049e753..8993313376a 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -5,7 +5,7 @@ "keywords": ["rpc"], "homepage": "http://grpc.io", "license": "BSD-3-Clause", - "version": "1.1.2", + "version": "1.1.3", "require": { "php": ">=5.5.0", "ext-grpc": "*", diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index 7e57e072359..bd5d9f46b48 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION='1.1.2' +VERSION='1.1.3' diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py index 5d63397972c..a39a89ad3cf 100644 --- a/src/python/grpcio_health_checking/grpc_version.py +++ b/src/python/grpcio_health_checking/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! -VERSION='1.1.2' +VERSION='1.1.3' diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py index 495f354191a..08d0b690637 100644 --- a/src/python/grpcio_reflection/grpc_version.py +++ b/src/python/grpcio_reflection/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! -VERSION='1.1.2' +VERSION='1.1.3' diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py index b441b109292..d7dca23a459 100644 --- a/src/python/grpcio_tests/grpc_version.py +++ b/src/python/grpcio_tests/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! -VERSION='1.1.2' +VERSION='1.1.3' diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 79c4a96bd45..b8c61f378be 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -29,5 +29,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '1.1.2' + VERSION = '1.1.3' end diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb index 85ae9fdbc00..acbec89e873 100644 --- a/src/ruby/tools/version.rb +++ b/src/ruby/tools/version.rb @@ -29,6 +29,6 @@ module GRPC module Tools - VERSION = '1.1.2' + VERSION = '1.1.3' end end diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index d0ee8a07d0a..82d976bebe4 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION='1.1.2' +VERSION='1.1.3' diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index bb7da0ae95f..f445dd2ffc0 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.1.2 +PROJECT_NUMBER = 1.1.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index caba0b23c4a..3b7583ffaa6 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.1.2 +PROJECT_NUMBER = 1.1.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From 67661503438308ac514cf177d33ab437ea8ee692 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 27 Feb 2017 19:04:30 +0100 Subject: [PATCH 07/52] add script for running "latest released" benchmarks --- .../jenkins/run_full_performance_released.sh | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 tools/jenkins/run_full_performance_released.sh diff --git a/tools/jenkins/run_full_performance_released.sh b/tools/jenkins/run_full_performance_released.sh new file mode 100755 index 00000000000..ae2289e32c9 --- /dev/null +++ b/tools/jenkins/run_full_performance_released.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +# Copyright 2017, 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. +# +# A frozen version of run_full_performance.sh that runs full performance test +# suite for the latest released stable version of gRPC. +set -ex + +# Enter the gRPC repo root +cd $(dirname $0)/../.. + +# run 8core client vs 8core server +tools/run_tests/run_performance_tests.py \ + -l c++ csharp node ruby java python go node_express \ + --netperf \ + --category scalable \ + --bq_result_table performance_released.performance_experiment \ + --remote_worker_host grpc-performance-server-8core grpc-performance-client-8core grpc-performance-client2-8core \ + --xml_report report_8core.xml \ + || EXIT_CODE=1 + +# prevent pushing leftover build files to remote hosts in the next step. +git clean -fdxq --exclude='report*.xml' + +# scalability with 32cores (and upload to a different BQ table) +tools/run_tests/run_performance_tests.py \ + -l c++ java csharp go \ + --netperf \ + --category scalable \ + --bq_result_table performance_released.performance_experiment_32core \ + --remote_worker_host grpc-performance-server-32core grpc-performance-client-32core grpc-performance-client2-32core \ + --xml_report report_32core.xml \ + || EXIT_CODE=1 + +# prevent pushing leftover build files to remote hosts in the next step. +git clean -fdxq --exclude='report*.xml' + +# selected scenarios on Windows +tools/run_tests/run_performance_tests.py \ + -l csharp \ + --category scalable \ + --bq_result_table performance_released.performance_experiment_windows \ + --remote_worker_host grpc-performance-windows1 grpc-performance-windows2 \ + --xml_report report_windows.xml \ + || EXIT_CODE=1 + +exit $EXIT_CODE From 255d002f92ed1ef1089b485f83eace650d17ac95 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 28 Feb 2017 16:14:40 -0800 Subject: [PATCH 08/52] Relieve ios deployment version to 7.0 --- gRPC-Core.podspec | 2 +- gRPC-ProtoRPC.podspec | 2 +- gRPC-RxLibrary.podspec | 2 +- gRPC.podspec | 2 +- src/objective-c/!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/!ProtoCompiler.podspec | 2 +- templates/gRPC-Core.podspec.template | 2 +- templates/gRPC-ProtoRPC.podspec.template | 2 +- templates/gRPC-RxLibrary.podspec.template | 2 +- templates/gRPC.podspec.template | 2 +- .../src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index b0bcd402fff..8ab072f29cf 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -51,7 +51,7 @@ Pod::Spec.new do |s| :submodules => true, } - s.ios.deployment_target = '7.1' + s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' s.requires_arc = false diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index be4d3cf7c3e..cc6e31f7cf0 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -48,7 +48,7 @@ Pod::Spec.new do |s| :tag => "v#{version}", } - s.ios.deployment_target = '7.1' + s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' name = 'ProtoRPC' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index b0946bc8589..5b8558ebcd2 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -48,7 +48,7 @@ Pod::Spec.new do |s| :tag => "v#{version}", } - s.ios.deployment_target = '7.1' + s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' name = 'RxLibrary' diff --git a/gRPC.podspec b/gRPC.podspec index 176b66462d7..cdef59c5748 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -47,7 +47,7 @@ Pod::Spec.new do |s| :tag => "v#{version}", } - s.ios.deployment_target = '7.1' + s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' name = 'GRPCClient' diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 6cc4f289a8f..e64762b726a 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -103,7 +103,7 @@ Pod::Spec.new do |s| # Restrict the protoc version to the one supported by this plugin. s.dependency '!ProtoCompiler', '3.1.0' # For the Protobuf dependency not to complain: - s.ios.deployment_target = '7.1' + s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' # Restrict the gRPC runtime version to the one supported by this plugin. s.dependency 'gRPC-ProtoRPC', v diff --git a/src/objective-c/!ProtoCompiler.podspec b/src/objective-c/!ProtoCompiler.podspec index dc4d8e964e6..bbff57ba77d 100644 --- a/src/objective-c/!ProtoCompiler.podspec +++ b/src/objective-c/!ProtoCompiler.podspec @@ -110,7 +110,7 @@ Pod::Spec.new do |s| # Restrict the protobuf runtime version to the one supported by this version of protoc. s.dependency 'Protobuf', '~> 3.0' # For the Protobuf dependency not to complain: - s.ios.deployment_target = '7.1' + s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' # This is only for local development of protoc: If the Podfile brings this pod from a local diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template index 66b36593099..5b1f0630bfc 100644 --- a/templates/gRPC-Core.podspec.template +++ b/templates/gRPC-Core.podspec.template @@ -78,7 +78,7 @@ :submodules => true, } - s.ios.deployment_target = '7.1' + s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' s.requires_arc = false diff --git a/templates/gRPC-ProtoRPC.podspec.template b/templates/gRPC-ProtoRPC.podspec.template index 5d7d90d2318..47b22dd2a52 100644 --- a/templates/gRPC-ProtoRPC.podspec.template +++ b/templates/gRPC-ProtoRPC.podspec.template @@ -50,7 +50,7 @@ :tag => "v#{version}", } - s.ios.deployment_target = '7.1' + s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' name = 'ProtoRPC' diff --git a/templates/gRPC-RxLibrary.podspec.template b/templates/gRPC-RxLibrary.podspec.template index 35a06c8a856..48f0df8f9e6 100644 --- a/templates/gRPC-RxLibrary.podspec.template +++ b/templates/gRPC-RxLibrary.podspec.template @@ -50,7 +50,7 @@ :tag => "v#{version}", } - s.ios.deployment_target = '7.1' + s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' name = 'RxLibrary' diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template index d33ce277dc3..ce473608dd8 100644 --- a/templates/gRPC.podspec.template +++ b/templates/gRPC.podspec.template @@ -49,7 +49,7 @@ :tag => "v#{version}", } - s.ios.deployment_target = '7.1' + s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' name = 'GRPCClient' diff --git a/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template b/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template index 3a10cfab3cc..b100fa7cfe1 100644 --- a/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template +++ b/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template @@ -105,7 +105,7 @@ # Restrict the protoc version to the one supported by this plugin. s.dependency '!ProtoCompiler', '3.1.0' # For the Protobuf dependency not to complain: - s.ios.deployment_target = '7.1' + s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' # Restrict the gRPC runtime version to the one supported by this plugin. s.dependency 'gRPC-ProtoRPC', v From 48bc4767db7c91f4fc8e7c14323b8aa1ef9418f9 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 28 Feb 2017 16:18:57 -0800 Subject: [PATCH 09/52] Eliminate cancellation if we never sent an op down --- src/core/lib/surface/call.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index cc57654ea41..c2547c5147a 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -161,6 +161,7 @@ struct grpc_call { bool receiving_message; bool requested_final_op; bool received_final_op; + bool sent_any_op; /* have we received initial metadata */ bool has_initial_md_been_received; @@ -488,7 +489,7 @@ void grpc_call_destroy(grpc_call *c) { gpr_mu_lock(&c->mu); GPR_ASSERT(!c->destroy_called); c->destroy_called = 1; - cancel = !c->received_final_op; + cancel = c->sent_any_op && !c->received_final_op; gpr_mu_unlock(&c->mu); if (cancel) { cancel_with_error(&exec_ctx, c, STATUS_FROM_API_OVERRIDE, @@ -1678,6 +1679,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, grpc_closure_init(&bctl->finish_batch, finish_batch, bctl, grpc_schedule_on_exec_ctx); stream_op->on_complete = &bctl->finish_batch; + call->sent_any_op = true; gpr_mu_unlock(&call->mu); execute_op(exec_ctx, call, stream_op); From 295df6da9aa8f6a51cd050ddf92f047d9179d9f2 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 1 Mar 2017 11:28:24 -0800 Subject: [PATCH 10/52] Add a slice type that shares a refcount with a transport stream --- CMakeLists.txt | 28 +++ Makefile | 36 ++++ build.yaml | 10 + src/core/lib/support/sync.c | 8 +- src/core/lib/transport/transport.c | 35 +++ src/core/lib/transport/transport.h | 6 + .../clusterfuzz-testcase-6520142139752448 | Bin 0 -> 384 bytes test/core/transport/BUILD | 7 + test/core/transport/stream_owned_slice_test.c | 58 +++++ test/cpp/microbenchmarks/bm_metadata.cc | 15 ++ .../generated/sources_and_headers.json | 17 ++ tools/run_tests/generated/tests.json | 44 ++++ vsprojects/buildtests_c.sln | 27 +++ .../stream_owned_slice_test.vcxproj | 199 ++++++++++++++++++ .../stream_owned_slice_test.vcxproj.filters | 21 ++ 15 files changed, 510 insertions(+), 1 deletion(-) create mode 100644 test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-6520142139752448 create mode 100644 test/core/transport/stream_owned_slice_test.c create mode 100644 vsprojects/vcxproj/test/stream_owned_slice_test/stream_owned_slice_test.vcxproj create mode 100644 vsprojects/vcxproj/test/stream_owned_slice_test/stream_owned_slice_test.vcxproj.filters diff --git a/CMakeLists.txt b/CMakeLists.txt index 94d578eebda..6d62c483803 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -464,6 +464,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_c socket_utils_test) endif() add_dependencies(buildtests_c status_conversion_test) +add_dependencies(buildtests_c stream_owned_slice_test) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_c tcp_client_posix_test) endif() @@ -6933,6 +6934,33 @@ target_link_libraries(status_conversion_test gpr ) +endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_TESTS) + +add_executable(stream_owned_slice_test + test/core/transport/stream_owned_slice_test.c +) + + +target_include_directories(stream_owned_slice_test + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${BORINGSSL_ROOT_DIR}/include + PRIVATE ${PROTOBUF_ROOT_DIR}/src + PRIVATE ${BENCHMARK_ROOT_DIR}/include + PRIVATE ${ZLIB_ROOT_DIR} + PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib + PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include +) + +target_link_libraries(stream_owned_slice_test + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc_test_util + grpc + gpr_test_util + gpr +) + endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) diff --git a/Makefile b/Makefile index 57e877beb01..32ee660aaab 100644 --- a/Makefile +++ b/Makefile @@ -1024,6 +1024,7 @@ sockaddr_utils_test: $(BINDIR)/$(CONFIG)/sockaddr_utils_test socket_utils_test: $(BINDIR)/$(CONFIG)/socket_utils_test ssl_server_fuzzer: $(BINDIR)/$(CONFIG)/ssl_server_fuzzer status_conversion_test: $(BINDIR)/$(CONFIG)/status_conversion_test +stream_owned_slice_test: $(BINDIR)/$(CONFIG)/stream_owned_slice_test tcp_client_posix_test: $(BINDIR)/$(CONFIG)/tcp_client_posix_test tcp_client_uv_test: $(BINDIR)/$(CONFIG)/tcp_client_uv_test tcp_posix_test: $(BINDIR)/$(CONFIG)/tcp_posix_test @@ -1378,6 +1379,7 @@ buildtests_c: privatelibs_c \ $(BINDIR)/$(CONFIG)/sockaddr_utils_test \ $(BINDIR)/$(CONFIG)/socket_utils_test \ $(BINDIR)/$(CONFIG)/status_conversion_test \ + $(BINDIR)/$(CONFIG)/stream_owned_slice_test \ $(BINDIR)/$(CONFIG)/tcp_client_posix_test \ $(BINDIR)/$(CONFIG)/tcp_client_uv_test \ $(BINDIR)/$(CONFIG)/tcp_posix_test \ @@ -1829,6 +1831,8 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/socket_utils_test || ( echo test socket_utils_test failed ; exit 1 ) $(E) "[RUN] Testing status_conversion_test" $(Q) $(BINDIR)/$(CONFIG)/status_conversion_test || ( echo test status_conversion_test failed ; exit 1 ) + $(E) "[RUN] Testing stream_owned_slice_test" + $(Q) $(BINDIR)/$(CONFIG)/stream_owned_slice_test || ( echo test stream_owned_slice_test failed ; exit 1 ) $(E) "[RUN] Testing tcp_client_posix_test" $(Q) $(BINDIR)/$(CONFIG)/tcp_client_posix_test || ( echo test tcp_client_posix_test failed ; exit 1 ) $(E) "[RUN] Testing tcp_client_uv_test" @@ -11787,6 +11791,38 @@ endif endif +STREAM_OWNED_SLICE_TEST_SRC = \ + test/core/transport/stream_owned_slice_test.c \ + +STREAM_OWNED_SLICE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(STREAM_OWNED_SLICE_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/stream_owned_slice_test: openssl_dep_error + +else + + + +$(BINDIR)/$(CONFIG)/stream_owned_slice_test: $(STREAM_OWNED_SLICE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LD) $(LDFLAGS) $(STREAM_OWNED_SLICE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/stream_owned_slice_test + +endif + +$(OBJDIR)/$(CONFIG)/test/core/transport/stream_owned_slice_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_stream_owned_slice_test: $(STREAM_OWNED_SLICE_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(STREAM_OWNED_SLICE_TEST_OBJS:.o=.dep) +endif +endif + + TCP_CLIENT_POSIX_TEST_SRC = \ test/core/iomgr/tcp_client_posix_test.c \ diff --git a/build.yaml b/build.yaml index 9ff37d59e17..cfbcd595820 100644 --- a/build.yaml +++ b/build.yaml @@ -2750,6 +2750,16 @@ targets: - grpc - gpr_test_util - gpr +- name: stream_owned_slice_test + build: test + language: c + src: + - test/core/transport/stream_owned_slice_test.c + deps: + - grpc_test_util + - grpc + - gpr_test_util + - gpr - name: tcp_client_posix_test cpu_cost: 0.5 build: test diff --git a/src/core/lib/support/sync.c b/src/core/lib/support/sync.c index 44b83f8175a..e4a7fce646b 100644 --- a/src/core/lib/support/sync.c +++ b/src/core/lib/support/sync.c @@ -37,6 +37,8 @@ #include #include +#include + /* Number of mutexes to allocate for events, to avoid lock contention. Should be a prime. */ enum { event_sync_partitions = 31 }; @@ -99,8 +101,12 @@ void gpr_ref_init(gpr_refcount *r, int n) { gpr_atm_rel_store(&r->count, n); } void gpr_ref(gpr_refcount *r) { gpr_atm_no_barrier_fetch_add(&r->count, 1); } void gpr_ref_non_zero(gpr_refcount *r) { +#ifndef NDEBUG gpr_atm prior = gpr_atm_no_barrier_fetch_add(&r->count, 1); - GPR_ASSERT(prior > 0); + assert(prior > 0); +#else + gpr_ref(r); +#endif } void gpr_refn(gpr_refcount *r, int n) { diff --git a/src/core/lib/transport/transport.c b/src/core/lib/transport/transport.c index 004e748f251..165950e288e 100644 --- a/src/core/lib/transport/transport.c +++ b/src/core/lib/transport/transport.c @@ -84,6 +84,39 @@ void grpc_stream_unref(grpc_exec_ctx *exec_ctx, } } +#define STREAM_REF_FROM_SLICE_REF(p) \ + ((grpc_stream_refcount *)(((uint8_t *)p) - \ + offsetof(grpc_stream_refcount, slice_refcount))) + +static void slice_stream_ref(void *p) { +#ifdef GRPC_STREAM_REFCOUNT_DEBUG + grpc_stream_ref(STREAM_REF_FROM_SLICE_REF(p), "slice"); +#else + grpc_stream_ref(STREAM_REF_FROM_SLICE_REF(p)); +#endif +} + +static void slice_stream_unref(grpc_exec_ctx *exec_ctx, void *p) { +#ifdef GRPC_STREAM_REFCOUNT_DEBUG + grpc_stream_unref(exec_ctx, STREAM_REF_FROM_SLICE_REF(p), "slice"); +#else + grpc_stream_unref(exec_ctx, STREAM_REF_FROM_SLICE_REF(p)); +#endif +} + +grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount *refcount, + void *buffer, size_t length) { + slice_stream_ref(&refcount->slice_refcount); + return (grpc_slice){.refcount = &refcount->slice_refcount, + .data.refcounted = {.bytes = buffer, .length = length}}; +} + +static const grpc_slice_refcount_vtable stream_ref_slice_vtable = { + .ref = slice_stream_ref, + .unref = slice_stream_unref, + .eq = grpc_slice_default_eq_impl, + .hash = grpc_slice_default_hash_impl}; + #ifdef GRPC_STREAM_REFCOUNT_DEBUG void grpc_stream_ref_init(grpc_stream_refcount *refcount, int initial_refs, grpc_iomgr_cb_func cb, void *cb_arg, @@ -95,6 +128,8 @@ void grpc_stream_ref_init(grpc_stream_refcount *refcount, int initial_refs, #endif gpr_ref_init(&refcount->refs, initial_refs); grpc_closure_init(&refcount->destroy, cb, cb_arg, grpc_schedule_on_exec_ctx); + refcount->slice_refcount.vtable = &stream_ref_slice_vtable; + refcount->slice_refcount.sub_refcount = &refcount->slice_refcount; } static void move64(uint64_t *from, uint64_t *to) { diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h index bb23c0225aa..cc1c277b355 100644 --- a/src/core/lib/transport/transport.h +++ b/src/core/lib/transport/transport.h @@ -64,6 +64,7 @@ typedef struct grpc_stream_refcount { #ifdef GRPC_STREAM_REFCOUNT_DEBUG const char *object_type; #endif + grpc_slice_refcount slice_refcount; } grpc_stream_refcount; #ifdef GRPC_STREAM_REFCOUNT_DEBUG @@ -84,6 +85,11 @@ void grpc_stream_unref(grpc_exec_ctx *exec_ctx, grpc_stream_refcount *refcount); grpc_stream_ref_init(rc, ir, cb, cb_arg) #endif +/* Wrap a buffer that is owned by some stream object into a slice that shares + the same refcount */ +grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount *refcount, + void *buffer, size_t length); + typedef struct { uint64_t framing_bytes; uint64_t data_bytes; diff --git a/test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-6520142139752448 b/test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-6520142139752448 new file mode 100644 index 0000000000000000000000000000000000000000..49c02c2f12303ba10ea49e020324897a6156cb2f GIT binary patch literal 384 zcmZQzVPIl_07gazAt6RaMlQyTl9B>O#?K2xkwD{4pcEJ|Ffb-E09im?5G~9=Eg + +static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {} + +int main(int argc, char **argv) { + grpc_test_init(argc, argv); + + uint8_t buffer[] = "abc123"; + grpc_stream_refcount r; + GRPC_STREAM_REF_INIT(&r, 1, do_nothing, NULL, "test"); + GPR_ASSERT(r.refs.count == 1); + grpc_slice slice = + grpc_slice_from_stream_owned_buffer(&r, buffer, sizeof(buffer)); + GPR_ASSERT(GRPC_SLICE_START_PTR(slice) == buffer); + GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == sizeof(buffer)); + GPR_ASSERT(r.refs.count == 2); + grpc_slice_unref(slice); + GPR_ASSERT(r.refs.count == 1); + + return 0; +} diff --git a/test/cpp/microbenchmarks/bm_metadata.cc b/test/cpp/microbenchmarks/bm_metadata.cc index 7f81fbabcc1..f4686908342 100644 --- a/test/cpp/microbenchmarks/bm_metadata.cc +++ b/test/cpp/microbenchmarks/bm_metadata.cc @@ -36,8 +36,10 @@ #include extern "C" { +#include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/transport/metadata.h" #include "src/core/lib/transport/static_metadata.h" +#include "src/core/lib/transport/transport.h" } #include "third_party/benchmark/include/benchmark/benchmark.h" @@ -62,6 +64,19 @@ static void BM_SliceFromCopied(benchmark::State& state) { } BENCHMARK(BM_SliceFromCopied); +static void BM_SliceFromStreamOwnedBuffer(benchmark::State& state) { + grpc_stream_refcount r; + GRPC_STREAM_REF_INIT(&r, 1, NULL, NULL, "test"); + char buffer[64]; + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + while (state.KeepRunning()) { + grpc_slice_unref_internal(&exec_ctx, grpc_slice_from_stream_owned_buffer( + &r, buffer, sizeof(buffer))); + } + grpc_exec_ctx_finish(&exec_ctx); +} +BENCHMARK(BM_SliceFromStreamOwnedBuffer); + static void BM_SliceIntern(benchmark::State& state) { gpr_slice slice = grpc_slice_from_static_string("abc"); while (state.KeepRunning()) { diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 15bcf5621e3..fed1b8ceb71 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -2032,6 +2032,23 @@ "third_party": false, "type": "target" }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "is_filegroup": false, + "language": "c", + "name": "stream_owned_slice_test", + "src": [ + "test/core/transport/stream_owned_slice_test.c" + ], + "third_party": false, + "type": "target" + }, { "deps": [ "gpr", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index eca65ac5334..5d9b2665a75 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -2115,6 +2115,28 @@ "windows" ] }, + { + "args": [], + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": false, + "language": "c", + "name": "stream_owned_slice_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ] + }, { "args": [], "ci_platforms": [ @@ -80536,6 +80558,28 @@ ], "uses_polling": false }, + { + "args": [ + "test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-6520142139752448" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [ + "tsan" + ], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "api_fuzzer_one_entry", + "platforms": [ + "linux" + ], + "uses_polling": false + }, { "args": [ "test/core/end2end/fuzzers/api_fuzzer_corpus/crash-0597bbdd657fa4ed14443994c9147a1a7bbc205f" diff --git a/vsprojects/buildtests_c.sln b/vsprojects/buildtests_c.sln index 623de48d3e7..1a22274f986 100644 --- a/vsprojects/buildtests_c.sln +++ b/vsprojects/buildtests_c.sln @@ -1454,6 +1454,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "status_conversion_test", "v {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stream_owned_slice_test", "vcxproj\test\stream_owned_slice_test\stream_owned_slice_test.vcxproj", "{D5A20C05-D9B2-970B-8429-94BC3F58D1C4}" + ProjectSection(myProperties) = preProject + lib = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} = {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} + {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} + {EAB0A629-17A9-44DB-B5FF-E91A721FE037} = {EAB0A629-17A9-44DB-B5FF-E91A721FE037} + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tcp_client_uv_test", "vcxproj\test\tcp_client_uv_test\tcp_client_uv_test.vcxproj", "{9814D850-F3BB-8C7A-4C78-2751C1E272F4}" ProjectSection(myProperties) = preProject lib = "False" @@ -3787,6 +3798,22 @@ Global {21E2A241-9D48-02CD-92E4-4EEC98424CF5}.Release-DLL|Win32.Build.0 = Release|Win32 {21E2A241-9D48-02CD-92E4-4EEC98424CF5}.Release-DLL|x64.ActiveCfg = Release|x64 {21E2A241-9D48-02CD-92E4-4EEC98424CF5}.Release-DLL|x64.Build.0 = Release|x64 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Debug|Win32.ActiveCfg = Debug|Win32 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Debug|x64.ActiveCfg = Debug|x64 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Release|Win32.ActiveCfg = Release|Win32 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Release|x64.ActiveCfg = Release|x64 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Debug|Win32.Build.0 = Debug|Win32 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Debug|x64.Build.0 = Debug|x64 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Release|Win32.Build.0 = Release|Win32 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Release|x64.Build.0 = Release|x64 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Debug-DLL|Win32.Build.0 = Debug|Win32 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Debug-DLL|x64.ActiveCfg = Debug|x64 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Debug-DLL|x64.Build.0 = Debug|x64 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Release-DLL|Win32.ActiveCfg = Release|Win32 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Release-DLL|Win32.Build.0 = Release|Win32 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Release-DLL|x64.ActiveCfg = Release|x64 + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4}.Release-DLL|x64.Build.0 = Release|x64 {9814D850-F3BB-8C7A-4C78-2751C1E272F4}.Debug|Win32.ActiveCfg = Debug|Win32 {9814D850-F3BB-8C7A-4C78-2751C1E272F4}.Debug|x64.ActiveCfg = Debug|x64 {9814D850-F3BB-8C7A-4C78-2751C1E272F4}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/vsprojects/vcxproj/test/stream_owned_slice_test/stream_owned_slice_test.vcxproj b/vsprojects/vcxproj/test/stream_owned_slice_test/stream_owned_slice_test.vcxproj new file mode 100644 index 00000000000..09279e325da --- /dev/null +++ b/vsprojects/vcxproj/test/stream_owned_slice_test/stream_owned_slice_test.vcxproj @@ -0,0 +1,199 @@ + + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {D5A20C05-D9B2-970B-8429-94BC3F58D1C4} + true + $(SolutionDir)IntDir\$(MSBuildProjectName)\ + + + + v100 + + + v110 + + + v120 + + + v140 + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + stream_owned_slice_test + static + Debug + static + Debug + + + stream_owned_slice_test + static + Release + static + Release + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + true + None + false + + + Console + true + false + + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + true + None + false + + + Console + true + false + + + + + + NotUsing + Level3 + MaxSpeed + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + true + MultiThreaded + true + None + false + + + Console + true + false + true + true + + + + + + NotUsing + Level3 + MaxSpeed + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + true + MultiThreaded + true + None + false + + + Console + true + false + true + true + + + + + + + + + + {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} + + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + + + {EAB0A629-17A9-44DB-B5FF-E91A721FE037} + + + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + diff --git a/vsprojects/vcxproj/test/stream_owned_slice_test/stream_owned_slice_test.vcxproj.filters b/vsprojects/vcxproj/test/stream_owned_slice_test/stream_owned_slice_test.vcxproj.filters new file mode 100644 index 00000000000..9a412021972 --- /dev/null +++ b/vsprojects/vcxproj/test/stream_owned_slice_test/stream_owned_slice_test.vcxproj.filters @@ -0,0 +1,21 @@ + + + + + test\core\transport + + + + + + {5606d0c3-ce6d-0d92-aaa6-4cba3360af30} + + + {c89700dc-cc90-bd03-00e7-36ee75d20c07} + + + {faebe48f-9338-a5a4-439d-9f307d0b843b} + + + + From 5c2d7e287bb8b560218c184de0afd7efaf8f7059 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 1 Mar 2017 15:31:31 -0800 Subject: [PATCH 11/52] Boost grpc version to v1.1.4 --- CMakeLists.txt | 2 +- Makefile | 4 ++-- build.yaml | 2 +- gRPC-Core.podspec | 2 +- gRPC-ProtoRPC.podspec | 2 +- gRPC-RxLibrary.podspec | 2 +- gRPC.podspec | 2 +- package.json | 2 +- package.xml | 4 ++-- src/cpp/common/version_cc.cc | 2 +- src/csharp/Grpc.Auth/project.json | 4 ++-- src/csharp/Grpc.Core/VersionInfo.cs | 4 ++-- src/csharp/Grpc.Core/project.json | 2 +- src/csharp/Grpc.HealthCheck/project.json | 4 ++-- src/csharp/Grpc.Reflection/project.json | 4 ++-- src/csharp/build_packages_dotnetcli.bat | 2 +- src/csharp/build_packages_dotnetcli.sh | 4 ++-- src/node/health_check/package.json | 4 ++-- src/node/tools/package.json | 2 +- src/objective-c/!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/GRPCClient/private/version.h | 2 +- src/php/composer.json | 2 +- src/python/grpcio/grpc_version.py | 2 +- src/python/grpcio_health_checking/grpc_version.py | 2 +- src/python/grpcio_reflection/grpc_version.py | 2 +- src/python/grpcio_tests/grpc_version.py | 2 +- src/ruby/lib/grpc/version.rb | 2 +- src/ruby/tools/version.rb | 2 +- tools/distrib/python/grpcio_tools/grpc_version.py | 2 +- tools/doxygen/Doxyfile.c++ | 2 +- tools/doxygen/Doxyfile.c++.internal | 2 +- 31 files changed, 39 insertions(+), 39 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a9796ef17e..f45919dcd14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ cmake_minimum_required(VERSION 2.8) set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.1.3") +set(PACKAGE_VERSION "1.1.4") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") diff --git a/Makefile b/Makefile index 354d57645ca..7283996dd13 100644 --- a/Makefile +++ b/Makefile @@ -442,8 +442,8 @@ Q = @ endif CORE_VERSION = 2.0.0 -CPP_VERSION = 1.1.3 -CSHARP_VERSION = 1.1.3 +CPP_VERSION = 1.1.4 +CSHARP_VERSION = 1.1.4 CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) diff --git a/build.yaml b/build.yaml index 611130ab1e7..b0590c26ffe 100644 --- a/build.yaml +++ b/build.yaml @@ -14,7 +14,7 @@ settings: '#10': See the expand_version.py for all the quirks here core_version: 2.0.0 g_stands_for: good - version: 1.1.3 + version: 1.1.4 filegroups: - name: census public_headers: diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 8ab072f29cf..1275a775840 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -37,7 +37,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.1.3' + version = '1.1.4' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'http://www.grpc.io' diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index cc6e31f7cf0..a2aa6a25add 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.1.3' + version = '1.1.4' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'http://www.grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index 5b8558ebcd2..a8a3f7f7690 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.1.3' + version = '1.1.4' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'http://www.grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index cdef59c5748..43074a4ab92 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -35,7 +35,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.1.3' + version = '1.1.4' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'http://www.grpc.io' diff --git a/package.json b/package.json index c38403bf3fa..de8b57c79a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grpc", - "version": "1.1.3", + "version": "1.1.4", "author": "Google Inc.", "description": "gRPC Library for Node", "homepage": "http://www.grpc.io/", diff --git a/package.xml b/package.xml index 580a15ea967..6ab1824dba1 100644 --- a/package.xml +++ b/package.xml @@ -13,8 +13,8 @@ 2017-01-13 - 1.1.3 - 1.1.3 + 1.1.4 + 1.1.4 beta diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc index 6f8c5148743..cc73a21d6ca 100644 --- a/src/cpp/common/version_cc.cc +++ b/src/cpp/common/version_cc.cc @@ -37,5 +37,5 @@ #include namespace grpc { -grpc::string Version() { return "1.1.3"; } +grpc::string Version() { return "1.1.4"; } } diff --git a/src/csharp/Grpc.Auth/project.json b/src/csharp/Grpc.Auth/project.json index c10d5d36e05..764b62d820c 100644 --- a/src/csharp/Grpc.Auth/project.json +++ b/src/csharp/Grpc.Auth/project.json @@ -1,5 +1,5 @@ { - "version": "1.1.3", + "version": "1.1.4", "title": "gRPC C# Auth", "authors": [ "Google Inc." ], "copyright": "Copyright 2015, Google Inc.", @@ -21,7 +21,7 @@ } }, "dependencies": { - "Grpc.Core": "1.1.3", + "Grpc.Core": "1.1.4", "Google.Apis.Auth": "1.16.0" }, "frameworks": { diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs index 9ecebf39c97..a69f6a20dba 100644 --- a/src/csharp/Grpc.Core/VersionInfo.cs +++ b/src/csharp/Grpc.Core/VersionInfo.cs @@ -48,11 +48,11 @@ namespace Grpc.Core /// /// Current AssemblyFileVersion of gRPC C# assemblies /// - public const string CurrentAssemblyFileVersion = "1.1.3.0"; + public const string CurrentAssemblyFileVersion = "1.1.4.0"; /// /// Current version of gRPC C# /// - public const string CurrentVersion = "1.1.3"; + public const string CurrentVersion = "1.1.4"; } } diff --git a/src/csharp/Grpc.Core/project.json b/src/csharp/Grpc.Core/project.json index f33d87f923b..88f9e76fd60 100644 --- a/src/csharp/Grpc.Core/project.json +++ b/src/csharp/Grpc.Core/project.json @@ -1,5 +1,5 @@ { - "version": "1.1.3", + "version": "1.1.4", "title": "gRPC C# Core", "authors": [ "Google Inc." ], "copyright": "Copyright 2015, Google Inc.", diff --git a/src/csharp/Grpc.HealthCheck/project.json b/src/csharp/Grpc.HealthCheck/project.json index 7789097c7ac..608d6454131 100644 --- a/src/csharp/Grpc.HealthCheck/project.json +++ b/src/csharp/Grpc.HealthCheck/project.json @@ -1,5 +1,5 @@ { - "version": "1.1.3", + "version": "1.1.4", "title": "gRPC C# Healthchecking", "authors": [ "Google Inc." ], "copyright": "Copyright 2015, Google Inc.", @@ -21,7 +21,7 @@ } }, "dependencies": { - "Grpc.Core": "1.1.3", + "Grpc.Core": "1.1.4", "Google.Protobuf": "3.0.0" }, "frameworks": { diff --git a/src/csharp/Grpc.Reflection/project.json b/src/csharp/Grpc.Reflection/project.json index 5a9964b8382..bc4bca023af 100644 --- a/src/csharp/Grpc.Reflection/project.json +++ b/src/csharp/Grpc.Reflection/project.json @@ -1,5 +1,5 @@ { - "version": "1.1.3", + "version": "1.1.4", "title": "gRPC C# Reflection", "authors": [ "Google Inc." ], "copyright": "Copyright 2016, Google Inc.", @@ -21,7 +21,7 @@ } }, "dependencies": { - "Grpc.Core": "1.1.3", + "Grpc.Core": "1.1.4", "Google.Protobuf": "3.0.0" }, "frameworks": { diff --git a/src/csharp/build_packages_dotnetcli.bat b/src/csharp/build_packages_dotnetcli.bat index 22b9d8035aa..ff12993513d 100755 --- a/src/csharp/build_packages_dotnetcli.bat +++ b/src/csharp/build_packages_dotnetcli.bat @@ -28,7 +28,7 @@ @rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @rem Current package versions -set VERSION=1.1.3 +set VERSION=1.1.4 set PROTOBUF_VERSION=3.0.0 @rem Adjust the location of nuget.exe diff --git a/src/csharp/build_packages_dotnetcli.sh b/src/csharp/build_packages_dotnetcli.sh index 9d3ac9493a3..6158fb8c259 100755 --- a/src/csharp/build_packages_dotnetcli.sh +++ b/src/csharp/build_packages_dotnetcli.sh @@ -65,7 +65,7 @@ dotnet pack --configuration Release Grpc.Auth/project.json --output ../../artifa dotnet pack --configuration Release Grpc.HealthCheck/project.json --output ../../artifacts dotnet pack --configuration Release Grpc.Reflection/project.json --output ../../artifacts -nuget pack Grpc.nuspec -Version "1.1.3" -OutputDirectory ../../artifacts -nuget pack Grpc.Tools.nuspec -Version "1.1.3" -OutputDirectory ../../artifacts +nuget pack Grpc.nuspec -Version "1.1.4" -OutputDirectory ../../artifacts +nuget pack Grpc.Tools.nuspec -Version "1.1.4" -OutputDirectory ../../artifacts (cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg) diff --git a/src/node/health_check/package.json b/src/node/health_check/package.json index 54c119f6b89..0961b921fcd 100644 --- a/src/node/health_check/package.json +++ b/src/node/health_check/package.json @@ -1,6 +1,6 @@ { "name": "grpc-health-check", - "version": "1.1.3", + "version": "1.1.4", "author": "Google Inc.", "description": "Health check service for use with gRPC", "repository": { @@ -15,7 +15,7 @@ } ], "dependencies": { - "grpc": "^1.1.3", + "grpc": "^1.1.4", "lodash": "^3.9.3", "google-protobuf": "^3.0.0" }, diff --git a/src/node/tools/package.json b/src/node/tools/package.json index ff4b6172e7b..86d47cca22f 100644 --- a/src/node/tools/package.json +++ b/src/node/tools/package.json @@ -1,6 +1,6 @@ { "name": "grpc-tools", - "version": "1.1.3", + "version": "1.1.4", "author": "Google Inc.", "description": "Tools for developing with gRPC on Node.js", "homepage": "http://www.grpc.io/", diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index e64762b726a..1803279da49 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.1.3' + v = '1.1.4' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index 20278ea7f87..9f4b2197a13 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -38,4 +38,4 @@ // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.1.3" +#define GRPC_OBJC_VERSION_STRING @"1.1.4" diff --git a/src/php/composer.json b/src/php/composer.json index 8993313376a..67c2cde58f4 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -5,7 +5,7 @@ "keywords": ["rpc"], "homepage": "http://grpc.io", "license": "BSD-3-Clause", - "version": "1.1.3", + "version": "1.1.4", "require": { "php": ">=5.5.0", "ext-grpc": "*", diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index bd5d9f46b48..7f926d26a6b 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION='1.1.3' +VERSION='1.1.4' diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py index a39a89ad3cf..fb56564f695 100644 --- a/src/python/grpcio_health_checking/grpc_version.py +++ b/src/python/grpcio_health_checking/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! -VERSION='1.1.3' +VERSION='1.1.4' diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py index 08d0b690637..85387718bc1 100644 --- a/src/python/grpcio_reflection/grpc_version.py +++ b/src/python/grpcio_reflection/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! -VERSION='1.1.3' +VERSION='1.1.4' diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py index d7dca23a459..dd88d251f83 100644 --- a/src/python/grpcio_tests/grpc_version.py +++ b/src/python/grpcio_tests/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! -VERSION='1.1.3' +VERSION='1.1.4' diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index b8c61f378be..b4467f35a62 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -29,5 +29,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '1.1.3' + VERSION = '1.1.4' end diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb index acbec89e873..39393f77b8c 100644 --- a/src/ruby/tools/version.rb +++ b/src/ruby/tools/version.rb @@ -29,6 +29,6 @@ module GRPC module Tools - VERSION = '1.1.3' + VERSION = '1.1.4' end end diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index 82d976bebe4..4106acde0b3 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -29,4 +29,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION='1.1.3' +VERSION='1.1.4' diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index f445dd2ffc0..f9b75baac75 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.1.3 +PROJECT_NUMBER = 1.1.4 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 3b7583ffaa6..ce255c285c0 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.1.3 +PROJECT_NUMBER = 1.1.4 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From c9b03fe9879b23f67d25938fd969765ae5fe7be8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 6 Feb 2017 08:45:00 -0800 Subject: [PATCH 12/52] expose AuthContext in C# --- src/csharp/Grpc.Core.Tests/AuthContextTest.cs | 86 ++++++++++++ .../Grpc.Core.Tests/AuthPropertyTest.cs | 82 +++++++++++ .../Grpc.Core.Tests/ClientServerTest.cs | 12 ++ .../Grpc.Core.Tests/Grpc.Core.Tests.csproj | 2 + src/csharp/Grpc.Core/AuthContext.cs | 128 ++++++++++++++++++ src/csharp/Grpc.Core/AuthProperty.cs | 126 +++++++++++++++++ src/csharp/Grpc.Core/Grpc.Core.csproj | 4 + .../Internal/AuthContextSafeHandle.cs | 119 ++++++++++++++++ .../Internal/BatchContextSafeHandle.cs | 10 +- .../Grpc.Core/Internal/CallSafeHandle.cs | 8 +- src/csharp/Grpc.Core/Internal/MarshalUtils.cs | 90 ++++++++++++ .../Grpc.Core/Internal/NativeMethods.cs | 18 +++ src/csharp/Grpc.Core/Metadata.cs | 13 +- src/csharp/Grpc.Core/ServerCallContext.cs | 23 +++- .../SslCredentialsTest.cs | 38 +++++- src/csharp/ext/grpc_csharp_ext.c | 25 ++++ src/csharp/tests.json | 2 + 17 files changed, 765 insertions(+), 21 deletions(-) create mode 100644 src/csharp/Grpc.Core.Tests/AuthContextTest.cs create mode 100644 src/csharp/Grpc.Core.Tests/AuthPropertyTest.cs create mode 100644 src/csharp/Grpc.Core/AuthContext.cs create mode 100644 src/csharp/Grpc.Core/AuthProperty.cs create mode 100644 src/csharp/Grpc.Core/Internal/AuthContextSafeHandle.cs create mode 100644 src/csharp/Grpc.Core/Internal/MarshalUtils.cs diff --git a/src/csharp/Grpc.Core.Tests/AuthContextTest.cs b/src/csharp/Grpc.Core.Tests/AuthContextTest.cs new file mode 100644 index 00000000000..f5fa469520c --- /dev/null +++ b/src/csharp/Grpc.Core.Tests/AuthContextTest.cs @@ -0,0 +1,86 @@ +#region Copyright notice and license + +// 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. + +#endregion + +using System; +using System.Collections.Generic; +using NUnit.Framework; +using Grpc.Core; +using System.Linq; + +namespace Grpc.Core.Tests +{ + public class AuthContextTest + { + [Test] + public void EmptyContext() + { + var context = new AuthContext(null, new Dictionary>()); + Assert.IsFalse(context.IsPeerAuthenticated); + Assert.IsNull(context.PeerIdentityPropertyName); + Assert.AreEqual(0, context.PeerIdentity.Count()); + Assert.AreEqual(0, context.Properties.Count()); + Assert.AreEqual(0, context.FindPropertiesByName("nonexistent").Count()); + } + + [Test] + public void AuthenticatedContext() + { + var property1 = AuthProperty.Create("abc", new byte[] { 68, 69, 70 }); + var context = new AuthContext("some_identity", new Dictionary> + { + {"some_identity", new List {property1}} + }); + Assert.IsTrue(context.IsPeerAuthenticated); + Assert.AreEqual("some_identity", context.PeerIdentityPropertyName); + Assert.AreEqual(1, context.PeerIdentity.Count()); + } + + [Test] + public void FindPropertiesByName() + { + var property1 = AuthProperty.Create("abc", new byte[] {68, 69, 70}); + var property2 = AuthProperty.Create("abc", new byte[] {71, 72, 73 }); + var property3 = AuthProperty.Create("abc", new byte[] {}); + var context = new AuthContext(null, new Dictionary> + { + {"existent", new List {property1, property2}}, + {"foobar", new List {property3}}, + }); + Assert.AreEqual(3, context.Properties.Count()); + Assert.AreEqual(0, context.FindPropertiesByName("nonexistent").Count()); + + var existentProperties = new List(context.FindPropertiesByName("existent")); + Assert.AreEqual(2, existentProperties.Count); + } + } +} diff --git a/src/csharp/Grpc.Core.Tests/AuthPropertyTest.cs b/src/csharp/Grpc.Core.Tests/AuthPropertyTest.cs new file mode 100644 index 00000000000..745191b80db --- /dev/null +++ b/src/csharp/Grpc.Core.Tests/AuthPropertyTest.cs @@ -0,0 +1,82 @@ +#region Copyright notice and license + +// 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. + +#endregion + +using System; +using NUnit.Framework; + +namespace Grpc.Core.Tests +{ + public class AuthPropertyTest + { + [Test] + public void Create_NameIsNotNull() + { + Assert.Throws(typeof(ArgumentNullException), () => AuthProperty.Create(null, new byte[0])); + Assert.Throws(typeof(ArgumentNullException), () => AuthProperty.CreateUnsafe(null, new byte[0])); + } + + [Test] + public void Create_ValueIsNotNull() + { + Assert.Throws(typeof(ArgumentNullException), () => AuthProperty.Create("abc", null)); + Assert.Throws(typeof(ArgumentNullException), () => AuthProperty.CreateUnsafe("abc", null)); + } + + [Test] + public void Create() + { + var valueBytes = new byte[] { 68, 69, 70 }; + var authProperty = AuthProperty.Create("abc", valueBytes); + + Assert.AreEqual("abc", authProperty.Name); + Assert.AreNotSame(valueBytes, authProperty.ValueBytesUnsafe); + CollectionAssert.AreEqual(valueBytes, authProperty.ValueBytes); + CollectionAssert.AreEqual(valueBytes, authProperty.ValueBytesUnsafe); + Assert.AreEqual("DEF", authProperty.Value); + } + + [Test] + public void CreateUnsafe() + { + var valueBytes = new byte[] { 68, 69, 70 }; + var authProperty = AuthProperty.CreateUnsafe("abc", valueBytes); + + Assert.AreEqual("abc", authProperty.Name); + Assert.AreSame(valueBytes, authProperty.ValueBytesUnsafe); + Assert.AreNotSame(valueBytes, authProperty.ValueBytes); + CollectionAssert.AreEqual(valueBytes, authProperty.ValueBytes); + CollectionAssert.AreEqual(valueBytes, authProperty.ValueBytesUnsafe); + Assert.AreEqual("DEF", authProperty.Value); + } + } +} diff --git a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs index 6bf9756962e..3a99107c422 100644 --- a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs @@ -375,6 +375,18 @@ namespace Grpc.Core.Tests Assert.AreEqual("PASS", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); } + [Test] + public void ServerCallContext_AuthContextNotPopulated() + { + helper.UnaryHandler = new UnaryServerMethod(async (request, context) => + { + Assert.IsFalse(context.AuthContext.IsPeerAuthenticated); + Assert.AreEqual(0, context.AuthContext.Properties.Count()); + return "PASS"; + }); + Assert.AreEqual("PASS", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc")); + } + [Test] public async Task Channel_WaitForStateChangedAsync() { diff --git a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj index 646effe21a7..a5e60e73285 100644 --- a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj +++ b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj @@ -81,6 +81,8 @@ + + diff --git a/src/csharp/Grpc.Core/AuthContext.cs b/src/csharp/Grpc.Core/AuthContext.cs new file mode 100644 index 00000000000..340b2201c79 --- /dev/null +++ b/src/csharp/Grpc.Core/AuthContext.cs @@ -0,0 +1,128 @@ +#region Copyright notice and license + +// 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. + +#endregion + +using System; +using System.Collections.Generic; +using System.Linq; +using Grpc.Core.Internal; +using Grpc.Core.Utils; + +namespace Grpc.Core +{ + /// + /// Authentication context for a call. + /// AuthContext is the only reliable source of truth when it comes to authenticating calls. + /// Using any other call/context properties for authentication purposes is wrong and inherently unsafe. + /// Note: experimental API that can change or be removed without any prior notice. + /// + public class AuthContext + { + string peerIdentityPropertyName; + Dictionary> properties; + + /// + /// Initializes a new instance of the class. + /// + /// Peer identity property name. + /// Multimap of auth properties by name. + internal AuthContext(string peerIdentityPropertyName, Dictionary> properties) + { + this.peerIdentityPropertyName = peerIdentityPropertyName; + this.properties = GrpcPreconditions.CheckNotNull(properties); + } + + /// + /// Returns true if the peer is authenticated. + /// + public bool IsPeerAuthenticated + { + get + { + return peerIdentityPropertyName != null; + } + } + + /// + /// Gets the name of the property that indicates the peer identity. Returns null + /// if the peer is not authenticated. + /// + public string PeerIdentityPropertyName + { + get + { + return peerIdentityPropertyName; + } + } + + /// + /// Gets properties that represent the peer identity (there can be more than one). Returns an empty collection + /// if the peer is not authenticated. + /// + public IEnumerable PeerIdentity + { + get + { + if (peerIdentityPropertyName == null) + { + return Enumerable.Empty(); + } + return properties[peerIdentityPropertyName]; + } + } + + /// + /// Gets the auth properties of this context. + /// + public IEnumerable Properties + { + get + { + return properties.Values.SelectMany(v => v); + } + } + + /// + /// Returns the auth properties with given name (there can be more than one). + /// If no properties of given name exist, an empty collection will be returned. + /// + public IEnumerable FindPropertiesByName(string propertyName) + { + List result; + if (!properties.TryGetValue(propertyName, out result)) + { + return Enumerable.Empty(); + } + return result; + } + } +} diff --git a/src/csharp/Grpc.Core/AuthProperty.cs b/src/csharp/Grpc.Core/AuthProperty.cs new file mode 100644 index 00000000000..c7a132b09eb --- /dev/null +++ b/src/csharp/Grpc.Core/AuthProperty.cs @@ -0,0 +1,126 @@ +#region Copyright notice and license + +// 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. + +#endregion + +using System; +using System.Collections.Generic; +using System.Linq; +using Grpc.Core.Internal; +using Grpc.Core.Utils; + +namespace Grpc.Core +{ + /// + /// A property of an . + /// Note: experimental API that can change or be removed without any prior notice. + /// + public class AuthProperty + { + string name; + byte[] valueBytes; + Lazy value; + + private AuthProperty(string name, byte[] valueBytes) + { + this.name = GrpcPreconditions.CheckNotNull(name); + this.valueBytes = GrpcPreconditions.CheckNotNull(valueBytes); + this.value = new Lazy(() => MarshalUtils.GetStringUTF8(this.valueBytes)); + } + + /// + /// Gets the name of the property. + /// + public string Name + { + get + { + return name; + } + } + + /// + /// Gets the string value of the property. + /// + public string Value + { + get + { + return value.Value; + } + } + + /// + /// Gets the binary value of the property. + /// + public byte[] ValueBytes + { + get + { + var valueCopy = new byte[valueBytes.Length]; + Buffer.BlockCopy(valueBytes, 0, valueCopy, 0, valueBytes.Length); + return valueCopy; + } + } + + /// + /// Creates an instance of AuthProperty. + /// + /// the name + /// the binary value of the property + public static AuthProperty Create(string name, byte[] valueBytes) + { + GrpcPreconditions.CheckNotNull(valueBytes); + var valueCopy = new byte[valueBytes.Length]; + Buffer.BlockCopy(valueBytes, 0, valueCopy, 0, valueBytes.Length); + return new AuthProperty(name, valueCopy); + } + + /// + /// Gets the binary value of the property (without making a defensive copy). + /// + internal byte[] ValueBytesUnsafe + { + get + { + return valueBytes; + } + } + + /// + /// Creates and instance of AuthProperty without making a defensive copy of valueBytes. + /// + internal static AuthProperty CreateUnsafe(string name, byte[] valueBytes) + { + return new AuthProperty(name, valueBytes); + } + } +} diff --git a/src/csharp/Grpc.Core/Grpc.Core.csproj b/src/csharp/Grpc.Core/Grpc.Core.csproj index 23e1ddcf7f7..d6d8dfac224 100644 --- a/src/csharp/Grpc.Core/Grpc.Core.csproj +++ b/src/csharp/Grpc.Core/Grpc.Core.csproj @@ -131,6 +131,10 @@ + + + + diff --git a/src/csharp/Grpc.Core/Internal/AuthContextSafeHandle.cs b/src/csharp/Grpc.Core/Internal/AuthContextSafeHandle.cs new file mode 100644 index 00000000000..59e33a0fdf1 --- /dev/null +++ b/src/csharp/Grpc.Core/Internal/AuthContextSafeHandle.cs @@ -0,0 +1,119 @@ +#region Copyright notice and license + +// Copyright 2017, 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. + +#endregion + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using Grpc.Core; +using Grpc.Core.Utils; + +namespace Grpc.Core.Internal +{ + /// + /// grpc_auth_context + /// + internal class AuthContextSafeHandle : SafeHandleZeroIsInvalid + { + static readonly NativeMethods Native = NativeMethods.Get(); + + private AuthContextSafeHandle() + { + } + + /// + /// Copies contents of the native auth context into a new AuthContext instance. + /// + public AuthContext ToAuthContext() + { + if (IsInvalid) + { + return new AuthContext(null, new Dictionary>()); + } + + var peerIdentityPropertyName = Marshal.PtrToStringAnsi(Native.grpcsharp_auth_context_peer_identity_property_name(this)); + + var propertiesDict = new Dictionary>(); + + var it = Native.grpcsharp_auth_context_property_iterator(this); + IntPtr authPropertyPtr = IntPtr.Zero; + while ((authPropertyPtr = Native.grpcsharp_auth_property_iterator_next(ref it)) != IntPtr.Zero) + { + var authProperty = PtrToAuthProperty(authPropertyPtr); + + if (!propertiesDict.ContainsKey(authProperty.Name)) + { + propertiesDict[authProperty.Name] = new List(); + } + propertiesDict[authProperty.Name].Add(authProperty); + } + + return new AuthContext(peerIdentityPropertyName, propertiesDict); + } + + protected override bool ReleaseHandle() + { + Native.grpcsharp_auth_context_release(handle); + return true; + } + + private AuthProperty PtrToAuthProperty(IntPtr authPropertyPtr) + { + var nativeAuthProperty = (NativeAuthProperty) Marshal.PtrToStructure(authPropertyPtr, typeof(NativeAuthProperty)); + var name = Marshal.PtrToStringAnsi(nativeAuthProperty.Name); + var valueBytes = new byte[(int) nativeAuthProperty.ValueLength]; + Marshal.Copy(nativeAuthProperty.Value, valueBytes, 0, (int)nativeAuthProperty.ValueLength); + return AuthProperty.CreateUnsafe(name, valueBytes); + } + + /// + /// grpc_auth_property + /// + internal struct NativeAuthProperty + { + public IntPtr Name; + public IntPtr Value; + public UIntPtr ValueLength; + } + + /// + /// grpc_auth_property_iterator + /// + internal struct NativeAuthPropertyIterator + { + public IntPtr AuthContext; + public UIntPtr Index; + public IntPtr Name; + } + } +} diff --git a/src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs b/src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs index efae149f098..6dee6d8c352 100644 --- a/src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs @@ -43,7 +43,6 @@ namespace Grpc.Core.Internal /// internal class BatchContextSafeHandle : SafeHandleZeroIsInvalid { - static readonly Encoding EncodingUTF8 = System.Text.Encoding.UTF8; static readonly NativeMethods Native = NativeMethods.Get(); private BatchContextSafeHandle() @@ -75,7 +74,7 @@ namespace Grpc.Core.Internal { UIntPtr detailsLength; IntPtr detailsPtr = Native.grpcsharp_batch_context_recv_status_on_client_details(this, out detailsLength); - string details = PtrToStringUtf8(detailsPtr, (int) detailsLength.ToUInt32()); + string details = MarshalUtils.PtrToStringUTF8(detailsPtr, (int) detailsLength.ToUInt32()); var status = new Status(Native.grpcsharp_batch_context_recv_status_on_client_status(this), details); IntPtr metadataArrayPtr = Native.grpcsharp_batch_context_recv_status_on_client_trailing_metadata(this); @@ -108,12 +107,5 @@ namespace Grpc.Core.Internal Native.grpcsharp_batch_context_destroy(handle); return true; } - - string PtrToStringUtf8(IntPtr ptr, int len) - { - var bytes = new byte[len]; - Marshal.Copy(ptr, bytes, 0, len); - return EncodingUTF8.GetString(bytes); - } } } diff --git a/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs index 710ca480e88..3c368fbc6cd 100644 --- a/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs @@ -45,7 +45,6 @@ namespace Grpc.Core.Internal internal class CallSafeHandle : SafeHandleZeroIsInvalid, INativeCall { public static readonly CallSafeHandle NullInstance = new CallSafeHandle(); - static readonly Encoding EncodingUTF8 = System.Text.Encoding.UTF8; static readonly NativeMethods Native = NativeMethods.Get(); const uint GRPC_WRITE_BUFFER_HINT = 1; @@ -140,7 +139,7 @@ namespace Grpc.Core.Internal var ctx = BatchContextSafeHandle.Create(); var optionalPayloadLength = optionalPayload != null ? new UIntPtr((ulong)optionalPayload.Length) : UIntPtr.Zero; completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success)); - var statusDetailBytes = EncodingUTF8.GetBytes(status.Detail); + var statusDetailBytes = MarshalUtils.GetBytesUTF8(status.Detail); Native.grpcsharp_call_send_status_from_server(this, ctx, status.StatusCode, statusDetailBytes, new UIntPtr((ulong)statusDetailBytes.Length), metadataArray, sendEmptyInitialMetadata, optionalPayload, optionalPayloadLength, writeFlags).CheckOk(); } @@ -204,6 +203,11 @@ namespace Grpc.Core.Internal } } + public AuthContextSafeHandle GetAuthContext() + { + return Native.grpcsharp_call_auth_context(this); + } + protected override bool ReleaseHandle() { Native.grpcsharp_call_destroy(handle); diff --git a/src/csharp/Grpc.Core/Internal/MarshalUtils.cs b/src/csharp/Grpc.Core/Internal/MarshalUtils.cs new file mode 100644 index 00000000000..897e2f70bb4 --- /dev/null +++ b/src/csharp/Grpc.Core/Internal/MarshalUtils.cs @@ -0,0 +1,90 @@ +#region Copyright notice and license + +// 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. + +#endregion + +using System; +using System.Runtime.InteropServices; +using System.Text; + +namespace Grpc.Core.Internal +{ + /// + /// Useful methods for native/managed marshalling. + /// + internal static class MarshalUtils + { + static readonly Encoding EncodingUTF8 = System.Text.Encoding.UTF8; + static readonly Encoding EncodingASCII = System.Text.Encoding.ASCII; + + /// + /// Converts IntPtr pointing to a UTF-8 encoded byte array to string. + /// + public static string PtrToStringUTF8(IntPtr ptr, int len) + { + var bytes = new byte[len]; + Marshal.Copy(ptr, bytes, 0, len); + return EncodingUTF8.GetString(bytes); + } + + /// + /// Returns byte array containing UTF-8 encoding of given string. + /// + public static byte[] GetBytesUTF8(string str) + { + return EncodingUTF8.GetBytes(str); + } + + /// + /// Get string from a UTF8 encoded byte array. + /// + public static string GetStringUTF8(byte[] bytes) + { + return EncodingUTF8.GetString(bytes); + } + + /// + /// Returns byte array containing ASCII encoding of given string. + /// + public static byte[] GetBytesASCII(string str) + { + return EncodingASCII.GetBytes(str); + } + + /// + /// Get string from an ASCII encoded byte array. + /// + public static string GetStringASCII(byte[] bytes) + { + return EncodingASCII.GetString(bytes); + } + } +} diff --git a/src/csharp/Grpc.Core/Internal/NativeMethods.cs b/src/csharp/Grpc.Core/Internal/NativeMethods.cs index aff9550e8d2..dd65f052172 100644 --- a/src/csharp/Grpc.Core/Internal/NativeMethods.cs +++ b/src/csharp/Grpc.Core/Internal/NativeMethods.cs @@ -148,6 +148,12 @@ namespace Grpc.Core.Internal public readonly Delegates.grpcsharp_server_shutdown_and_notify_callback_delegate grpcsharp_server_shutdown_and_notify_callback; public readonly Delegates.grpcsharp_server_destroy_delegate grpcsharp_server_destroy; + public readonly Delegates.grpcsharp_call_auth_context_delegate grpcsharp_call_auth_context; + public readonly Delegates.grpcsharp_auth_context_peer_identity_property_name_delegate grpcsharp_auth_context_peer_identity_property_name; + public readonly Delegates.grpcsharp_auth_context_property_iterator_delegate grpcsharp_auth_context_property_iterator; + public readonly Delegates.grpcsharp_auth_property_iterator_next_delegate grpcsharp_auth_property_iterator_next; + public readonly Delegates.grpcsharp_auth_context_release_delegate grpcsharp_auth_context_release; + public readonly Delegates.gprsharp_now_delegate gprsharp_now; public readonly Delegates.gprsharp_inf_future_delegate gprsharp_inf_future; public readonly Delegates.gprsharp_inf_past_delegate gprsharp_inf_past; @@ -256,6 +262,12 @@ namespace Grpc.Core.Internal this.grpcsharp_server_shutdown_and_notify_callback = GetMethodDelegate(library); this.grpcsharp_server_destroy = GetMethodDelegate(library); + this.grpcsharp_call_auth_context = GetMethodDelegate(library); + this.grpcsharp_auth_context_peer_identity_property_name = GetMethodDelegate(library); + this.grpcsharp_auth_context_property_iterator = GetMethodDelegate(library); + this.grpcsharp_auth_property_iterator_next = GetMethodDelegate(library); + this.grpcsharp_auth_context_release = GetMethodDelegate(library); + this.gprsharp_now = GetMethodDelegate(library); this.gprsharp_inf_future = GetMethodDelegate(library); this.gprsharp_inf_past = GetMethodDelegate(library); @@ -404,6 +416,12 @@ namespace Grpc.Core.Internal public delegate void grpcsharp_server_shutdown_and_notify_callback_delegate(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx); public delegate void grpcsharp_server_destroy_delegate(IntPtr server); + public delegate AuthContextSafeHandle grpcsharp_call_auth_context_delegate(CallSafeHandle call); + public delegate IntPtr grpcsharp_auth_context_peer_identity_property_name_delegate(AuthContextSafeHandle authContext); // returns const char* + public delegate AuthContextSafeHandle.NativeAuthPropertyIterator grpcsharp_auth_context_property_iterator_delegate(AuthContextSafeHandle authContext); + public delegate IntPtr grpcsharp_auth_property_iterator_next_delegate(ref AuthContextSafeHandle.NativeAuthPropertyIterator iterator); // returns const auth_property* + public delegate void grpcsharp_auth_context_release_delegate(IntPtr authContext); + public delegate Timespec gprsharp_now_delegate(ClockType clockType); public delegate Timespec gprsharp_inf_future_delegate(ClockType clockType); public delegate Timespec gprsharp_inf_past_delegate(ClockType clockType); diff --git a/src/csharp/Grpc.Core/Metadata.cs b/src/csharp/Grpc.Core/Metadata.cs index 6fc715d6ee1..6e195b49ccd 100644 --- a/src/csharp/Grpc.Core/Metadata.cs +++ b/src/csharp/Grpc.Core/Metadata.cs @@ -32,12 +32,10 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Collections.Specialized; -using System.Globalization; -using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; +using Grpc.Core.Internal; using Grpc.Core.Utils; namespace Grpc.Core @@ -242,7 +240,6 @@ namespace Grpc.Core /// public class Entry { - private static readonly Encoding Encoding = Encoding.ASCII; private static readonly Regex ValidKeyRegex = new Regex("^[a-z0-9_-]+$"); readonly string key; @@ -306,7 +303,7 @@ namespace Grpc.Core { if (valueBytes == null) { - return Encoding.GetBytes(value); + return MarshalUtils.GetBytesASCII(value); } // defensive copy to guarantee immutability @@ -324,7 +321,7 @@ namespace Grpc.Core get { GrpcPreconditions.CheckState(!IsBinary, "Cannot access string value of a binary metadata entry"); - return value ?? Encoding.GetString(valueBytes); + return value ?? MarshalUtils.GetStringASCII(valueBytes); } } @@ -358,7 +355,7 @@ namespace Grpc.Core /// internal byte[] GetSerializedValueUnsafe() { - return valueBytes ?? Encoding.GetBytes(value); + return valueBytes ?? MarshalUtils.GetBytesASCII(value); } /// @@ -371,7 +368,7 @@ namespace Grpc.Core { return new Entry(key, null, valueBytes); } - return new Entry(key, Encoding.GetString(valueBytes), null); + return new Entry(key, MarshalUtils.GetStringASCII(valueBytes), null); } private static string NormalizeKey(string key) diff --git a/src/csharp/Grpc.Core/ServerCallContext.cs b/src/csharp/Grpc.Core/ServerCallContext.cs index 8f28fbc0453..c8950b76779 100644 --- a/src/csharp/Grpc.Core/ServerCallContext.cs +++ b/src/csharp/Grpc.Core/ServerCallContext.cs @@ -32,7 +32,6 @@ #endregion using System; -using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; @@ -56,6 +55,7 @@ namespace Grpc.Core private Status status = Status.DefaultSuccess; private Func writeHeadersFunc; private IHasWriteOptions writeOptionsHolder; + private Lazy authContext; internal ServerCallContext(CallSafeHandle callHandle, string method, string host, DateTime deadline, Metadata requestHeaders, CancellationToken cancellationToken, Func writeHeadersFunc, IHasWriteOptions writeOptionsHolder) @@ -68,6 +68,7 @@ namespace Grpc.Core this.cancellationToken = cancellationToken; this.writeHeadersFunc = writeHeadersFunc; this.writeOptionsHolder = writeOptionsHolder; + this.authContext = new Lazy(GetAuthContextEager); } /// @@ -187,6 +188,26 @@ namespace Grpc.Core writeOptionsHolder.WriteOptions = value; } } + + /// + /// Gets the AuthContext associated with this call. + /// Note: Access to AuthContext is an experimental API that can change without any prior notice. + /// + public AuthContext AuthContext + { + get + { + return authContext.Value; + } + } + + private AuthContext GetAuthContextEager() + { + using (var authContextNative = callHandle.GetAuthContext()) + { + return authContextNative.ToAuthContext(); + } + } } /// diff --git a/src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs b/src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs index f85e272711f..377dad63f40 100644 --- a/src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs +++ b/src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs @@ -37,6 +37,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using Google.Protobuf; using Grpc.Core; using Grpc.Core.Utils; using Grpc.Testing; @@ -68,7 +69,7 @@ namespace Grpc.IntegrationTesting server = new Server { - Services = { TestService.BindService(new TestServiceImpl()) }, + Services = { TestService.BindService(new SslCredentialsTestServiceImpl()) }, Ports = { { Host, ServerPort.PickUnused, serverCredentials } } }; server.Start(); @@ -95,5 +96,40 @@ namespace Grpc.IntegrationTesting var response = client.UnaryCall(new SimpleRequest { ResponseSize = 10 }); Assert.AreEqual(10, response.Payload.Body.Length); } + + [Test] + public async Task AuthContextIsPopulated() + { + var call = client.StreamingInputCall(); + await call.RequestStream.CompleteAsync(); + var response = await call.ResponseAsync; + Assert.AreEqual(12345, response.AggregatedPayloadSize); + } + + private class SslCredentialsTestServiceImpl : TestService.TestServiceBase + { + public override async Task UnaryCall(SimpleRequest request, ServerCallContext context) + { + return new SimpleResponse { Payload = CreateZerosPayload(request.ResponseSize) }; + } + + public override async Task StreamingInputCall(IAsyncStreamReader requestStream, ServerCallContext context) + { + var authContext = context.AuthContext; + await requestStream.ForEachAsync(async request => {}); + + Assert.IsTrue(authContext.IsPeerAuthenticated); + Assert.AreEqual("x509_subject_alternative_name", authContext.PeerIdentityPropertyName); + Assert.IsTrue(authContext.PeerIdentity.Count() > 0); + Assert.AreEqual("ssl", authContext.FindPropertiesByName("transport_security_type").First().Value); + + return new StreamingInputCallResponse { AggregatedPayloadSize = 12345 }; + } + + private static Payload CreateZerosPayload(int size) + { + return new Payload { Body = ByteString.CopyFrom(new byte[size]) }; + } + } } } diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c index 6a241190b27..491df4de6ad 100644 --- a/src/csharp/ext/grpc_csharp_ext.c +++ b/src/csharp/ext/grpc_csharp_ext.c @@ -1023,6 +1023,31 @@ GPR_EXPORT grpc_call_credentials *GPR_CALLTYPE grpcsharp_metadata_credentials_cr return grpc_metadata_credentials_create_from_plugin(plugin, NULL); } +/* Auth context */ + +GPR_EXPORT grpc_auth_context *GPR_CALLTYPE grpcsharp_call_auth_context(grpc_call *call) { + return grpc_call_auth_context(call); +} + +GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_auth_context_peer_identity_property_name( + const grpc_auth_context *ctx) { + return grpc_auth_context_peer_identity_property_name(ctx); +} + +GPR_EXPORT grpc_auth_property_iterator GPR_CALLTYPE +grpcsharp_auth_context_property_iterator(const grpc_auth_context *ctx) { + return grpc_auth_context_property_iterator(ctx); +} + +GPR_EXPORT const grpc_auth_property *GPR_CALLTYPE grpcsharp_auth_property_iterator_next( + grpc_auth_property_iterator *it) { + return grpc_auth_property_iterator_next(it); +} + +GPR_EXPORT void GPR_CALLTYPE grpcsharp_auth_context_release(grpc_auth_context *ctx) { + grpc_auth_context_release(ctx); +} + /* Logging */ typedef void(GPR_CALLTYPE *grpcsharp_log_func)(const char *file, int32_t line, diff --git a/src/csharp/tests.json b/src/csharp/tests.json index 4ce6769eee5..63f2e97f2db 100644 --- a/src/csharp/tests.json +++ b/src/csharp/tests.json @@ -8,6 +8,8 @@ "Grpc.Core.Internal.Tests.MetadataArraySafeHandleTest", "Grpc.Core.Internal.Tests.TimespecTest", "Grpc.Core.Tests.AppDomainUnloadTest", + "Grpc.Core.Tests.AuthContextTest", + "Grpc.Core.Tests.AuthPropertyTest", "Grpc.Core.Tests.CallCredentialsTest", "Grpc.Core.Tests.CallOptionsTest", "Grpc.Core.Tests.ChannelCredentialsTest", From faaa8b8913b347aeea01f18b7aa44db91d91ab97 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 2 Mar 2017 10:50:34 -0800 Subject: [PATCH 13/52] Disable node_protobuf_async_unary_qps_unconstrained benchmark test --- tools/run_tests/performance/scenario_config.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py index b20bb40eb1b..163f5d57462 100644 --- a/tools/run_tests/performance/scenario_config.py +++ b/tools/run_tests/performance/scenario_config.py @@ -396,11 +396,12 @@ class NodeLanguage: client_type='ASYNC_CLIENT', server_type='async_server', client_language='c++') - yield _ping_pong_scenario( - 'node_protobuf_async_unary_qps_unconstrained', rpc_type='UNARY', - client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', - unconstrained_client='async', - categories=[SCALABLE, SMOKETEST]) + # TODO(murgatroid99): fix bugs with this scenario and re-enable it + # yield _ping_pong_scenario( + # 'node_protobuf_async_unary_qps_unconstrained', rpc_type='UNARY', + # client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', + # unconstrained_client='async', + # categories=[SCALABLE, SMOKETEST]) # TODO(jtattermusch): make this scenario work #yield _ping_pong_scenario( From a99c94766e00dbb4d7f740e4e5fa342a7ea53899 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 2 Mar 2017 11:32:08 -0800 Subject: [PATCH 14/52] Add option to recompile Node library without ALPN support --- binding.gyp | 22 +++++++++++++++------- templates/binding.gyp.template | 22 +++++++++++++++------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/binding.gyp b/binding.gyp index 2b2072fa568..efac5f0ec12 100644 --- a/binding.gyp +++ b/binding.gyp @@ -43,7 +43,11 @@ # out. It can be re-enabled for one build by setting the npm config # variable grpc_uv to true, and it can be re-enabled permanently by # setting it to true here. - 'grpc_uv%': 'false' + 'grpc_uv%': 'false', + # Some Node installations use the system installation of OpenSSL, and on + # some systems, the system OpenSSL still does not have ALPN support. This + # will let users recompile gRPC to work without ALPN. + 'grpc_alpn%': 'true' }, 'target_defaults': { 'include_dirs': [ @@ -56,8 +60,6 @@ 'conditions': [ ['runtime=="node" and grpc_uv=="true"', { 'defines': [ - # Disabling this while bugs are ironed out. Uncomment this to - # re-enable libuv integration in C core. 'GRPC_UV' ] }], @@ -75,10 +77,16 @@ 'OPENSSL_NO_ASM' ] }, { - # As of the beginning of 2017, we only support versions of Node with - # embedded versions of OpenSSL that support ALPN - 'defines': [ - 'TSI_OPENSSL_ALPN_SUPPORT=1' + 'conditions': [ + ['grpc_alpn=="true"', { + 'defines': [ + 'TSI_OPENSSL_ALPN_SUPPORT=1' + ], + }, { + 'defines': [ + 'TSI_OPENSSL_ALPN_SUPPORT=0' + ], + }] ], 'include_dirs': [ '<(node_root_dir)/deps/openssl/openssl/include', diff --git a/templates/binding.gyp.template b/templates/binding.gyp.template index 9d7034e18bc..31b8277a249 100644 --- a/templates/binding.gyp.template +++ b/templates/binding.gyp.template @@ -45,7 +45,11 @@ # out. It can be re-enabled for one build by setting the npm config # variable grpc_uv to true, and it can be re-enabled permanently by # setting it to true here. - 'grpc_uv%': 'false' + 'grpc_uv%': 'false', + # Some Node installations use the system installation of OpenSSL, and on + # some systems, the system OpenSSL still does not have ALPN support. This + # will let users recompile gRPC to work without ALPN. + 'grpc_alpn%': 'true' }, 'target_defaults': { 'include_dirs': [ @@ -58,8 +62,6 @@ 'conditions': [ ['runtime=="node" and grpc_uv=="true"', { 'defines': [ - # Disabling this while bugs are ironed out. Uncomment this to - # re-enable libuv integration in C core. 'GRPC_UV' ] }], @@ -77,10 +79,16 @@ 'OPENSSL_NO_ASM' ] }, { - # As of the beginning of 2017, we only support versions of Node with - # embedded versions of OpenSSL that support ALPN - 'defines': [ - 'TSI_OPENSSL_ALPN_SUPPORT=1' + 'conditions': [ + ['grpc_alpn=="true"', { + 'defines': [ + 'TSI_OPENSSL_ALPN_SUPPORT=1' + ], + }, { + 'defines': [ + 'TSI_OPENSSL_ALPN_SUPPORT=0' + ], + }] ], 'include_dirs': [ '<(node_root_dir)/deps/openssl/openssl/include', From 18e8b147e66ba262b4d04a2270d1cae3d95b9a6f Mon Sep 17 00:00:00 2001 From: "J. Martin" Date: Thu, 23 Feb 2017 18:52:46 -0600 Subject: [PATCH 15/52] Limit the gem native build resources When building the native extension make -j can absorb all available resources on a system. Implement "reasonable" limits on the number of compiling jobs when the number of processors can be detected and use a conservative count when ruby version does not provide detection. --- src/ruby/ext/grpc/extconf.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb index b379664bab8..ecb66239b90 100644 --- a/src/ruby/ext/grpc/extconf.rb +++ b/src/ruby/ext/grpc/extconf.rb @@ -27,6 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +require 'etc' require 'mkmf' LIBDIR = RbConfig::CONFIG['libdir'] @@ -80,7 +81,9 @@ ENV['BUILDDIR'] = output_dir unless windows puts 'Building internal gRPC into ' + grpc_lib_dir - system("make -j -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config}") + nproc = 4 + nproc = Etc.nprocessors * 2 if Etc.respond_to? :nprocessors + system("make -j#{nproc} -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config}") exit 1 unless $? == 0 end From 9098fccf9ee760893f65072ee10267e5a62b7a23 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Thu, 2 Mar 2017 17:13:10 -0800 Subject: [PATCH 16/52] Use grpc_build_system.bzl in other projects Added //external to grpc deps in case where grpc_build_system.bzl is imported in a project that is using grpc as a dependency. --- bazel/cc_grpc_library.bzl | 21 ++++++++++++++++++--- bazel/grpc_build_system.bzl | 3 ++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/bazel/cc_grpc_library.bzl b/bazel/cc_grpc_library.bzl index 9020eacb740..94874fe9371 100644 --- a/bazel/cc_grpc_library.bzl +++ b/bazel/cc_grpc_library.bzl @@ -2,7 +2,7 @@ load("//:bazel/generate_cc.bzl", "generate_cc") -def cc_grpc_library(name, srcs, deps, proto_only, **kwargs): +def cc_grpc_library(name, srcs, deps, proto_only, use_external, **kwargs): """Generates C++ grpc classes from a .proto file. Assumes the generated classes will be used in cc_api_version = 2. @@ -12,6 +12,8 @@ def cc_grpc_library(name, srcs, deps, proto_only, **kwargs): srcs: a single proto_library, which wraps the .proto files with services. deps: a list of C++ proto_library (or cc_proto_library) which provides the compiled code of any message that the services depend on. + use_external: When True the grpc deps are prefixed with //external. This + allows grpc to be used as a dependency in other bazel projects. **kwargs: rest of arguments, e.g., compatible_with and visibility. """ if len(srcs) > 1: @@ -37,18 +39,31 @@ def cc_grpc_library(name, srcs, deps, proto_only, **kwargs): ) if not proto_only: + if use_external: + # when this file is used by non-grpc projects + plugin = "//external:grpc_cpp_plugin" + else: + plugin = "//:grpc_cpp_plugin" + generate_cc( name = codegen_grpc_target, srcs = [proto_target], - plugin = "//:grpc_cpp_plugin", + plugin = plugin, **kwargs ) + if use_external: + # when this file is used by non-grpc projects + grpc_deps = ["//external:grpc++", "//external:grpc++_codegen_proto", + "//external:protobuf"] + else: + grpc_deps = ["//:grpc++", "//:grpc++_codegen_proto", "//external:protobuf"] + native.cc_library( name = name, srcs = [":" + codegen_grpc_target, ":" + codegen_target], hdrs = [":" + codegen_grpc_target, ":" + codegen_target], - deps = deps + ["//:grpc++", "//:grpc++_codegen_proto", "//external:protobuf"], + deps = deps + grpc_deps, **kwargs ) else: diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index daf8b78527a..855d2d7b723 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -58,11 +58,12 @@ def grpc_proto_plugin(name, srcs = [], deps = []): load("//:bazel/cc_grpc_library.bzl", "cc_grpc_library") -def grpc_proto_library(name, srcs = [], deps = [], well_known_deps = [], has_services = True): +def grpc_proto_library(name, srcs = [], deps = [], well_known_deps = [], has_services = True, use_external = False): cc_grpc_library( name = name, srcs = srcs, deps = deps, proto_only = not has_services, + use_external = use_external, ) From d3d46a5385f9566cd630755679004c0088865744 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Fri, 3 Mar 2017 01:30:55 +0000 Subject: [PATCH 17/52] Enable suppressed-message lint --- .pylintrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index 04c0088c88e..f41ef6542df 100644 --- a/.pylintrc +++ b/.pylintrc @@ -17,7 +17,6 @@ notes=FIXME,XXX #TODO: Enable no-init #TODO: Enable duplicate-code #TODO: Enable invalid-name -#TODO: Enable suppressed-message #TODO: Enable locally-disabled #TODO: Enable protected-access #TODO: Enable no-name-in-module @@ -37,4 +36,4 @@ notes=FIXME,XXX #TODO: Enable too-many-nested-blocks #TODO: Enable super-init-not-called -disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,suppressed-message,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks,super-init-not-called +disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks,super-init-not-called From 880b7981d85ef134ebb6fb5831669eb1e4f46821 Mon Sep 17 00:00:00 2001 From: Wenbo Zhu Date: Thu, 2 Mar 2017 17:41:36 -0800 Subject: [PATCH 18/52] Update PROTOCOL-WEB.md Remove text-base64 C-T. Will revisit if we ever need support non-default (base64) encoding. --- doc/PROTOCOL-WEB.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/PROTOCOL-WEB.md b/doc/PROTOCOL-WEB.md index 0b54e0f34fc..5f01af36273 100644 --- a/doc/PROTOCOL-WEB.md +++ b/doc/PROTOCOL-WEB.md @@ -94,8 +94,6 @@ the response stream needs to be text encoded e.g. when XHR is used or due to security policies with XHR * Accept: application/grpc-web-text 2. The default text encoding is base64 - * Text encoding may be specified with Content-Type or Accept headers as - * application/grpc-web-text-base64 * Note that “Content-Transfer-Encoding: base64” should not be used. Due to in-stream base64 padding when delimiting messages, the entire response body is not necessarily a valid base64-encoded entity From 67951aaf5eeeedd39d2f84eab51a3291237f6238 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Thu, 2 Mar 2017 16:40:02 -0800 Subject: [PATCH 19/52] Avoid using oversized frames --- test/core/iomgr/tcp_server_posix_test.c | 33 ++++++++++++++----------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c index efadddc0110..6e514324a5f 100644 --- a/test/core/iomgr/tcp_server_posix_test.c +++ b/test/core/iomgr/tcp_server_posix_test.c @@ -454,7 +454,8 @@ int main(int argc, char **argv) { const grpc_channel_args channel_args = {1, chan_args}; struct ifaddrs *ifa = NULL; struct ifaddrs *ifa_it; - test_addrs dst_addrs; + // Zalloc dst_addrs to avoid oversized frames. + test_addrs *dst_addrs = gpr_zalloc(sizeof(*dst_addrs)); grpc_test_init(argc, argv); grpc_init(); g_pollset = gpr_zalloc(grpc_pollset_size()); @@ -469,24 +470,25 @@ int main(int argc, char **argv) { gpr_log(GPR_ERROR, "getifaddrs: %s", strerror(errno)); return EXIT_FAILURE; } - dst_addrs.naddrs = 0; - for (ifa_it = ifa; ifa_it != NULL && dst_addrs.naddrs < MAX_ADDRS; + dst_addrs->naddrs = 0; + for (ifa_it = ifa; ifa_it != NULL && dst_addrs->naddrs < MAX_ADDRS; ifa_it = ifa_it->ifa_next) { if (ifa_it->ifa_addr == NULL) { continue; } else if (ifa_it->ifa_addr->sa_family == AF_INET) { - dst_addrs.addrs[dst_addrs.naddrs].addr.len = sizeof(struct sockaddr_in); + dst_addrs->addrs[dst_addrs->naddrs].addr.len = sizeof(struct sockaddr_in); } else if (ifa_it->ifa_addr->sa_family == AF_INET6) { - dst_addrs.addrs[dst_addrs.naddrs].addr.len = sizeof(struct sockaddr_in6); + dst_addrs->addrs[dst_addrs->naddrs].addr.len = + sizeof(struct sockaddr_in6); } else { continue; } - memcpy(dst_addrs.addrs[dst_addrs.naddrs].addr.addr, ifa_it->ifa_addr, - dst_addrs.addrs[dst_addrs.naddrs].addr.len); + memcpy(dst_addrs->addrs[dst_addrs->naddrs].addr.addr, ifa_it->ifa_addr, + dst_addrs->addrs[dst_addrs->naddrs].addr.len); GPR_ASSERT( - grpc_sockaddr_set_port(&dst_addrs.addrs[dst_addrs.naddrs].addr, 0)); - test_addr_init_str(&dst_addrs.addrs[dst_addrs.naddrs]); - ++dst_addrs.naddrs; + grpc_sockaddr_set_port(&dst_addrs->addrs[dst_addrs->naddrs].addr, 0)); + test_addr_init_str(&dst_addrs->addrs[dst_addrs->naddrs]); + ++dst_addrs->naddrs; } freeifaddrs(ifa); ifa = NULL; @@ -495,20 +497,21 @@ int main(int argc, char **argv) { test_connect(1, NULL, NULL, false); test_connect(10, NULL, NULL, false); - /* Set dst_addrs.addrs[i].len=0 for dst_addrs that are unreachable with a "::" - listener. */ - test_connect(1, NULL, &dst_addrs, true); + /* Set dst_addrs->addrs[i].len=0 for dst_addrs that are unreachable with a + "::" listener. */ + test_connect(1, NULL, dst_addrs, true); /* Test connect(2) with dst_addrs. */ - test_connect(1, &channel_args, &dst_addrs, false); + test_connect(1, &channel_args, dst_addrs, false); /* Test connect(2) with dst_addrs. */ - test_connect(10, &channel_args, &dst_addrs, false); + test_connect(10, &channel_args, dst_addrs, false); grpc_closure_init(&destroyed, destroy_pollset, g_pollset, grpc_schedule_on_exec_ctx); grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed); grpc_exec_ctx_finish(&exec_ctx); grpc_shutdown(); + gpr_free(dst_addrs); gpr_free(g_pollset); return EXIT_SUCCESS; } From 18f025e0a3e56d4e698f921220e18954b14723cc Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Fri, 3 Mar 2017 01:41:34 +0000 Subject: [PATCH 20/52] Fix and enable super-init-not-called lint --- .pylintrc | 3 +-- .../grpc/framework/interfaces/base/base.py | 23 ++++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.pylintrc b/.pylintrc index f41ef6542df..6c788cd072d 100644 --- a/.pylintrc +++ b/.pylintrc @@ -34,6 +34,5 @@ notes=FIXME,XXX #TODO: Enable useless-else-on-loop #TODO: Enable too-many-return-statements #TODO: Enable too-many-nested-blocks -#TODO: Enable super-init-not-called -disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks,super-init-not-called +disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks diff --git a/src/python/grpcio/grpc/framework/interfaces/base/base.py b/src/python/grpcio/grpc/framework/interfaces/base/base.py index cb3328296c5..8e694e3f12c 100644 --- a/src/python/grpcio/grpc/framework/interfaces/base/base.py +++ b/src/python/grpcio/grpc/framework/interfaces/base/base.py @@ -50,22 +50,23 @@ from grpc.framework.foundation import abandonment # pylint: disable=unused-impo class NoSuchMethodError(Exception): """Indicates that an unrecognized operation has been called. - Attributes: - code: A code value to communicate to the other side of the operation along - with indication of operation termination. May be None. - details: A details value to communicate to the other side of the operation - along with indication of operation termination. May be None. - """ - - def __init__(self, code, details): - """Constructor. - - Args: + Attributes: code: A code value to communicate to the other side of the operation along with indication of operation termination. May be None. details: A details value to communicate to the other side of the operation along with indication of operation termination. May be None. """ + + def __init__(self, code, details): + """Constructor. + + Args: + code: A code value to communicate to the other side of the operation + along with indication of operation termination. May be None. + details: A details value to communicate to the other side of the + operation along with indication of operation termination. May be None. + """ + super(NoSuchMethodError, self).__init__() self.code = code self.details = details From db0f85b0105a598953489eebfa28385e1364bd7a Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Fri, 3 Mar 2017 05:41:50 +0000 Subject: [PATCH 21/52] Configure and enable too-many-arguments lint --- .pylintrc | 9 +++++++-- src/python/grpcio/grpc/beta/_client_adaptations.py | 2 ++ src/python/grpcio/grpc/beta/implementations.py | 2 ++ src/python/grpcio/grpc/framework/interfaces/base/base.py | 2 ++ src/python/grpcio/grpc/framework/interfaces/face/face.py | 2 ++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index 6c788cd072d..a8d14599405 100644 --- a/.pylintrc +++ b/.pylintrc @@ -3,6 +3,12 @@ # not include "unused_" and "ignored_" by default? dummy-variables-rgx=^ignored_|^unused_ +[DESIGN] +# NOTE(nathaniel): Not particularly attached to this value; it just seems to +# be what works for us at the moment (excepting the dead-code-walking Beta +# API). +max-args=6 + [MISCELLANEOUS] # NOTE(nathaniel): We are big fans of "TODO(): " and # "NOTE(): ". We do not allow "TODO:", @@ -13,7 +19,6 @@ notes=FIXME,XXX #TODO: Enable missing-docstring #TODO: Enable too-few-public-methods -#TODO: Enable too-many-arguments #TODO: Enable no-init #TODO: Enable duplicate-code #TODO: Enable invalid-name @@ -35,4 +40,4 @@ notes=FIXME,XXX #TODO: Enable too-many-return-statements #TODO: Enable too-many-nested-blocks -disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks +disable=missing-docstring,too-few-public-methods,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks diff --git a/src/python/grpcio/grpc/beta/_client_adaptations.py b/src/python/grpcio/grpc/beta/_client_adaptations.py index 901cb856124..54ed9a10d19 100644 --- a/src/python/grpcio/grpc/beta/_client_adaptations.py +++ b/src/python/grpcio/grpc/beta/_client_adaptations.py @@ -35,6 +35,8 @@ from grpc.framework.common import cardinality from grpc.framework.foundation import future from grpc.framework.interfaces.face import face +# pylint: disable=too-many-arguments + _STATUS_CODE_TO_ABORTION_KIND_AND_ABORTION_ERROR_CLASS = { grpc.StatusCode.CANCELLED: (face.Abortion.Kind.CANCELLED, face.CancellationError), diff --git a/src/python/grpcio/grpc/beta/implementations.py b/src/python/grpcio/grpc/beta/implementations.py index 0b795776890..113fd38f8a6 100644 --- a/src/python/grpcio/grpc/beta/implementations.py +++ b/src/python/grpcio/grpc/beta/implementations.py @@ -41,6 +41,8 @@ from grpc.beta import interfaces # pylint: disable=unused-import from grpc.framework.common import cardinality # pylint: disable=unused-import from grpc.framework.interfaces.face import face # pylint: disable=unused-import +# pylint: disable=too-many-arguments + ChannelCredentials = grpc.ChannelCredentials ssl_channel_credentials = grpc.ssl_channel_credentials CallCredentials = grpc.CallCredentials diff --git a/src/python/grpcio/grpc/framework/interfaces/base/base.py b/src/python/grpcio/grpc/framework/interfaces/base/base.py index 8e694e3f12c..aa80e65f57a 100644 --- a/src/python/grpcio/grpc/framework/interfaces/base/base.py +++ b/src/python/grpcio/grpc/framework/interfaces/base/base.py @@ -46,6 +46,8 @@ import six # abandonment is referenced from specification in this module. from grpc.framework.foundation import abandonment # pylint: disable=unused-import +# pylint: disable=too-many-arguments + class NoSuchMethodError(Exception): """Indicates that an unrecognized operation has been called. diff --git a/src/python/grpcio/grpc/framework/interfaces/face/face.py b/src/python/grpcio/grpc/framework/interfaces/face/face.py index 6c7e2a3af6a..c6c44fe4e4c 100644 --- a/src/python/grpcio/grpc/framework/interfaces/face/face.py +++ b/src/python/grpcio/grpc/framework/interfaces/face/face.py @@ -42,6 +42,8 @@ from grpc.framework.foundation import abandonment # pylint: disable=unused-impo from grpc.framework.foundation import future # pylint: disable=unused-import from grpc.framework.foundation import stream # pylint: disable=unused-import +# pylint: disable=too-many-arguments + class NoSuchMethodError(Exception): """Raised by customer code to indicate an unrecognized method. From c3038a5cb379d19ec1f2352ee18f0012035dd21c Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Fri, 3 Mar 2017 05:54:30 +0000 Subject: [PATCH 22/52] Suppress and enable too-many-locals lint --- .pylintrc | 3 +-- src/python/grpcio/grpc/beta/_client_adaptations.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pylintrc b/.pylintrc index a8d14599405..6f24d1bf3e6 100644 --- a/.pylintrc +++ b/.pylintrc @@ -31,7 +31,6 @@ notes=FIXME,XXX # enable cyclic-import after a 1.7-or-later pylint release that recognizes our # disable=cyclic-import suppressions. #TODO: Enable too-many-instance-attributes -#TODO: Enable too-many-locals #TODO: Enable too-many-lines #TODO: Enable redefined-variable-type #TODO: Enable next-method-called @@ -40,4 +39,4 @@ notes=FIXME,XXX #TODO: Enable too-many-return-statements #TODO: Enable too-many-nested-blocks -disable=missing-docstring,too-few-public-methods,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks +disable=missing-docstring,too-few-public-methods,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks diff --git a/src/python/grpcio/grpc/beta/_client_adaptations.py b/src/python/grpcio/grpc/beta/_client_adaptations.py index 54ed9a10d19..9b5f5766d25 100644 --- a/src/python/grpcio/grpc/beta/_client_adaptations.py +++ b/src/python/grpcio/grpc/beta/_client_adaptations.py @@ -35,7 +35,7 @@ from grpc.framework.common import cardinality from grpc.framework.foundation import future from grpc.framework.interfaces.face import face -# pylint: disable=too-many-arguments +# pylint: disable=too-many-arguments,too-many-locals _STATUS_CODE_TO_ABORTION_KIND_AND_ABORTION_ERROR_CLASS = { grpc.StatusCode.CANCELLED: (face.Abortion.Kind.CANCELLED, From 8fccf59d047ab8f837f7a12122ef81a663bd6885 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Fri, 3 Mar 2017 06:08:02 +0000 Subject: [PATCH 23/52] Enable too-many-return-statements lint --- .pylintrc | 3 +-- src/python/grpcio/grpc/beta/_server_adaptations.py | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index 6f24d1bf3e6..dbfdc737316 100644 --- a/.pylintrc +++ b/.pylintrc @@ -36,7 +36,6 @@ notes=FIXME,XXX #TODO: Enable next-method-called #TODO: Enable import-error #TODO: Enable useless-else-on-loop -#TODO: Enable too-many-return-statements #TODO: Enable too-many-nested-blocks -disable=missing-docstring,too-few-public-methods,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks +disable=missing-docstring,too-few-public-methods,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-nested-blocks diff --git a/src/python/grpcio/grpc/beta/_server_adaptations.py b/src/python/grpcio/grpc/beta/_server_adaptations.py index 81348d5d87f..ed6aa4c3efb 100644 --- a/src/python/grpcio/grpc/beta/_server_adaptations.py +++ b/src/python/grpcio/grpc/beta/_server_adaptations.py @@ -41,6 +41,8 @@ from grpc.framework.foundation import logging_pool from grpc.framework.foundation import stream from grpc.framework.interfaces.face import face +# pylint: disable=too-many-return-statements + _DEFAULT_POOL_SIZE = 8 From 3ec1366eb6cc9d6f7a00b0de8c73a5c657daf21d Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Fri, 3 Mar 2017 06:23:53 +0000 Subject: [PATCH 24/52] Enable unused-argument lint --- .pylintrc | 3 +-- src/python/grpcio/grpc/_channel.py | 10 +++------- src/python/grpcio/grpc/beta/_client_adaptations.py | 2 +- src/python/grpcio/grpc/beta/_server_adaptations.py | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.pylintrc b/.pylintrc index dbfdc737316..41027479061 100644 --- a/.pylintrc +++ b/.pylintrc @@ -25,7 +25,6 @@ notes=FIXME,XXX #TODO: Enable locally-disabled #TODO: Enable protected-access #TODO: Enable no-name-in-module -#TODO: Enable unused-argument #TODO: Enable wrong-import-order # TODO(https://github.com/PyCQA/pylint/issues/59#issuecomment-283774279): # enable cyclic-import after a 1.7-or-later pylint release that recognizes our @@ -38,4 +37,4 @@ notes=FIXME,XXX #TODO: Enable useless-else-on-loop #TODO: Enable too-many-nested-blocks -disable=missing-docstring,too-few-public-methods,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-nested-blocks +disable=missing-docstring,too-few-public-methods,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-nested-blocks diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py index b4145fee91a..4329c9934ce 100644 --- a/src/python/grpcio/grpc/_channel.py +++ b/src/python/grpcio/grpc/_channel.py @@ -237,7 +237,7 @@ def _consume_request_iterator(request_iterator, state, call, cygrpc.Operations(operations), event_handler) state.due.add(cygrpc.OperationType.send_close_from_client) - def stop_consumption_thread(timeout): + def stop_consumption_thread(timeout): # pylint: disable=unused-argument with state.condition: if state.code is None: call.cancel() @@ -736,7 +736,7 @@ def _run_channel_spin_thread(state): state.managed_calls = None return - def stop_channel_spin(timeout): + def stop_channel_spin(timeout): # pylint: disable=unused-argument with state.lock: if state.managed_calls is not None: for call in state.managed_calls: @@ -877,12 +877,8 @@ def _moot(state): def _subscribe(state, callback, try_to_connect): with state.lock: if not state.callbacks_and_connectivities and not state.polling: - - def cancel_all_subscriptions(timeout): - _moot(state) - polling_thread = _common.CleanupThread( - cancel_all_subscriptions, + lambda timeout: _moot(state), target=_poll_connectivity, args=(state, state.channel, bool(try_to_connect))) polling_thread.start() diff --git a/src/python/grpcio/grpc/beta/_client_adaptations.py b/src/python/grpcio/grpc/beta/_client_adaptations.py index 9b5f5766d25..3c69acc0195 100644 --- a/src/python/grpcio/grpc/beta/_client_adaptations.py +++ b/src/python/grpcio/grpc/beta/_client_adaptations.py @@ -35,7 +35,7 @@ from grpc.framework.common import cardinality from grpc.framework.foundation import future from grpc.framework.interfaces.face import face -# pylint: disable=too-many-arguments,too-many-locals +# pylint: disable=too-many-arguments,too-many-locals,unused-argument _STATUS_CODE_TO_ABORTION_KIND_AND_ABORTION_ERROR_CLASS = { grpc.StatusCode.CANCELLED: (face.Abortion.Kind.CANCELLED, diff --git a/src/python/grpcio/grpc/beta/_server_adaptations.py b/src/python/grpcio/grpc/beta/_server_adaptations.py index ed6aa4c3efb..cf10c26d2fe 100644 --- a/src/python/grpcio/grpc/beta/_server_adaptations.py +++ b/src/python/grpcio/grpc/beta/_server_adaptations.py @@ -181,7 +181,7 @@ def _run_request_pipe_thread(request_iterator, request_consumer, return request_consumer.terminate() - def stop_request_pipe(timeout): + def stop_request_pipe(timeout): # pylint: disable=unused-argument thread_joined.set() request_pipe_thread = _common.CleanupThread( From aa4abaa8cca03f2235fec8940832d32b2d4bcc66 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 3 Mar 2017 10:19:01 +0100 Subject: [PATCH 25/52] fix Grpc.HealthCheck and Grpc.Reflection packages --- src/csharp/Grpc.Examples/project.json | 7 +------ src/csharp/Grpc.HealthCheck/project.json | 7 +------ src/csharp/Grpc.IntegrationTesting/project.json | 5 +---- src/csharp/Grpc.Reflection/project.json | 7 +------ templates/src/csharp/Grpc.Examples/project.json.template | 7 +------ .../src/csharp/Grpc.HealthCheck/project.json.template | 7 +------ .../csharp/Grpc.IntegrationTesting/project.json.template | 5 +---- templates/src/csharp/Grpc.Reflection/project.json.template | 7 +------ 8 files changed, 8 insertions(+), 44 deletions(-) diff --git a/src/csharp/Grpc.Examples/project.json b/src/csharp/Grpc.Examples/project.json index 21a730cb229..84254e897ed 100644 --- a/src/csharp/Grpc.Examples/project.json +++ b/src/csharp/Grpc.Examples/project.json @@ -9,12 +9,7 @@ "Google.Protobuf": "3.0.0" }, "frameworks": { - "net45": { - "frameworkAssemblies": { - "System.Runtime": "", - "System.IO": "" - } - }, + "net45": {}, "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { diff --git a/src/csharp/Grpc.HealthCheck/project.json b/src/csharp/Grpc.HealthCheck/project.json index 608d6454131..ce72395a9f9 100644 --- a/src/csharp/Grpc.HealthCheck/project.json +++ b/src/csharp/Grpc.HealthCheck/project.json @@ -25,12 +25,7 @@ "Google.Protobuf": "3.0.0" }, "frameworks": { - "net45": { - "frameworkAssemblies": { - "System.Runtime": "", - "System.IO": "" - } - }, + "net45": {}, "netstandard1.5": { "dependencies": { "NETStandard.Library": "1.6.0" diff --git a/src/csharp/Grpc.IntegrationTesting/project.json b/src/csharp/Grpc.IntegrationTesting/project.json index e47b5953da0..158ffd41b05 100644 --- a/src/csharp/Grpc.IntegrationTesting/project.json +++ b/src/csharp/Grpc.IntegrationTesting/project.json @@ -62,10 +62,7 @@ }, "frameworks": { "net45": { - "frameworkAssemblies": { - "System.Runtime": "", - "System.IO": "" - } + "frameworkAssemblies": {} }, "netcoreapp1.0": { "imports": [ diff --git a/src/csharp/Grpc.Reflection/project.json b/src/csharp/Grpc.Reflection/project.json index bc4bca023af..f0897745633 100644 --- a/src/csharp/Grpc.Reflection/project.json +++ b/src/csharp/Grpc.Reflection/project.json @@ -25,12 +25,7 @@ "Google.Protobuf": "3.0.0" }, "frameworks": { - "net45": { - "frameworkAssemblies": { - "System.Runtime": "", - "System.IO": "" - } - }, + "net45": {}, "netstandard1.5": { "dependencies": { "NETStandard.Library": "1.6.0" diff --git a/templates/src/csharp/Grpc.Examples/project.json.template b/templates/src/csharp/Grpc.Examples/project.json.template index b8a8314de17..42c2f31ce5c 100644 --- a/templates/src/csharp/Grpc.Examples/project.json.template +++ b/templates/src/csharp/Grpc.Examples/project.json.template @@ -9,12 +9,7 @@ "Google.Protobuf": "3.0.0" }, "frameworks": { - "net45": { - "frameworkAssemblies": { - "System.Runtime": "", - "System.IO": "" - } - }, + "net45": {}, "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { diff --git a/templates/src/csharp/Grpc.HealthCheck/project.json.template b/templates/src/csharp/Grpc.HealthCheck/project.json.template index cba68940153..280d529e734 100644 --- a/templates/src/csharp/Grpc.HealthCheck/project.json.template +++ b/templates/src/csharp/Grpc.HealthCheck/project.json.template @@ -27,12 +27,7 @@ "Google.Protobuf": "3.0.0" }, "frameworks": { - "net45": { - "frameworkAssemblies": { - "System.Runtime": "", - "System.IO": "" - } - }, + "net45": {}, "netstandard1.5": { "dependencies": { "NETStandard.Library": "1.6.0" diff --git a/templates/src/csharp/Grpc.IntegrationTesting/project.json.template b/templates/src/csharp/Grpc.IntegrationTesting/project.json.template index 3ce94e58387..4d54e63a0e5 100644 --- a/templates/src/csharp/Grpc.IntegrationTesting/project.json.template +++ b/templates/src/csharp/Grpc.IntegrationTesting/project.json.template @@ -17,10 +17,7 @@ }, "frameworks": { "net45": { - "frameworkAssemblies": { - "System.Runtime": "", - "System.IO": "" - } + "frameworkAssemblies": {} }, "netcoreapp1.0": { "imports": [ diff --git a/templates/src/csharp/Grpc.Reflection/project.json.template b/templates/src/csharp/Grpc.Reflection/project.json.template index 8a33e1ccc97..6d1c3e891f3 100644 --- a/templates/src/csharp/Grpc.Reflection/project.json.template +++ b/templates/src/csharp/Grpc.Reflection/project.json.template @@ -27,12 +27,7 @@ "Google.Protobuf": "3.0.0" }, "frameworks": { - "net45": { - "frameworkAssemblies": { - "System.Runtime": "", - "System.IO": "" - } - }, + "net45": {}, "netstandard1.5": { "dependencies": { "NETStandard.Library": "1.6.0" From 1e66fcf159dbcb327e2ca6213458eca1ed1fb06c Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Mon, 6 Mar 2017 09:25:32 -0800 Subject: [PATCH 26/52] setting default False for use_external --- bazel/cc_grpc_library.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/cc_grpc_library.bzl b/bazel/cc_grpc_library.bzl index 94874fe9371..b9d7eb5902b 100644 --- a/bazel/cc_grpc_library.bzl +++ b/bazel/cc_grpc_library.bzl @@ -2,7 +2,7 @@ load("//:bazel/generate_cc.bzl", "generate_cc") -def cc_grpc_library(name, srcs, deps, proto_only, use_external, **kwargs): +def cc_grpc_library(name, srcs, deps, proto_only, use_external = False, **kwargs): """Generates C++ grpc classes from a .proto file. Assumes the generated classes will be used in cc_api_version = 2. From dcb71e0c21bb37505de11d120b723838816c9c93 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 6 Mar 2017 10:16:26 -0800 Subject: [PATCH 27/52] Manual changes from upmerged modifications --- src/core/ext/client_channel/http_proxy.c | 10 ++++++---- .../transport/chttp2/client/insecure/channel_create.c | 3 ++- .../chttp2/client/secure/secure_channel_create.c | 7 ++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/core/ext/client_channel/http_proxy.c b/src/core/ext/client_channel/http_proxy.c index bbe4ff550c6..e280cef101f 100644 --- a/src/core/ext/client_channel/http_proxy.c +++ b/src/core/ext/client_channel/http_proxy.c @@ -46,10 +46,11 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/support/env.h" -static char* grpc_get_http_proxy_server() { +static char* grpc_get_http_proxy_server(grpc_exec_ctx* exec_ctx) { char* uri_str = gpr_getenv("http_proxy"); if (uri_str == NULL) return NULL; - grpc_uri* uri = grpc_uri_parse(uri_str, false /* suppress_errors */); + grpc_uri* uri = + grpc_uri_parse(exec_ctx, uri_str, false /* suppress_errors */); char* proxy_name = NULL; if (uri == NULL || uri->authority == NULL) { gpr_log(GPR_ERROR, "cannot parse value of 'http_proxy' env var"); @@ -76,9 +77,10 @@ static bool proxy_mapper_map_name(grpc_exec_ctx* exec_ctx, const grpc_channel_args* args, char** name_to_resolve, grpc_channel_args** new_args) { - *name_to_resolve = grpc_get_http_proxy_server(); + *name_to_resolve = grpc_get_http_proxy_server(exec_ctx); if (*name_to_resolve == NULL) return false; - grpc_uri* uri = grpc_uri_parse(server_uri, false /* suppress_errors */); + grpc_uri* uri = + grpc_uri_parse(exec_ctx, server_uri, false /* suppress_errors */); if (uri == NULL || uri->path[0] == '\0') { gpr_log(GPR_ERROR, "'http_proxy' environment variable set, but cannot " diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.c b/src/core/ext/transport/chttp2/client/insecure/channel_create.c index 286232f277f..067ac35a5ac 100644 --- a/src/core/ext/transport/chttp2/client/insecure/channel_create.c +++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.c @@ -72,7 +72,8 @@ static grpc_channel *client_channel_factory_create_channel( grpc_arg arg; arg.type = GRPC_ARG_STRING; arg.key = GRPC_ARG_SERVER_URI; - arg.value.string = grpc_resolver_factory_add_default_prefix_if_needed(target); + arg.value.string = + grpc_resolver_factory_add_default_prefix_if_needed(exec_ctx, target); const char *to_remove[] = {GRPC_ARG_SERVER_URI}; grpc_channel_args *new_args = grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1); diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c index 825db68c650..f0c241d68ee 100644 --- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c +++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c @@ -83,7 +83,7 @@ static grpc_subchannel_args *get_secure_naming_subchannel_args( const char *server_uri_str = server_uri_arg->value.string; GPR_ASSERT(server_uri_str != NULL); grpc_uri *server_uri = - grpc_uri_parse(server_uri_str, true /* supress errors */); + grpc_uri_parse(exec_ctx, server_uri_str, true /* supress errors */); GPR_ASSERT(server_uri != NULL); const char *server_uri_path; server_uri_path = @@ -96,7 +96,7 @@ static grpc_subchannel_args *get_secure_naming_subchannel_args( const char *target_uri_str = grpc_get_subchannel_address_uri_arg(args->args); grpc_uri *target_uri = - grpc_uri_parse(target_uri_str, false /* suppress errors */); + grpc_uri_parse(exec_ctx, target_uri_str, false /* suppress errors */); GPR_ASSERT(target_uri != NULL); if (target_uri->path[0] != '\0') { // "path" may be empty const grpc_slice key = grpc_slice_from_static_string( @@ -181,7 +181,8 @@ static grpc_channel *client_channel_factory_create_channel( grpc_arg arg; arg.type = GRPC_ARG_STRING; arg.key = GRPC_ARG_SERVER_URI; - arg.value.string = grpc_resolver_factory_add_default_prefix_if_needed(target); + arg.value.string = + grpc_resolver_factory_add_default_prefix_if_needed(exec_ctx, target); const char *to_remove[] = {GRPC_ARG_SERVER_URI}; grpc_channel_args *new_args = grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1); From e067b6e119e94b097092458dca99e8b253caf64b Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 6 Mar 2017 14:46:37 -0800 Subject: [PATCH 28/52] Resolve sanity failures --- CMakeLists.txt | 5 +++-- Makefile | 4 ++-- build.yaml | 5 +++-- test/core/end2end/BUILD | 4 ++-- test/core/end2end/fixtures/h2_http_proxy.c | 2 +- .../fixtures/{http_proxy.c => http_proxy_fixture.c} | 2 +- .../fixtures/{http_proxy.h => http_proxy_fixture.h} | 0 tools/run_tests/generated/sources_and_headers.json | 9 +++++---- vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj | 4 ++-- .../grpc_test_util/grpc_test_util.vcxproj.filters | 4 ++-- .../grpc_test_util_unsecure.vcxproj | 4 ++-- .../grpc_test_util_unsecure.vcxproj.filters | 4 ++-- .../vcxproj/test/grpc_benchmark/grpc_benchmark.vcxproj | 3 +++ 13 files changed, 28 insertions(+), 22 deletions(-) rename test/core/end2end/fixtures/{http_proxy.c => http_proxy_fixture.c} (99%) rename test/core/end2end/fixtures/{http_proxy.h => http_proxy_fixture.h} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index dbc2b4b8bf6..c95085f3f15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1447,7 +1447,7 @@ add_library(grpc_test_util test/core/security/oauth2_utils.c test/core/end2end/cq_verifier.c test/core/end2end/fake_resolver.c - test/core/end2end/fixtures/http_proxy.c + test/core/end2end/fixtures/http_proxy_fixture.c test/core/end2end/fixtures/proxy.c test/core/iomgr/endpoint_tests.c test/core/util/debugger_macros.c @@ -1654,7 +1654,7 @@ if (gRPC_BUILD_TESTS) add_library(grpc_test_util_unsecure test/core/end2end/cq_verifier.c test/core/end2end/fake_resolver.c - test/core/end2end/fixtures/http_proxy.c + test/core/end2end/fixtures/http_proxy_fixture.c test/core/end2end/fixtures/proxy.c test/core/iomgr/endpoint_tests.c test/core/util/debugger_macros.c @@ -3139,6 +3139,7 @@ target_link_libraries(grpc_benchmark ${_gRPC_ALLTARGETS_LIBRARIES} benchmark grpc++ + grpc_test_util grpc ${_gRPC_GFLAGS_LIBRARIES} ) diff --git a/Makefile b/Makefile index c2d06feedd3..3701f1d48c3 100644 --- a/Makefile +++ b/Makefile @@ -3325,7 +3325,7 @@ LIBGRPC_TEST_UTIL_SRC = \ test/core/security/oauth2_utils.c \ test/core/end2end/cq_verifier.c \ test/core/end2end/fake_resolver.c \ - test/core/end2end/fixtures/http_proxy.c \ + test/core/end2end/fixtures/http_proxy_fixture.c \ test/core/end2end/fixtures/proxy.c \ test/core/iomgr/endpoint_tests.c \ test/core/util/debugger_macros.c \ @@ -3525,7 +3525,7 @@ endif LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ test/core/end2end/cq_verifier.c \ test/core/end2end/fake_resolver.c \ - test/core/end2end/fixtures/http_proxy.c \ + test/core/end2end/fixtures/http_proxy_fixture.c \ test/core/end2end/fixtures/proxy.c \ test/core/iomgr/endpoint_tests.c \ test/core/util/debugger_macros.c \ diff --git a/build.yaml b/build.yaml index a39ee9f44b6..a4333b47733 100644 --- a/build.yaml +++ b/build.yaml @@ -586,7 +586,7 @@ filegroups: headers: - test/core/end2end/cq_verifier.h - test/core/end2end/fake_resolver.h - - test/core/end2end/fixtures/http_proxy.h + - test/core/end2end/fixtures/http_proxy_fixture.h - test/core/end2end/fixtures/proxy.h - test/core/iomgr/endpoint_tests.h - test/core/util/debugger_macros.h @@ -602,7 +602,7 @@ filegroups: src: - test/core/end2end/cq_verifier.c - test/core/end2end/fake_resolver.c - - test/core/end2end/fixtures/http_proxy.c + - test/core/end2end/fixtures/http_proxy_fixture.c - test/core/end2end/fixtures/proxy.c - test/core/iomgr/endpoint_tests.c - test/core/util/debugger_macros.c @@ -1224,6 +1224,7 @@ libs: deps: - benchmark - grpc++ + - grpc_test_util - grpc - name: grpc_cli_libs build: private diff --git a/test/core/end2end/BUILD b/test/core/end2end/BUILD index a40fb8e083f..0cef7aa01df 100644 --- a/test/core/end2end/BUILD +++ b/test/core/end2end/BUILD @@ -63,8 +63,8 @@ cc_library( cc_library( name = 'http_proxy', - hdrs = ['fixtures/http_proxy.h'], - srcs = ['fixtures/http_proxy.c'], + hdrs = ['fixtures/http_proxy_fixture.h'], + srcs = ['fixtures/http_proxy_fixture.c'], copts = ['-std=c99'], deps = ['//:gpr', '//:grpc', '//test/core/util:grpc_test_util'] ) diff --git a/test/core/end2end/fixtures/h2_http_proxy.c b/test/core/end2end/fixtures/h2_http_proxy.c index 44b223664ab..55c65fa70ef 100644 --- a/test/core/end2end/fixtures/h2_http_proxy.c +++ b/test/core/end2end/fixtures/h2_http_proxy.c @@ -49,7 +49,7 @@ #include "src/core/lib/support/env.h" #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/server.h" -#include "test/core/end2end/fixtures/http_proxy.h" +#include "test/core/end2end/fixtures/http_proxy_fixture.h" #include "test/core/util/port.h" #include "test/core/util/test_config.h" diff --git a/test/core/end2end/fixtures/http_proxy.c b/test/core/end2end/fixtures/http_proxy_fixture.c similarity index 99% rename from test/core/end2end/fixtures/http_proxy.c rename to test/core/end2end/fixtures/http_proxy_fixture.c index 9ccb1263ee7..bcd1c9914b2 100644 --- a/test/core/end2end/fixtures/http_proxy.c +++ b/test/core/end2end/fixtures/http_proxy_fixture.c @@ -31,7 +31,7 @@ * */ -#include "test/core/end2end/fixtures/http_proxy.h" +#include "test/core/end2end/fixtures/http_proxy_fixture.h" #include "src/core/lib/iomgr/sockaddr.h" diff --git a/test/core/end2end/fixtures/http_proxy.h b/test/core/end2end/fixtures/http_proxy_fixture.h similarity index 100% rename from test/core/end2end/fixtures/http_proxy.h rename to test/core/end2end/fixtures/http_proxy_fixture.h diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 06fc3799e3f..9162c2af60f 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -5781,7 +5781,8 @@ "deps": [ "benchmark", "grpc", - "grpc++" + "grpc++", + "grpc_test_util" ], "headers": [ "test/cpp/microbenchmarks/fullstack_context_mutators.h", @@ -8004,7 +8005,7 @@ "headers": [ "test/core/end2end/cq_verifier.h", "test/core/end2end/fake_resolver.h", - "test/core/end2end/fixtures/http_proxy.h", + "test/core/end2end/fixtures/http_proxy_fixture.h", "test/core/end2end/fixtures/proxy.h", "test/core/iomgr/endpoint_tests.h", "test/core/util/debugger_macros.h", @@ -8026,8 +8027,8 @@ "test/core/end2end/cq_verifier.h", "test/core/end2end/fake_resolver.c", "test/core/end2end/fake_resolver.h", - "test/core/end2end/fixtures/http_proxy.c", - "test/core/end2end/fixtures/http_proxy.h", + "test/core/end2end/fixtures/http_proxy_fixture.c", + "test/core/end2end/fixtures/http_proxy_fixture.h", "test/core/end2end/fixtures/proxy.c", "test/core/end2end/fixtures/proxy.h", "test/core/iomgr/endpoint_tests.c", diff --git a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj index d08ceb68287..e7c9fb71f33 100644 --- a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj +++ b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj @@ -182,7 +182,7 @@ - + @@ -317,7 +317,7 @@ - + diff --git a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters index 3beaa80994f..3d36948aaef 100644 --- a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters @@ -22,7 +22,7 @@ test\core\end2end - + test\core\end2end\fixtures @@ -518,7 +518,7 @@ test\core\end2end - + test\core\end2end\fixtures diff --git a/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj b/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj index 5a58cae83ff..af13acef455 100644 --- a/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj @@ -149,7 +149,7 @@ - + @@ -168,7 +168,7 @@ - + diff --git a/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj.filters index 88c875cb011..4da043ea908 100644 --- a/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj.filters @@ -7,7 +7,7 @@ test\core\end2end - + test\core\end2end\fixtures @@ -54,7 +54,7 @@ test\core\end2end - + test\core\end2end\fixtures diff --git a/vsprojects/vcxproj/test/grpc_benchmark/grpc_benchmark.vcxproj b/vsprojects/vcxproj/test/grpc_benchmark/grpc_benchmark.vcxproj index 62e10bf1777..d19df9d3508 100644 --- a/vsprojects/vcxproj/test/grpc_benchmark/grpc_benchmark.vcxproj +++ b/vsprojects/vcxproj/test/grpc_benchmark/grpc_benchmark.vcxproj @@ -175,6 +175,9 @@ {C187A093-A0FE-489D-A40A-6E33DE0F9FEB} + + {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} + {29D16885-7228-4C31-81ED-5F9187C7F2A9} From c65120526ae79d1433b5fe7aa7bf843c43647a0a Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Mon, 6 Mar 2017 15:15:25 -0800 Subject: [PATCH 29/52] Use gpr_subprocess in fling_stream_test --- test/core/fling/fling_stream_test.c | 81 +++++++++++------------------ 1 file changed, 31 insertions(+), 50 deletions(-) diff --git a/test/core/fling/fling_stream_test.c b/test/core/fling/fling_stream_test.c index 7e4daaa84fe..948659ab2f4 100644 --- a/test/core/fling/fling_stream_test.c +++ b/test/core/fling/fling_stream_test.c @@ -31,22 +31,13 @@ * */ -#ifndef _POSIX_SOURCE -#define _POSIX_SOURCE -#endif - -#include -#include #include -#include #include -#include -#include -#include #include #include #include +#include #include "src/core/lib/support/string.h" #include "test/core/util/port.h" @@ -57,10 +48,7 @@ int main(int argc, char **argv) { int port = grpc_pick_unused_port_or_die(); char *args[10]; int status; - pid_t svr, cli; - /* seed rng with pid, so we don't end up with the same random numbers as a - concurrently running test binary */ - srand((unsigned)getpid()); + gpr_subprocess *svr, *cli; /* figure out where we are */ if (lslash) { memcpy(root, me, (size_t)(lslash - me)); @@ -69,45 +57,38 @@ int main(int argc, char **argv) { strcpy(root, "."); } /* start the server */ - svr = fork(); - if (svr == 0) { - gpr_asprintf(&args[0], "%s/fling_server", root); - args[1] = "--bind"; - gpr_join_host_port(&args[2], "::", port); - args[3] = "--no-secure"; - args[4] = 0; - execv(args[0], args); + gpr_asprintf(&args[0], "%s/fling_server%s", root, + gpr_subprocess_binary_extension()); + args[1] = "--bind"; + gpr_join_host_port(&args[2], "::", port); + args[3] = "--no-secure"; + svr = gpr_subprocess_create(4, (const char **)args); + gpr_free(args[0]); + gpr_free(args[2]); - gpr_free(args[0]); - gpr_free(args[2]); - return 1; - } - /* wait a little */ - sleep(2); /* start the client */ - cli = fork(); - if (cli == 0) { - gpr_asprintf(&args[0], "%s/fling_client", root); - args[1] = "--target"; - gpr_join_host_port(&args[2], "127.0.0.1", port); - args[3] = "--scenario=ping-pong-stream"; - args[4] = "--no-secure"; - args[5] = 0; - execv(args[0], args); + gpr_asprintf(&args[0], "%s/fling_client%s", root, + gpr_subprocess_binary_extension()); + args[1] = "--target"; + gpr_join_host_port(&args[2], "127.0.0.1", port); + args[3] = "--scenario=ping-pong-stream"; + args[4] = "--no-secure"; + args[5] = 0; + cli = gpr_subprocess_create(6, (const char **)args); + gpr_free(args[0]); + gpr_free(args[2]); - gpr_free(args[0]); - gpr_free(args[2]); - return 1; - } /* wait for completion */ printf("waiting for client\n"); - if (waitpid(cli, &status, 0) == -1) return 2; - if (!WIFEXITED(status)) return 4; - if (WEXITSTATUS(status)) return WEXITSTATUS(status); - printf("waiting for server\n"); - kill(svr, SIGINT); - if (waitpid(svr, &status, 0) == -1) return 2; - if (!WIFEXITED(status)) return 4; - if (WEXITSTATUS(status)) return WEXITSTATUS(status); - return 0; + if ((status = gpr_subprocess_join(cli))) { + gpr_subprocess_destroy(cli); + gpr_subprocess_destroy(svr); + return status; + } + gpr_subprocess_destroy(cli); + + gpr_subprocess_interrupt(svr); + status = gpr_subprocess_join(svr); + gpr_subprocess_destroy(svr); + return status; } From fddb01d537196e3d6bf74b346d9c16b4b7b1a533 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 22 Feb 2017 07:20:01 +0100 Subject: [PATCH 30/52] upgrade third_party/protobuf to 3.2.0 --- third_party/protobuf | 2 +- tools/run_tests/sanity/check_submodules.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/protobuf b/third_party/protobuf index a428e420727..593e917c176 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit a428e42072765993ff674fda72863c9f1aa2d268 +Subproject commit 593e917c176b5bc5aafa57bf9f6030d749d91cd5 diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index cfe4e2731c0..3c5ba16b93b 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -46,7 +46,7 @@ cat << EOF | awk '{ print $1 }' | sort > $want_submodules 886e7d75368e3f4fab3f4d0d3584e4abfc557755 third_party/boringssl-with-bazel (version_for_cocoapods_7.0-857-g886e7d7) 30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e third_party/gflags (v2.2.0) c99458533a9b4c743ed51537e25989ea55944908 third_party/googletest (release-1.7.0) - a428e42072765993ff674fda72863c9f1aa2d268 third_party/protobuf (v3.1.0-alpha-1) + 593e917c176b5bc5aafa57bf9f6030d749d91cd5 third_party/protobuf (v3.1.0-alpha-1-326-g593e917) bcad91771b7f0bff28a1cac1981d7ef2b9bcef3c third_party/thrift (bcad917) 50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8) EOF From d687e92f1c5f360710e5d4fb984464a5b4ac7fd0 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 22 Feb 2017 09:12:00 +0100 Subject: [PATCH 31/52] regenerate C# protos --- src/csharp/Grpc.IntegrationTesting/Control.cs | 497 +++++++++++++----- src/csharp/Grpc.IntegrationTesting/Empty.cs | 12 +- .../Grpc.IntegrationTesting/Messages.cs | 128 ++--- src/csharp/Grpc.IntegrationTesting/Metrics.cs | 4 +- .../Grpc.IntegrationTesting/Payloads.cs | 4 +- src/csharp/Grpc.IntegrationTesting/Stats.cs | 26 +- src/csharp/Grpc.Reflection/Reflection.cs | 98 ++-- 7 files changed, 500 insertions(+), 269 deletions(-) diff --git a/src/csharp/Grpc.IntegrationTesting/Control.cs b/src/csharp/Grpc.IntegrationTesting/Control.cs index 3f4862d5671..6c0176fb43f 100644 --- a/src/csharp/Grpc.IntegrationTesting/Control.cs +++ b/src/csharp/Grpc.IntegrationTesting/Control.cs @@ -30,63 +30,66 @@ namespace Grpc.Testing { "cnBjLnRlc3RpbmcuQ2xvc2VkTG9vcFBhcmFtc0gAEi4KB3BvaXNzb24YAiAB", "KAsyGy5ncnBjLnRlc3RpbmcuUG9pc3NvblBhcmFtc0gAQgYKBGxvYWQiQwoO", "U2VjdXJpdHlQYXJhbXMSEwoLdXNlX3Rlc3RfY2EYASABKAgSHAoUc2VydmVy", - "X2hvc3Rfb3ZlcnJpZGUYAiABKAki8AMKDENsaWVudENvbmZpZxIWCg5zZXJ2", - "ZXJfdGFyZ2V0cxgBIAMoCRItCgtjbGllbnRfdHlwZRgCIAEoDjIYLmdycGMu", - "dGVzdGluZy5DbGllbnRUeXBlEjUKD3NlY3VyaXR5X3BhcmFtcxgDIAEoCzIc", - "LmdycGMudGVzdGluZy5TZWN1cml0eVBhcmFtcxIkChxvdXRzdGFuZGluZ19y", - "cGNzX3Blcl9jaGFubmVsGAQgASgFEhcKD2NsaWVudF9jaGFubmVscxgFIAEo", - "BRIcChRhc3luY19jbGllbnRfdGhyZWFkcxgHIAEoBRInCghycGNfdHlwZRgI", - "IAEoDjIVLmdycGMudGVzdGluZy5ScGNUeXBlEi0KC2xvYWRfcGFyYW1zGAog", - "ASgLMhguZ3JwYy50ZXN0aW5nLkxvYWRQYXJhbXMSMwoOcGF5bG9hZF9jb25m", - "aWcYCyABKAsyGy5ncnBjLnRlc3RpbmcuUGF5bG9hZENvbmZpZxI3ChBoaXN0", - "b2dyYW1fcGFyYW1zGAwgASgLMh0uZ3JwYy50ZXN0aW5nLkhpc3RvZ3JhbVBh", - "cmFtcxIRCgljb3JlX2xpc3QYDSADKAUSEgoKY29yZV9saW1pdBgOIAEoBRIY", - "ChBvdGhlcl9jbGllbnRfYXBpGA8gASgJIjgKDENsaWVudFN0YXR1cxIoCgVz", - "dGF0cxgBIAEoCzIZLmdycGMudGVzdGluZy5DbGllbnRTdGF0cyIVCgRNYXJr", - "Eg0KBXJlc2V0GAEgASgIImgKCkNsaWVudEFyZ3MSKwoFc2V0dXAYASABKAsy", - "Gi5ncnBjLnRlc3RpbmcuQ2xpZW50Q29uZmlnSAASIgoEbWFyaxgCIAEoCzIS", - "LmdycGMudGVzdGluZy5NYXJrSABCCQoHYXJndHlwZSK0AgoMU2VydmVyQ29u", - "ZmlnEi0KC3NlcnZlcl90eXBlGAEgASgOMhguZ3JwYy50ZXN0aW5nLlNlcnZl", - "clR5cGUSNQoPc2VjdXJpdHlfcGFyYW1zGAIgASgLMhwuZ3JwYy50ZXN0aW5n", - "LlNlY3VyaXR5UGFyYW1zEgwKBHBvcnQYBCABKAUSHAoUYXN5bmNfc2VydmVy", - "X3RocmVhZHMYByABKAUSEgoKY29yZV9saW1pdBgIIAEoBRIzCg5wYXlsb2Fk", - "X2NvbmZpZxgJIAEoCzIbLmdycGMudGVzdGluZy5QYXlsb2FkQ29uZmlnEhEK", - "CWNvcmVfbGlzdBgKIAMoBRIYChBvdGhlcl9zZXJ2ZXJfYXBpGAsgASgJEhwK", - "E3Jlc291cmNlX3F1b3RhX3NpemUY6QcgASgFImgKClNlcnZlckFyZ3MSKwoF", - "c2V0dXAYASABKAsyGi5ncnBjLnRlc3RpbmcuU2VydmVyQ29uZmlnSAASIgoE", - "bWFyaxgCIAEoCzISLmdycGMudGVzdGluZy5NYXJrSABCCQoHYXJndHlwZSJV", - "CgxTZXJ2ZXJTdGF0dXMSKAoFc3RhdHMYASABKAsyGS5ncnBjLnRlc3Rpbmcu", - "U2VydmVyU3RhdHMSDAoEcG9ydBgCIAEoBRINCgVjb3JlcxgDIAEoBSINCgtD", - "b3JlUmVxdWVzdCIdCgxDb3JlUmVzcG9uc2USDQoFY29yZXMYASABKAUiBgoE", - "Vm9pZCL9AQoIU2NlbmFyaW8SDAoEbmFtZRgBIAEoCRIxCg1jbGllbnRfY29u", - "ZmlnGAIgASgLMhouZ3JwYy50ZXN0aW5nLkNsaWVudENvbmZpZxITCgtudW1f", - "Y2xpZW50cxgDIAEoBRIxCg1zZXJ2ZXJfY29uZmlnGAQgASgLMhouZ3JwYy50", - "ZXN0aW5nLlNlcnZlckNvbmZpZxITCgtudW1fc2VydmVycxgFIAEoBRIWCg53", - "YXJtdXBfc2Vjb25kcxgGIAEoBRIZChFiZW5jaG1hcmtfc2Vjb25kcxgHIAEo", - "BRIgChhzcGF3bl9sb2NhbF93b3JrZXJfY291bnQYCCABKAUiNgoJU2NlbmFy", - "aW9zEikKCXNjZW5hcmlvcxgBIAMoCzIWLmdycGMudGVzdGluZy5TY2VuYXJp", - "byL4AgoVU2NlbmFyaW9SZXN1bHRTdW1tYXJ5EgsKA3FwcxgBIAEoARIbChNx", - "cHNfcGVyX3NlcnZlcl9jb3JlGAIgASgBEhoKEnNlcnZlcl9zeXN0ZW1fdGlt", - "ZRgDIAEoARIYChBzZXJ2ZXJfdXNlcl90aW1lGAQgASgBEhoKEmNsaWVudF9z", - "eXN0ZW1fdGltZRgFIAEoARIYChBjbGllbnRfdXNlcl90aW1lGAYgASgBEhIK", - "CmxhdGVuY3lfNTAYByABKAESEgoKbGF0ZW5jeV85MBgIIAEoARISCgpsYXRl", - "bmN5Xzk1GAkgASgBEhIKCmxhdGVuY3lfOTkYCiABKAESEwoLbGF0ZW5jeV85", - "OTkYCyABKAESGAoQc2VydmVyX2NwdV91c2FnZRgMIAEoARImCh5zdWNjZXNz", - "ZnVsX3JlcXVlc3RzX3Blcl9zZWNvbmQYDSABKAESIgoaZmFpbGVkX3JlcXVl", - "c3RzX3Blcl9zZWNvbmQYDiABKAEigwMKDlNjZW5hcmlvUmVzdWx0EigKCHNj", - "ZW5hcmlvGAEgASgLMhYuZ3JwYy50ZXN0aW5nLlNjZW5hcmlvEi4KCWxhdGVu", - "Y2llcxgCIAEoCzIbLmdycGMudGVzdGluZy5IaXN0b2dyYW1EYXRhEi8KDGNs", - "aWVudF9zdGF0cxgDIAMoCzIZLmdycGMudGVzdGluZy5DbGllbnRTdGF0cxIv", - "CgxzZXJ2ZXJfc3RhdHMYBCADKAsyGS5ncnBjLnRlc3RpbmcuU2VydmVyU3Rh", - "dHMSFAoMc2VydmVyX2NvcmVzGAUgAygFEjQKB3N1bW1hcnkYBiABKAsyIy5n", - "cnBjLnRlc3RpbmcuU2NlbmFyaW9SZXN1bHRTdW1tYXJ5EhYKDmNsaWVudF9z", - "dWNjZXNzGAcgAygIEhYKDnNlcnZlcl9zdWNjZXNzGAggAygIEjkKD3JlcXVl", - "c3RfcmVzdWx0cxgJIAMoCzIgLmdycGMudGVzdGluZy5SZXF1ZXN0UmVzdWx0", - "Q291bnQqQQoKQ2xpZW50VHlwZRIPCgtTWU5DX0NMSUVOVBAAEhAKDEFTWU5D", - "X0NMSUVOVBABEhAKDE9USEVSX0NMSUVOVBACKlsKClNlcnZlclR5cGUSDwoL", - "U1lOQ19TRVJWRVIQABIQCgxBU1lOQ19TRVJWRVIQARIYChRBU1lOQ19HRU5F", - "UklDX1NFUlZFUhACEhAKDE9USEVSX1NFUlZFUhADKiMKB1JwY1R5cGUSCQoF", - "VU5BUlkQABINCglTVFJFQU1JTkcQAWIGcHJvdG8z")); + "X2hvc3Rfb3ZlcnJpZGUYAiABKAkiTQoKQ2hhbm5lbEFyZxIMCgRuYW1lGAEg", + "ASgJEhMKCXN0cl92YWx1ZRgCIAEoCUgAEhMKCWludF92YWx1ZRgDIAEoBUgA", + "QgcKBXZhbHVlIqAECgxDbGllbnRDb25maWcSFgoOc2VydmVyX3RhcmdldHMY", + "ASADKAkSLQoLY2xpZW50X3R5cGUYAiABKA4yGC5ncnBjLnRlc3RpbmcuQ2xp", + "ZW50VHlwZRI1Cg9zZWN1cml0eV9wYXJhbXMYAyABKAsyHC5ncnBjLnRlc3Rp", + "bmcuU2VjdXJpdHlQYXJhbXMSJAocb3V0c3RhbmRpbmdfcnBjc19wZXJfY2hh", + "bm5lbBgEIAEoBRIXCg9jbGllbnRfY2hhbm5lbHMYBSABKAUSHAoUYXN5bmNf", + "Y2xpZW50X3RocmVhZHMYByABKAUSJwoIcnBjX3R5cGUYCCABKA4yFS5ncnBj", + "LnRlc3RpbmcuUnBjVHlwZRItCgtsb2FkX3BhcmFtcxgKIAEoCzIYLmdycGMu", + "dGVzdGluZy5Mb2FkUGFyYW1zEjMKDnBheWxvYWRfY29uZmlnGAsgASgLMhsu", + "Z3JwYy50ZXN0aW5nLlBheWxvYWRDb25maWcSNwoQaGlzdG9ncmFtX3BhcmFt", + "cxgMIAEoCzIdLmdycGMudGVzdGluZy5IaXN0b2dyYW1QYXJhbXMSEQoJY29y", + "ZV9saXN0GA0gAygFEhIKCmNvcmVfbGltaXQYDiABKAUSGAoQb3RoZXJfY2xp", + "ZW50X2FwaRgPIAEoCRIuCgxjaGFubmVsX2FyZ3MYECADKAsyGC5ncnBjLnRl", + "c3RpbmcuQ2hhbm5lbEFyZyI4CgxDbGllbnRTdGF0dXMSKAoFc3RhdHMYASAB", + "KAsyGS5ncnBjLnRlc3RpbmcuQ2xpZW50U3RhdHMiFQoETWFyaxINCgVyZXNl", + "dBgBIAEoCCJoCgpDbGllbnRBcmdzEisKBXNldHVwGAEgASgLMhouZ3JwYy50", + "ZXN0aW5nLkNsaWVudENvbmZpZ0gAEiIKBG1hcmsYAiABKAsyEi5ncnBjLnRl", + "c3RpbmcuTWFya0gAQgkKB2FyZ3R5cGUitAIKDFNlcnZlckNvbmZpZxItCgtz", + "ZXJ2ZXJfdHlwZRgBIAEoDjIYLmdycGMudGVzdGluZy5TZXJ2ZXJUeXBlEjUK", + "D3NlY3VyaXR5X3BhcmFtcxgCIAEoCzIcLmdycGMudGVzdGluZy5TZWN1cml0", + "eVBhcmFtcxIMCgRwb3J0GAQgASgFEhwKFGFzeW5jX3NlcnZlcl90aHJlYWRz", + "GAcgASgFEhIKCmNvcmVfbGltaXQYCCABKAUSMwoOcGF5bG9hZF9jb25maWcY", + "CSABKAsyGy5ncnBjLnRlc3RpbmcuUGF5bG9hZENvbmZpZxIRCgljb3JlX2xp", + "c3QYCiADKAUSGAoQb3RoZXJfc2VydmVyX2FwaRgLIAEoCRIcChNyZXNvdXJj", + "ZV9xdW90YV9zaXplGOkHIAEoBSJoCgpTZXJ2ZXJBcmdzEisKBXNldHVwGAEg", + "ASgLMhouZ3JwYy50ZXN0aW5nLlNlcnZlckNvbmZpZ0gAEiIKBG1hcmsYAiAB", + "KAsyEi5ncnBjLnRlc3RpbmcuTWFya0gAQgkKB2FyZ3R5cGUiVQoMU2VydmVy", + "U3RhdHVzEigKBXN0YXRzGAEgASgLMhkuZ3JwYy50ZXN0aW5nLlNlcnZlclN0", + "YXRzEgwKBHBvcnQYAiABKAUSDQoFY29yZXMYAyABKAUiDQoLQ29yZVJlcXVl", + "c3QiHQoMQ29yZVJlc3BvbnNlEg0KBWNvcmVzGAEgASgFIgYKBFZvaWQi/QEK", + "CFNjZW5hcmlvEgwKBG5hbWUYASABKAkSMQoNY2xpZW50X2NvbmZpZxgCIAEo", + "CzIaLmdycGMudGVzdGluZy5DbGllbnRDb25maWcSEwoLbnVtX2NsaWVudHMY", + "AyABKAUSMQoNc2VydmVyX2NvbmZpZxgEIAEoCzIaLmdycGMudGVzdGluZy5T", + "ZXJ2ZXJDb25maWcSEwoLbnVtX3NlcnZlcnMYBSABKAUSFgoOd2FybXVwX3Nl", + "Y29uZHMYBiABKAUSGQoRYmVuY2htYXJrX3NlY29uZHMYByABKAUSIAoYc3Bh", + "d25fbG9jYWxfd29ya2VyX2NvdW50GAggASgFIjYKCVNjZW5hcmlvcxIpCglz", + "Y2VuYXJpb3MYASADKAsyFi5ncnBjLnRlc3RpbmcuU2NlbmFyaW8i+AIKFVNj", + "ZW5hcmlvUmVzdWx0U3VtbWFyeRILCgNxcHMYASABKAESGwoTcXBzX3Blcl9z", + "ZXJ2ZXJfY29yZRgCIAEoARIaChJzZXJ2ZXJfc3lzdGVtX3RpbWUYAyABKAES", + "GAoQc2VydmVyX3VzZXJfdGltZRgEIAEoARIaChJjbGllbnRfc3lzdGVtX3Rp", + "bWUYBSABKAESGAoQY2xpZW50X3VzZXJfdGltZRgGIAEoARISCgpsYXRlbmN5", + "XzUwGAcgASgBEhIKCmxhdGVuY3lfOTAYCCABKAESEgoKbGF0ZW5jeV85NRgJ", + "IAEoARISCgpsYXRlbmN5Xzk5GAogASgBEhMKC2xhdGVuY3lfOTk5GAsgASgB", + "EhgKEHNlcnZlcl9jcHVfdXNhZ2UYDCABKAESJgoec3VjY2Vzc2Z1bF9yZXF1", + "ZXN0c19wZXJfc2Vjb25kGA0gASgBEiIKGmZhaWxlZF9yZXF1ZXN0c19wZXJf", + "c2Vjb25kGA4gASgBIoMDCg5TY2VuYXJpb1Jlc3VsdBIoCghzY2VuYXJpbxgB", + "IAEoCzIWLmdycGMudGVzdGluZy5TY2VuYXJpbxIuCglsYXRlbmNpZXMYAiAB", + "KAsyGy5ncnBjLnRlc3RpbmcuSGlzdG9ncmFtRGF0YRIvCgxjbGllbnRfc3Rh", + "dHMYAyADKAsyGS5ncnBjLnRlc3RpbmcuQ2xpZW50U3RhdHMSLwoMc2VydmVy", + "X3N0YXRzGAQgAygLMhkuZ3JwYy50ZXN0aW5nLlNlcnZlclN0YXRzEhQKDHNl", + "cnZlcl9jb3JlcxgFIAMoBRI0CgdzdW1tYXJ5GAYgASgLMiMuZ3JwYy50ZXN0", + "aW5nLlNjZW5hcmlvUmVzdWx0U3VtbWFyeRIWCg5jbGllbnRfc3VjY2VzcxgH", + "IAMoCBIWCg5zZXJ2ZXJfc3VjY2VzcxgIIAMoCBI5Cg9yZXF1ZXN0X3Jlc3Vs", + "dHMYCSADKAsyIC5ncnBjLnRlc3RpbmcuUmVxdWVzdFJlc3VsdENvdW50KkEK", + "CkNsaWVudFR5cGUSDwoLU1lOQ19DTElFTlQQABIQCgxBU1lOQ19DTElFTlQQ", + "ARIQCgxPVEhFUl9DTElFTlQQAipbCgpTZXJ2ZXJUeXBlEg8KC1NZTkNfU0VS", + "VkVSEAASEAoMQVNZTkNfU0VSVkVSEAESGAoUQVNZTkNfR0VORVJJQ19TRVJW", + "RVIQAhIQCgxPVEhFUl9TRVJWRVIQAyojCgdScGNUeXBlEgkKBVVOQVJZEAAS", + "DQoJU1RSRUFNSU5HEAFiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Grpc.Testing.PayloadsReflection.Descriptor, global::Grpc.Testing.StatsReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.ClientType), typeof(global::Grpc.Testing.ServerType), typeof(global::Grpc.Testing.RpcType), }, new pbr::GeneratedClrTypeInfo[] { @@ -94,7 +97,8 @@ namespace Grpc.Testing { new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClosedLoopParams), global::Grpc.Testing.ClosedLoopParams.Parser, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.LoadParams), global::Grpc.Testing.LoadParams.Parser, new[]{ "ClosedLoop", "Poisson" }, new[]{ "Load" }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SecurityParams), global::Grpc.Testing.SecurityParams.Parser, new[]{ "UseTestCa", "ServerHostOverride" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientConfig), global::Grpc.Testing.ClientConfig.Parser, new[]{ "ServerTargets", "ClientType", "SecurityParams", "OutstandingRpcsPerChannel", "ClientChannels", "AsyncClientThreads", "RpcType", "LoadParams", "PayloadConfig", "HistogramParams", "CoreList", "CoreLimit", "OtherClientApi" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ChannelArg), global::Grpc.Testing.ChannelArg.Parser, new[]{ "Name", "StrValue", "IntValue" }, new[]{ "Value" }, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientConfig), global::Grpc.Testing.ClientConfig.Parser, new[]{ "ServerTargets", "ClientType", "SecurityParams", "OutstandingRpcsPerChannel", "ClientChannels", "AsyncClientThreads", "RpcType", "LoadParams", "PayloadConfig", "HistogramParams", "CoreList", "CoreLimit", "OtherClientApi", "ChannelArgs" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientStatus), global::Grpc.Testing.ClientStatus.Parser, new[]{ "Stats" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Mark), global::Grpc.Testing.Mark.Parser, new[]{ "Reset" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientArgs), global::Grpc.Testing.ClientArgs.Parser, new[]{ "Setup", "Mark" }, new[]{ "Argtype" }, null, null), @@ -116,13 +120,13 @@ namespace Grpc.Testing { #region Enums public enum ClientType { /// - /// Many languages support a basic distinction between using - /// sync or async client, and this allows the specification + /// Many languages support a basic distinction between using + /// sync or async client, and this allows the specification /// [pbr::OriginalName("SYNC_CLIENT")] SyncClient = 0, [pbr::OriginalName("ASYNC_CLIENT")] AsyncClient = 1, /// - /// used for some language-specific variants + /// used for some language-specific variants /// [pbr::OriginalName("OTHER_CLIENT")] OtherClient = 2, } @@ -132,7 +136,7 @@ namespace Grpc.Testing { [pbr::OriginalName("ASYNC_SERVER")] AsyncServer = 1, [pbr::OriginalName("ASYNC_GENERIC_SERVER")] AsyncGenericServer = 2, /// - /// used for some language-specific variants + /// used for some language-specific variants /// [pbr::OriginalName("OTHER_SERVER")] OtherServer = 3, } @@ -146,8 +150,8 @@ namespace Grpc.Testing { #region Messages /// - /// Parameters of poisson process distribution, which is a good representation - /// of activity coming in from independent identical stationary sources. + /// Parameters of poisson process distribution, which is a good representation + /// of activity coming in from independent identical stationary sources. /// public sealed partial class PoissonParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PoissonParams()); @@ -185,7 +189,7 @@ namespace Grpc.Testing { public const int OfferedLoadFieldNumber = 1; private double offeredLoad_; /// - /// The rate of arrivals (a.k.a. lambda parameter of the exp distribution). + /// The rate of arrivals (a.k.a. lambda parameter of the exp distribution). /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double OfferedLoad { @@ -270,8 +274,8 @@ namespace Grpc.Testing { } /// - /// Once an RPC finishes, immediately start a new one. - /// No configuration parameters needed. + /// Once an RPC finishes, immediately start a new one. + /// No configuration parameters needed. /// public sealed partial class ClosedLoopParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClosedLoopParams()); @@ -549,7 +553,7 @@ namespace Grpc.Testing { } /// - /// presence of SecurityParams implies use of TLS + /// presence of SecurityParams implies use of TLS /// public sealed partial class SecurityParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SecurityParams()); @@ -696,6 +700,210 @@ namespace Grpc.Testing { } + public sealed partial class ChannelArg : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChannelArg()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChannelArg() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChannelArg(ChannelArg other) : this() { + name_ = other.name_; + switch (other.ValueCase) { + case ValueOneofCase.StrValue: + StrValue = other.StrValue; + break; + case ValueOneofCase.IntValue: + IntValue = other.IntValue; + break; + } + + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ChannelArg Clone() { + return new ChannelArg(this); + } + + /// Field number for the "name" field. + public const int NameFieldNumber = 1; + private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Name { + get { return name_; } + set { + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "str_value" field. + public const int StrValueFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string StrValue { + get { return valueCase_ == ValueOneofCase.StrValue ? (string) value_ : ""; } + set { + value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + valueCase_ = ValueOneofCase.StrValue; + } + } + + /// Field number for the "int_value" field. + public const int IntValueFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int IntValue { + get { return valueCase_ == ValueOneofCase.IntValue ? (int) value_ : 0; } + set { + value_ = value; + valueCase_ = ValueOneofCase.IntValue; + } + } + + private object value_; + /// Enum of possible cases for the "value" oneof. + public enum ValueOneofCase { + None = 0, + StrValue = 2, + IntValue = 3, + } + private ValueOneofCase valueCase_ = ValueOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ValueOneofCase ValueCase { + get { return valueCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void ClearValue() { + valueCase_ = ValueOneofCase.None; + value_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ChannelArg); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ChannelArg other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Name != other.Name) return false; + if (StrValue != other.StrValue) return false; + if (IntValue != other.IntValue) return false; + if (ValueCase != other.ValueCase) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Name.Length != 0) hash ^= Name.GetHashCode(); + if (valueCase_ == ValueOneofCase.StrValue) hash ^= StrValue.GetHashCode(); + if (valueCase_ == ValueOneofCase.IntValue) hash ^= IntValue.GetHashCode(); + hash ^= (int) valueCase_; + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Name.Length != 0) { + output.WriteRawTag(10); + output.WriteString(Name); + } + if (valueCase_ == ValueOneofCase.StrValue) { + output.WriteRawTag(18); + output.WriteString(StrValue); + } + if (valueCase_ == ValueOneofCase.IntValue) { + output.WriteRawTag(24); + output.WriteInt32(IntValue); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Name.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); + } + if (valueCase_ == ValueOneofCase.StrValue) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(StrValue); + } + if (valueCase_ == ValueOneofCase.IntValue) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(IntValue); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ChannelArg other) { + if (other == null) { + return; + } + if (other.Name.Length != 0) { + Name = other.Name; + } + switch (other.ValueCase) { + case ValueOneofCase.StrValue: + StrValue = other.StrValue; + break; + case ValueOneofCase.IntValue: + IntValue = other.IntValue; + break; + } + + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + Name = input.ReadString(); + break; + } + case 18: { + StrValue = input.ReadString(); + break; + } + case 24: { + IntValue = input.ReadInt32(); + break; + } + } + } + } + + } + public sealed partial class ClientConfig : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientConfig()); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -703,7 +911,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[4]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -733,6 +941,7 @@ namespace Grpc.Testing { coreList_ = other.coreList_.Clone(); coreLimit_ = other.coreLimit_; otherClientApi_ = other.otherClientApi_; + channelArgs_ = other.channelArgs_.Clone(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -746,7 +955,7 @@ namespace Grpc.Testing { = pb::FieldCodec.ForString(10); private readonly pbc::RepeatedField serverTargets_ = new pbc::RepeatedField(); /// - /// List of targets to connect to. At least one target needs to be specified. + /// List of targets to connect to. At least one target needs to be specified. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField ServerTargets { @@ -779,8 +988,8 @@ namespace Grpc.Testing { public const int OutstandingRpcsPerChannelFieldNumber = 4; private int outstandingRpcsPerChannel_; /// - /// How many concurrent RPCs to start for each channel. - /// For synchronous client, use a separate thread for each outstanding RPC. + /// How many concurrent RPCs to start for each channel. + /// For synchronous client, use a separate thread for each outstanding RPC. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int OutstandingRpcsPerChannel { @@ -794,8 +1003,8 @@ namespace Grpc.Testing { public const int ClientChannelsFieldNumber = 5; private int clientChannels_; /// - /// Number of independent client channels to create. - /// i-th channel will connect to server_target[i % server_targets.size()] + /// Number of independent client channels to create. + /// i-th channel will connect to server_target[i % server_targets.size()] /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int ClientChannels { @@ -809,7 +1018,7 @@ namespace Grpc.Testing { public const int AsyncClientThreadsFieldNumber = 7; private int asyncClientThreads_; /// - /// Only for async client. Number of threads to use to start/manage RPCs. + /// Only for async client. Number of threads to use to start/manage RPCs. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int AsyncClientThreads { @@ -834,7 +1043,7 @@ namespace Grpc.Testing { public const int LoadParamsFieldNumber = 10; private global::Grpc.Testing.LoadParams loadParams_; /// - /// The requested load for the entire client (aggregated over all the threads). + /// The requested load for the entire client (aggregated over all the threads). /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.LoadParams LoadParams { @@ -872,7 +1081,7 @@ namespace Grpc.Testing { = pb::FieldCodec.ForInt32(106); private readonly pbc::RepeatedField coreList_ = new pbc::RepeatedField(); /// - /// Specify the cores we should run the client on, if desired + /// Specify the cores we should run the client on, if desired /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField CoreList { @@ -894,7 +1103,7 @@ namespace Grpc.Testing { public const int OtherClientApiFieldNumber = 15; private string otherClientApi_ = ""; /// - /// If we use an OTHER_CLIENT client_type, this string gives more detail + /// If we use an OTHER_CLIENT client_type, this string gives more detail /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string OtherClientApi { @@ -904,6 +1113,16 @@ namespace Grpc.Testing { } } + /// Field number for the "channel_args" field. + public const int ChannelArgsFieldNumber = 16; + private static readonly pb::FieldCodec _repeated_channelArgs_codec + = pb::FieldCodec.ForMessage(130, global::Grpc.Testing.ChannelArg.Parser); + private readonly pbc::RepeatedField channelArgs_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ChannelArgs { + get { return channelArgs_; } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ClientConfig); @@ -930,6 +1149,7 @@ namespace Grpc.Testing { if(!coreList_.Equals(other.coreList_)) return false; if (CoreLimit != other.CoreLimit) return false; if (OtherClientApi != other.OtherClientApi) return false; + if(!channelArgs_.Equals(other.channelArgs_)) return false; return true; } @@ -949,6 +1169,7 @@ namespace Grpc.Testing { hash ^= coreList_.GetHashCode(); if (CoreLimit != 0) hash ^= CoreLimit.GetHashCode(); if (OtherClientApi.Length != 0) hash ^= OtherClientApi.GetHashCode(); + hash ^= channelArgs_.GetHashCode(); return hash; } @@ -1005,6 +1226,7 @@ namespace Grpc.Testing { output.WriteRawTag(122); output.WriteString(OtherClientApi); } + channelArgs_.WriteTo(output, _repeated_channelArgs_codec); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1045,6 +1267,7 @@ namespace Grpc.Testing { if (OtherClientApi.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(OtherClientApi); } + size += channelArgs_.CalculateSize(_repeated_channelArgs_codec); return size; } @@ -1100,6 +1323,7 @@ namespace Grpc.Testing { if (other.OtherClientApi.Length != 0) { OtherClientApi = other.OtherClientApi; } + channelArgs_.Add(other.channelArgs_); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1175,6 +1399,10 @@ namespace Grpc.Testing { OtherClientApi = input.ReadString(); break; } + case 130: { + channelArgs_.AddEntriesFrom(input, _repeated_channelArgs_codec); + break; + } } } } @@ -1188,7 +1416,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[5]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1305,7 +1533,7 @@ namespace Grpc.Testing { } /// - /// Request current stats + /// Request current stats /// public sealed partial class Mark : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Mark()); @@ -1314,7 +1542,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[6]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1343,7 +1571,7 @@ namespace Grpc.Testing { public const int ResetFieldNumber = 1; private bool reset_; /// - /// if true, the stats will be reset after taking their snapshot. + /// if true, the stats will be reset after taking their snapshot. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Reset { @@ -1434,7 +1662,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[7]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1620,7 +1848,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[8]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1679,7 +1907,7 @@ namespace Grpc.Testing { public const int PortFieldNumber = 4; private int port_; /// - /// Port on which to listen. Zero means pick unused port. + /// Port on which to listen. Zero means pick unused port. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Port { @@ -1693,7 +1921,7 @@ namespace Grpc.Testing { public const int AsyncServerThreadsFieldNumber = 7; private int asyncServerThreads_; /// - /// Only for async server. Number of threads used to serve the requests. + /// Only for async server. Number of threads used to serve the requests. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int AsyncServerThreads { @@ -1707,7 +1935,7 @@ namespace Grpc.Testing { public const int CoreLimitFieldNumber = 8; private int coreLimit_; /// - /// Specify the number of cores to limit server to, if desired + /// Specify the number of cores to limit server to, if desired /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CoreLimit { @@ -1721,7 +1949,10 @@ namespace Grpc.Testing { public const int PayloadConfigFieldNumber = 9; private global::Grpc.Testing.PayloadConfig payloadConfig_; /// - /// payload config, used in generic server + /// payload config, used in generic server. + /// Note this must NOT be used in proto (non-generic) servers. For proto servers, + /// 'response sizes' must be configured from the 'response_size' field of the + /// 'SimpleRequest' objects in RPC requests. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.PayloadConfig PayloadConfig { @@ -1737,7 +1968,7 @@ namespace Grpc.Testing { = pb::FieldCodec.ForInt32(82); private readonly pbc::RepeatedField coreList_ = new pbc::RepeatedField(); /// - /// Specify the cores we should run the server on, if desired + /// Specify the cores we should run the server on, if desired /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField CoreList { @@ -1748,7 +1979,7 @@ namespace Grpc.Testing { public const int OtherServerApiFieldNumber = 11; private string otherServerApi_ = ""; /// - /// If we use an OTHER_SERVER client_type, this string gives more detail + /// If we use an OTHER_SERVER client_type, this string gives more detail /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string OtherServerApi { @@ -1762,7 +1993,7 @@ namespace Grpc.Testing { public const int ResourceQuotaSizeFieldNumber = 1001; private int resourceQuotaSize_; /// - /// Buffer pool size (no buffer pool specified if unset) + /// Buffer pool size (no buffer pool specified if unset) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int ResourceQuotaSize { @@ -1987,7 +2218,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[9]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2173,7 +2404,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[10]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2215,7 +2446,7 @@ namespace Grpc.Testing { public const int PortFieldNumber = 2; private int port_; /// - /// the port bound by the server + /// the port bound by the server /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Port { @@ -2229,7 +2460,7 @@ namespace Grpc.Testing { public const int CoresFieldNumber = 3; private int cores_; /// - /// Number of cores available to the server + /// Number of cores available to the server /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Cores { @@ -2358,7 +2589,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[11]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2447,7 +2678,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[12]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2476,7 +2707,7 @@ namespace Grpc.Testing { public const int CoresFieldNumber = 1; private int cores_; /// - /// Number of cores available on the server + /// Number of cores available on the server /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Cores { @@ -2567,7 +2798,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[13]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[14]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2650,7 +2881,7 @@ namespace Grpc.Testing { } /// - /// A single performance scenario: input to qps_json_driver + /// A single performance scenario: input to qps_json_driver /// public sealed partial class Scenario : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Scenario()); @@ -2659,7 +2890,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[14]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[15]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2695,7 +2926,7 @@ namespace Grpc.Testing { public const int NameFieldNumber = 1; private string name_ = ""; /// - /// Human readable name for this scenario + /// Human readable name for this scenario /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Name { @@ -2709,7 +2940,7 @@ namespace Grpc.Testing { public const int ClientConfigFieldNumber = 2; private global::Grpc.Testing.ClientConfig clientConfig_; /// - /// Client configuration + /// Client configuration /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ClientConfig ClientConfig { @@ -2723,7 +2954,7 @@ namespace Grpc.Testing { public const int NumClientsFieldNumber = 3; private int numClients_; /// - /// Number of clients to start for the test + /// Number of clients to start for the test /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int NumClients { @@ -2737,7 +2968,7 @@ namespace Grpc.Testing { public const int ServerConfigFieldNumber = 4; private global::Grpc.Testing.ServerConfig serverConfig_; /// - /// Server configuration + /// Server configuration /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ServerConfig ServerConfig { @@ -2751,7 +2982,7 @@ namespace Grpc.Testing { public const int NumServersFieldNumber = 5; private int numServers_; /// - /// Number of servers to start for the test + /// Number of servers to start for the test /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int NumServers { @@ -2765,7 +2996,7 @@ namespace Grpc.Testing { public const int WarmupSecondsFieldNumber = 6; private int warmupSeconds_; /// - /// Warmup period, in seconds + /// Warmup period, in seconds /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int WarmupSeconds { @@ -2779,7 +3010,7 @@ namespace Grpc.Testing { public const int BenchmarkSecondsFieldNumber = 7; private int benchmarkSeconds_; /// - /// Benchmark time, in seconds + /// Benchmark time, in seconds /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int BenchmarkSeconds { @@ -2793,7 +3024,7 @@ namespace Grpc.Testing { public const int SpawnLocalWorkerCountFieldNumber = 8; private int spawnLocalWorkerCount_; /// - /// Number of workers to spawn locally (usually zero) + /// Number of workers to spawn locally (usually zero) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int SpawnLocalWorkerCount { @@ -3002,7 +3233,7 @@ namespace Grpc.Testing { } /// - /// A set of scenarios to be run with qps_json_driver + /// A set of scenarios to be run with qps_json_driver /// public sealed partial class Scenarios : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Scenarios()); @@ -3011,7 +3242,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[15]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[16]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3114,8 +3345,8 @@ namespace Grpc.Testing { } /// - /// Basic summary that can be computed from ClientStats and ServerStats - /// once the scenario has finished. + /// Basic summary that can be computed from ClientStats and ServerStats + /// once the scenario has finished. /// public sealed partial class ScenarioResultSummary : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScenarioResultSummary()); @@ -3124,7 +3355,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[16]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[17]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3166,7 +3397,7 @@ namespace Grpc.Testing { public const int QpsFieldNumber = 1; private double qps_; /// - /// Total number of operations per second over all clients. + /// Total number of operations per second over all clients. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Qps { @@ -3180,7 +3411,7 @@ namespace Grpc.Testing { public const int QpsPerServerCoreFieldNumber = 2; private double qpsPerServerCore_; /// - /// QPS per one server core. + /// QPS per one server core. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double QpsPerServerCore { @@ -3194,7 +3425,7 @@ namespace Grpc.Testing { public const int ServerSystemTimeFieldNumber = 3; private double serverSystemTime_; /// - /// server load based on system_time (0.85 => 85%) + /// server load based on system_time (0.85 => 85%) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double ServerSystemTime { @@ -3208,7 +3439,7 @@ namespace Grpc.Testing { public const int ServerUserTimeFieldNumber = 4; private double serverUserTime_; /// - /// server load based on user_time (0.85 => 85%) + /// server load based on user_time (0.85 => 85%) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double ServerUserTime { @@ -3222,7 +3453,7 @@ namespace Grpc.Testing { public const int ClientSystemTimeFieldNumber = 5; private double clientSystemTime_; /// - /// client load based on system_time (0.85 => 85%) + /// client load based on system_time (0.85 => 85%) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double ClientSystemTime { @@ -3236,7 +3467,7 @@ namespace Grpc.Testing { public const int ClientUserTimeFieldNumber = 6; private double clientUserTime_; /// - /// client load based on user_time (0.85 => 85%) + /// client load based on user_time (0.85 => 85%) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double ClientUserTime { @@ -3250,7 +3481,7 @@ namespace Grpc.Testing { public const int Latency50FieldNumber = 7; private double latency50_; /// - /// X% latency percentiles (in nanoseconds) + /// X% latency percentiles (in nanoseconds) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Latency50 { @@ -3308,7 +3539,7 @@ namespace Grpc.Testing { public const int ServerCpuUsageFieldNumber = 12; private double serverCpuUsage_; /// - /// server cpu usage percentage + /// server cpu usage percentage /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double ServerCpuUsage { @@ -3322,7 +3553,7 @@ namespace Grpc.Testing { public const int SuccessfulRequestsPerSecondFieldNumber = 13; private double successfulRequestsPerSecond_; /// - /// Number of requests that succeeded/failed + /// Number of requests that succeeded/failed /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double SuccessfulRequestsPerSecond { @@ -3626,7 +3857,7 @@ namespace Grpc.Testing { } /// - /// Results of a single benchmark scenario. + /// Results of a single benchmark scenario. /// public sealed partial class ScenarioResult : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScenarioResult()); @@ -3635,7 +3866,7 @@ namespace Grpc.Testing { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { - get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[17]; } + get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[18]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3672,7 +3903,7 @@ namespace Grpc.Testing { public const int ScenarioFieldNumber = 1; private global::Grpc.Testing.Scenario scenario_; /// - /// Inputs used to run the scenario. + /// Inputs used to run the scenario. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Scenario Scenario { @@ -3686,7 +3917,7 @@ namespace Grpc.Testing { public const int LatenciesFieldNumber = 2; private global::Grpc.Testing.HistogramData latencies_; /// - /// Histograms from all clients merged into one histogram. + /// Histograms from all clients merged into one histogram. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.HistogramData Latencies { @@ -3702,7 +3933,7 @@ namespace Grpc.Testing { = pb::FieldCodec.ForMessage(26, global::Grpc.Testing.ClientStats.Parser); private readonly pbc::RepeatedField clientStats_ = new pbc::RepeatedField(); /// - /// Client stats for each client + /// Client stats for each client /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField ClientStats { @@ -3715,7 +3946,7 @@ namespace Grpc.Testing { = pb::FieldCodec.ForMessage(34, global::Grpc.Testing.ServerStats.Parser); private readonly pbc::RepeatedField serverStats_ = new pbc::RepeatedField(); /// - /// Server stats for each server + /// Server stats for each server /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField ServerStats { @@ -3728,7 +3959,7 @@ namespace Grpc.Testing { = pb::FieldCodec.ForInt32(42); private readonly pbc::RepeatedField serverCores_ = new pbc::RepeatedField(); /// - /// Number of cores available to each server + /// Number of cores available to each server /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField ServerCores { @@ -3739,7 +3970,7 @@ namespace Grpc.Testing { public const int SummaryFieldNumber = 6; private global::Grpc.Testing.ScenarioResultSummary summary_; /// - /// An after-the-fact computed summary + /// An after-the-fact computed summary /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ScenarioResultSummary Summary { @@ -3755,7 +3986,7 @@ namespace Grpc.Testing { = pb::FieldCodec.ForBool(58); private readonly pbc::RepeatedField clientSuccess_ = new pbc::RepeatedField(); /// - /// Information on success or failure of each worker + /// Information on success or failure of each worker /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField ClientSuccess { @@ -3778,7 +4009,7 @@ namespace Grpc.Testing { = pb::FieldCodec.ForMessage(74, global::Grpc.Testing.RequestResultCount.Parser); private readonly pbc::RepeatedField requestResults_ = new pbc::RepeatedField(); /// - /// Number of failed requests (one row per status code seen) + /// Number of failed requests (one row per status code seen) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField RequestResults { diff --git a/src/csharp/Grpc.IntegrationTesting/Empty.cs b/src/csharp/Grpc.IntegrationTesting/Empty.cs index 3017e664b90..24ffd617417 100644 --- a/src/csharp/Grpc.IntegrationTesting/Empty.cs +++ b/src/csharp/Grpc.IntegrationTesting/Empty.cs @@ -35,13 +35,13 @@ namespace Grpc.Testing { } #region Messages /// - /// An empty message that you can re-use to avoid defining duplicated empty - /// messages in your project. A typical example is to use it as argument or the - /// return value of a service API. For instance: + /// An empty message that you can re-use to avoid defining duplicated empty + /// messages in your project. A typical example is to use it as argument or the + /// return value of a service API. For instance: /// - /// service Foo { - /// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { }; - /// }; + /// service Foo { + /// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { }; + /// }; /// public sealed partial class Empty : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Empty()); diff --git a/src/csharp/Grpc.IntegrationTesting/Messages.cs b/src/csharp/Grpc.IntegrationTesting/Messages.cs index 369fe738d6c..278ef662e47 100644 --- a/src/csharp/Grpc.IntegrationTesting/Messages.cs +++ b/src/csharp/Grpc.IntegrationTesting/Messages.cs @@ -75,12 +75,12 @@ namespace Grpc.Testing { } #region Enums /// - /// DEPRECATED, don't use. To be removed shortly. - /// The type of payload that should be returned. + /// DEPRECATED, don't use. To be removed shortly. + /// The type of payload that should be returned. /// public enum PayloadType { /// - /// Compressable text format. + /// Compressable text format. /// [pbr::OriginalName("COMPRESSABLE")] Compressable = 0, } @@ -89,9 +89,9 @@ namespace Grpc.Testing { #region Messages /// - /// TODO(dgq): Go back to using well-known types once - /// https://github.com/grpc/grpc/issues/6980 has been fixed. - /// import "google/protobuf/wrappers.proto"; + /// TODO(dgq): Go back to using well-known types once + /// https://github.com/grpc/grpc/issues/6980 has been fixed. + /// import "google/protobuf/wrappers.proto"; /// public sealed partial class BoolValue : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoolValue()); @@ -129,7 +129,7 @@ namespace Grpc.Testing { public const int ValueFieldNumber = 1; private bool value_; /// - /// The bool value. + /// The bool value. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Value { @@ -214,7 +214,7 @@ namespace Grpc.Testing { } /// - /// A block of data, to simply increase gRPC message size. + /// A block of data, to simply increase gRPC message size. /// public sealed partial class Payload : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Payload()); @@ -253,8 +253,8 @@ namespace Grpc.Testing { public const int TypeFieldNumber = 1; private global::Grpc.Testing.PayloadType type_ = 0; /// - /// DEPRECATED, don't use. To be removed shortly. - /// The type of data in body. + /// DEPRECATED, don't use. To be removed shortly. + /// The type of data in body. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.PayloadType Type { @@ -268,7 +268,7 @@ namespace Grpc.Testing { public const int BodyFieldNumber = 2; private pb::ByteString body_ = pb::ByteString.Empty; /// - /// Primary contents of payload. + /// Primary contents of payload. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pb::ByteString Body { @@ -369,8 +369,8 @@ namespace Grpc.Testing { } /// - /// A protobuf representation for grpc status. This is used by test - /// clients to specify a status that the server should attempt to return. + /// A protobuf representation for grpc status. This is used by test + /// clients to specify a status that the server should attempt to return. /// public sealed partial class EchoStatus : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EchoStatus()); @@ -518,7 +518,7 @@ namespace Grpc.Testing { } /// - /// Unary request. + /// Unary request. /// public sealed partial class SimpleRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimpleRequest()); @@ -563,9 +563,9 @@ namespace Grpc.Testing { public const int ResponseTypeFieldNumber = 1; private global::Grpc.Testing.PayloadType responseType_ = 0; /// - /// DEPRECATED, don't use. To be removed shortly. - /// Desired payload type in the response from the server. - /// If response_type is RANDOM, server randomly chooses one from other formats. + /// DEPRECATED, don't use. To be removed shortly. + /// Desired payload type in the response from the server. + /// If response_type is RANDOM, server randomly chooses one from other formats. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.PayloadType ResponseType { @@ -579,7 +579,7 @@ namespace Grpc.Testing { public const int ResponseSizeFieldNumber = 2; private int responseSize_; /// - /// Desired payload size in the response from the server. + /// Desired payload size in the response from the server. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int ResponseSize { @@ -593,7 +593,7 @@ namespace Grpc.Testing { public const int PayloadFieldNumber = 3; private global::Grpc.Testing.Payload payload_; /// - /// Optional input payload sent along with the request. + /// Optional input payload sent along with the request. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Payload Payload { @@ -607,7 +607,7 @@ namespace Grpc.Testing { public const int FillUsernameFieldNumber = 4; private bool fillUsername_; /// - /// Whether SimpleResponse should include username. + /// Whether SimpleResponse should include username. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool FillUsername { @@ -621,7 +621,7 @@ namespace Grpc.Testing { public const int FillOauthScopeFieldNumber = 5; private bool fillOauthScope_; /// - /// Whether SimpleResponse should include OAuth scope. + /// Whether SimpleResponse should include OAuth scope. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool FillOauthScope { @@ -635,10 +635,10 @@ namespace Grpc.Testing { public const int ResponseCompressedFieldNumber = 6; private global::Grpc.Testing.BoolValue responseCompressed_; /// - /// Whether to request the server to compress the response. This field is - /// "nullable" in order to interoperate seamlessly with clients not able to - /// implement the full compression tests by introspecting the call to verify - /// the response's compression status. + /// Whether to request the server to compress the response. This field is + /// "nullable" in order to interoperate seamlessly with clients not able to + /// implement the full compression tests by introspecting the call to verify + /// the response's compression status. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.BoolValue ResponseCompressed { @@ -652,7 +652,7 @@ namespace Grpc.Testing { public const int ResponseStatusFieldNumber = 7; private global::Grpc.Testing.EchoStatus responseStatus_; /// - /// Whether server should return a given status + /// Whether server should return a given status /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.EchoStatus ResponseStatus { @@ -666,7 +666,7 @@ namespace Grpc.Testing { public const int ExpectCompressedFieldNumber = 8; private global::Grpc.Testing.BoolValue expectCompressed_; /// - /// Whether the server should expect this request to be compressed. + /// Whether the server should expect this request to be compressed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.BoolValue ExpectCompressed { @@ -887,7 +887,7 @@ namespace Grpc.Testing { } /// - /// Unary response, as configured by the request. + /// Unary response, as configured by the request. /// public sealed partial class SimpleResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimpleResponse()); @@ -927,7 +927,7 @@ namespace Grpc.Testing { public const int PayloadFieldNumber = 1; private global::Grpc.Testing.Payload payload_; /// - /// Payload to increase message size. + /// Payload to increase message size. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Payload Payload { @@ -941,8 +941,8 @@ namespace Grpc.Testing { public const int UsernameFieldNumber = 2; private string username_ = ""; /// - /// The user the request came from, for verifying authentication was - /// successful when the client expected it. + /// The user the request came from, for verifying authentication was + /// successful when the client expected it. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Username { @@ -956,7 +956,7 @@ namespace Grpc.Testing { public const int OauthScopeFieldNumber = 3; private string oauthScope_ = ""; /// - /// OAuth scope. + /// OAuth scope. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string OauthScope { @@ -1079,7 +1079,7 @@ namespace Grpc.Testing { } /// - /// Client-streaming request. + /// Client-streaming request. /// public sealed partial class StreamingInputCallRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingInputCallRequest()); @@ -1118,7 +1118,7 @@ namespace Grpc.Testing { public const int PayloadFieldNumber = 1; private global::Grpc.Testing.Payload payload_; /// - /// Optional input payload sent along with the request. + /// Optional input payload sent along with the request. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Payload Payload { @@ -1132,10 +1132,10 @@ namespace Grpc.Testing { public const int ExpectCompressedFieldNumber = 2; private global::Grpc.Testing.BoolValue expectCompressed_; /// - /// Whether the server should expect this request to be compressed. This field - /// is "nullable" in order to interoperate seamlessly with servers not able to - /// implement the full compression tests by introspecting the call to verify - /// the request's compression status. + /// Whether the server should expect this request to be compressed. This field + /// is "nullable" in order to interoperate seamlessly with servers not able to + /// implement the full compression tests by introspecting the call to verify + /// the request's compression status. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.BoolValue ExpectCompressed { @@ -1248,7 +1248,7 @@ namespace Grpc.Testing { } /// - /// Client-streaming response. + /// Client-streaming response. /// public sealed partial class StreamingInputCallResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingInputCallResponse()); @@ -1286,7 +1286,7 @@ namespace Grpc.Testing { public const int AggregatedPayloadSizeFieldNumber = 1; private int aggregatedPayloadSize_; /// - /// Aggregated size of payloads received from the client. + /// Aggregated size of payloads received from the client. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int AggregatedPayloadSize { @@ -1371,7 +1371,7 @@ namespace Grpc.Testing { } /// - /// Configuration for a particular response. + /// Configuration for a particular response. /// public sealed partial class ResponseParameters : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResponseParameters()); @@ -1411,7 +1411,7 @@ namespace Grpc.Testing { public const int SizeFieldNumber = 1; private int size_; /// - /// Desired payload sizes in responses from the server. + /// Desired payload sizes in responses from the server. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Size { @@ -1425,8 +1425,8 @@ namespace Grpc.Testing { public const int IntervalUsFieldNumber = 2; private int intervalUs_; /// - /// Desired interval between consecutive responses in the response stream in - /// microseconds. + /// Desired interval between consecutive responses in the response stream in + /// microseconds. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int IntervalUs { @@ -1440,10 +1440,10 @@ namespace Grpc.Testing { public const int CompressedFieldNumber = 3; private global::Grpc.Testing.BoolValue compressed_; /// - /// Whether to request the server to compress the response. This field is - /// "nullable" in order to interoperate seamlessly with clients not able to - /// implement the full compression tests by introspecting the call to verify - /// the response's compression status. + /// Whether to request the server to compress the response. This field is + /// "nullable" in order to interoperate seamlessly with clients not able to + /// implement the full compression tests by introspecting the call to verify + /// the response's compression status. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.BoolValue Compressed { @@ -1566,7 +1566,7 @@ namespace Grpc.Testing { } /// - /// Server-streaming request. + /// Server-streaming request. /// public sealed partial class StreamingOutputCallRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingOutputCallRequest()); @@ -1607,11 +1607,11 @@ namespace Grpc.Testing { public const int ResponseTypeFieldNumber = 1; private global::Grpc.Testing.PayloadType responseType_ = 0; /// - /// DEPRECATED, don't use. To be removed shortly. - /// Desired payload type in the response from the server. - /// If response_type is RANDOM, the payload from each response in the stream - /// might be of different types. This is to simulate a mixed type of payload - /// stream. + /// DEPRECATED, don't use. To be removed shortly. + /// Desired payload type in the response from the server. + /// If response_type is RANDOM, the payload from each response in the stream + /// might be of different types. This is to simulate a mixed type of payload + /// stream. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.PayloadType ResponseType { @@ -1627,7 +1627,7 @@ namespace Grpc.Testing { = pb::FieldCodec.ForMessage(18, global::Grpc.Testing.ResponseParameters.Parser); private readonly pbc::RepeatedField responseParameters_ = new pbc::RepeatedField(); /// - /// Configuration for each expected response message. + /// Configuration for each expected response message. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField ResponseParameters { @@ -1638,7 +1638,7 @@ namespace Grpc.Testing { public const int PayloadFieldNumber = 3; private global::Grpc.Testing.Payload payload_; /// - /// Optional input payload sent along with the request. + /// Optional input payload sent along with the request. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Payload Payload { @@ -1652,7 +1652,7 @@ namespace Grpc.Testing { public const int ResponseStatusFieldNumber = 7; private global::Grpc.Testing.EchoStatus responseStatus_; /// - /// Whether server should return a given status + /// Whether server should return a given status /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.EchoStatus ResponseStatus { @@ -1790,7 +1790,7 @@ namespace Grpc.Testing { } /// - /// Server-streaming response, as configured by the request and parameters. + /// Server-streaming response, as configured by the request and parameters. /// public sealed partial class StreamingOutputCallResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingOutputCallResponse()); @@ -1828,7 +1828,7 @@ namespace Grpc.Testing { public const int PayloadFieldNumber = 1; private global::Grpc.Testing.Payload payload_; /// - /// Payload to increase response size. + /// Payload to increase response size. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Payload Payload { @@ -1919,8 +1919,8 @@ namespace Grpc.Testing { } /// - /// For reconnect interop test only. - /// Client tells server what reconnection parameters it used. + /// For reconnect interop test only. + /// Client tells server what reconnection parameters it used. /// public sealed partial class ReconnectParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReconnectParams()); @@ -2040,9 +2040,9 @@ namespace Grpc.Testing { } /// - /// For reconnect interop test only. - /// Server tells client whether its reconnects are following the spec and the - /// reconnect backoffs it saw. + /// For reconnect interop test only. + /// Server tells client whether its reconnects are following the spec and the + /// reconnect backoffs it saw. /// public sealed partial class ReconnectInfo : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReconnectInfo()); diff --git a/src/csharp/Grpc.IntegrationTesting/Metrics.cs b/src/csharp/Grpc.IntegrationTesting/Metrics.cs index 4de1847e5fb..84eb09af4fb 100644 --- a/src/csharp/Grpc.IntegrationTesting/Metrics.cs +++ b/src/csharp/Grpc.IntegrationTesting/Metrics.cs @@ -44,7 +44,7 @@ namespace Grpc.Testing { } #region Messages /// - /// Reponse message containing the gauge name and value + /// Reponse message containing the gauge name and value /// public sealed partial class GaugeResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GaugeResponse()); @@ -282,7 +282,7 @@ namespace Grpc.Testing { } /// - /// Request message containing the gauge name + /// Request message containing the gauge name /// public sealed partial class GaugeRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GaugeRequest()); diff --git a/src/csharp/Grpc.IntegrationTesting/Payloads.cs b/src/csharp/Grpc.IntegrationTesting/Payloads.cs index 7aef35cda31..f918b9576bd 100644 --- a/src/csharp/Grpc.IntegrationTesting/Payloads.cs +++ b/src/csharp/Grpc.IntegrationTesting/Payloads.cs @@ -335,8 +335,8 @@ namespace Grpc.Testing { } /// - /// TODO (vpai): Fill this in once the details of complex, representative - /// protos are decided + /// TODO (vpai): Fill this in once the details of complex, representative + /// protos are decided /// public sealed partial class ComplexProtoParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexProtoParams()); diff --git a/src/csharp/Grpc.IntegrationTesting/Stats.cs b/src/csharp/Grpc.IntegrationTesting/Stats.cs index 504aa11d8a7..79ff220436a 100644 --- a/src/csharp/Grpc.IntegrationTesting/Stats.cs +++ b/src/csharp/Grpc.IntegrationTesting/Stats.cs @@ -90,7 +90,7 @@ namespace Grpc.Testing { public const int TimeElapsedFieldNumber = 1; private double timeElapsed_; /// - /// wall clock time change in seconds since last reset + /// wall clock time change in seconds since last reset /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double TimeElapsed { @@ -104,7 +104,7 @@ namespace Grpc.Testing { public const int TimeUserFieldNumber = 2; private double timeUser_; /// - /// change in user time (in seconds) used by the server since last reset + /// change in user time (in seconds) used by the server since last reset /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double TimeUser { @@ -118,8 +118,8 @@ namespace Grpc.Testing { public const int TimeSystemFieldNumber = 3; private double timeSystem_; /// - /// change in server time (in seconds) used by the server process and all - /// threads since last reset + /// change in server time (in seconds) used by the server process and all + /// threads since last reset /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double TimeSystem { @@ -133,7 +133,7 @@ namespace Grpc.Testing { public const int TotalCpuTimeFieldNumber = 4; private ulong totalCpuTime_; /// - /// change in total cpu time of the server (data from proc/stat) + /// change in total cpu time of the server (data from proc/stat) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ulong TotalCpuTime { @@ -147,7 +147,7 @@ namespace Grpc.Testing { public const int IdleCpuTimeFieldNumber = 5; private ulong idleCpuTime_; /// - /// change in idle time of the server (data from proc/stat) + /// change in idle time of the server (data from proc/stat) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ulong IdleCpuTime { @@ -296,7 +296,7 @@ namespace Grpc.Testing { } /// - /// Histogram params based on grpc/support/histogram.c + /// Histogram params based on grpc/support/histogram.c /// public sealed partial class HistogramParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HistogramParams()); @@ -335,7 +335,7 @@ namespace Grpc.Testing { public const int ResolutionFieldNumber = 1; private double resolution_; /// - /// first bucket is [0, 1 + resolution) + /// first bucket is [0, 1 + resolution) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Resolution { @@ -349,7 +349,7 @@ namespace Grpc.Testing { public const int MaxPossibleFieldNumber = 2; private double maxPossible_; /// - /// use enough buckets to allow this value + /// use enough buckets to allow this value /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double MaxPossible { @@ -450,7 +450,7 @@ namespace Grpc.Testing { } /// - /// Histogram data based on grpc/support/histogram.c + /// Histogram data based on grpc/support/histogram.c /// public sealed partial class HistogramData : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HistogramData()); @@ -887,7 +887,7 @@ namespace Grpc.Testing { public const int LatenciesFieldNumber = 1; private global::Grpc.Testing.HistogramData latencies_; /// - /// Latency histogram. Data points are in nanoseconds. + /// Latency histogram. Data points are in nanoseconds. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.HistogramData Latencies { @@ -901,7 +901,7 @@ namespace Grpc.Testing { public const int TimeElapsedFieldNumber = 2; private double timeElapsed_; /// - /// See ServerStats for details. + /// See ServerStats for details. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double TimeElapsed { @@ -939,7 +939,7 @@ namespace Grpc.Testing { = pb::FieldCodec.ForMessage(42, global::Grpc.Testing.RequestResultCount.Parser); private readonly pbc::RepeatedField requestResults_ = new pbc::RepeatedField(); /// - /// Number of failed requests (one row per status code seen) + /// Number of failed requests (one row per status code seen) /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField RequestResults { diff --git a/src/csharp/Grpc.Reflection/Reflection.cs b/src/csharp/Grpc.Reflection/Reflection.cs index 06c5d08030d..86e9aace8c8 100644 --- a/src/csharp/Grpc.Reflection/Reflection.cs +++ b/src/csharp/Grpc.Reflection/Reflection.cs @@ -70,7 +70,7 @@ namespace Grpc.Reflection.V1Alpha { } #region Messages /// - /// The message sent by the client when calling ServerReflectionInfo method. + /// The message sent by the client when calling ServerReflectionInfo method. /// public sealed partial class ServerReflectionRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerReflectionRequest()); @@ -136,7 +136,7 @@ namespace Grpc.Reflection.V1Alpha { /// Field number for the "file_by_filename" field. public const int FileByFilenameFieldNumber = 3; /// - /// Find a proto file by the file name. + /// Find a proto file by the file name. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string FileByFilename { @@ -150,9 +150,9 @@ namespace Grpc.Reflection.V1Alpha { /// Field number for the "file_containing_symbol" field. public const int FileContainingSymbolFieldNumber = 4; /// - /// Find the proto file that declares the given fully-qualified symbol name. - /// This field should be a fully-qualified symbol name - /// (e.g. <package>.<service>[.<method>] or <package>.<type>). + /// Find the proto file that declares the given fully-qualified symbol name. + /// This field should be a fully-qualified symbol name + /// (e.g. <package>.<service>[.<method>] or <package>.<type>). /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string FileContainingSymbol { @@ -166,8 +166,8 @@ namespace Grpc.Reflection.V1Alpha { /// Field number for the "file_containing_extension" field. public const int FileContainingExtensionFieldNumber = 5; /// - /// Find the proto file which defines an extension extending the given - /// message type with the given field number. + /// Find the proto file which defines an extension extending the given + /// message type with the given field number. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Reflection.V1Alpha.ExtensionRequest FileContainingExtension { @@ -181,14 +181,14 @@ namespace Grpc.Reflection.V1Alpha { /// Field number for the "all_extension_numbers_of_type" field. public const int AllExtensionNumbersOfTypeFieldNumber = 6; /// - /// Finds the tag numbers used by all known extensions of the given message - /// type, and appends them to ExtensionNumberResponse in an undefined order. - /// Its corresponding method is best-effort: it's not guaranteed that the - /// reflection service will implement this method, and it's not guaranteed - /// that this method will provide all extensions. Returns - /// StatusCode::UNIMPLEMENTED if it's not implemented. - /// This field should be a fully-qualified type name. The format is - /// <package>.<type> + /// Finds the tag numbers used by all known extensions of the given message + /// type, and appends them to ExtensionNumberResponse in an undefined order. + /// Its corresponding method is best-effort: it's not guaranteed that the + /// reflection service will implement this method, and it's not guaranteed + /// that this method will provide all extensions. Returns + /// StatusCode::UNIMPLEMENTED if it's not implemented. + /// This field should be a fully-qualified type name. The format is + /// <package>.<type> /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string AllExtensionNumbersOfType { @@ -202,8 +202,8 @@ namespace Grpc.Reflection.V1Alpha { /// Field number for the "list_services" field. public const int ListServicesFieldNumber = 7; /// - /// List the full names of registered services. The content will not be - /// checked. + /// List the full names of registered services. The content will not be + /// checked. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string ListServices { @@ -401,8 +401,8 @@ namespace Grpc.Reflection.V1Alpha { } /// - /// The type name and extension number sent by the client when requesting - /// file_containing_extension. + /// The type name and extension number sent by the client when requesting + /// file_containing_extension. /// public sealed partial class ExtensionRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtensionRequest()); @@ -441,7 +441,7 @@ namespace Grpc.Reflection.V1Alpha { public const int ContainingTypeFieldNumber = 1; private string containingType_ = ""; /// - /// Fully-qualified type name. The format should be <package>.<type> + /// Fully-qualified type name. The format should be <package>.<type> /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string ContainingType { @@ -553,7 +553,7 @@ namespace Grpc.Reflection.V1Alpha { } /// - /// The message sent by the server to answer ServerReflectionInfo method. + /// The message sent by the server to answer ServerReflectionInfo method. /// public sealed partial class ServerReflectionResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerReflectionResponse()); @@ -628,12 +628,12 @@ namespace Grpc.Reflection.V1Alpha { /// Field number for the "file_descriptor_response" field. public const int FileDescriptorResponseFieldNumber = 4; /// - /// This message is used to answer file_by_filename, file_containing_symbol, - /// file_containing_extension requests with transitive dependencies. As - /// the repeated label is not allowed in oneof fields, we use a - /// FileDescriptorResponse message to encapsulate the repeated fields. - /// The reflection service is allowed to avoid sending FileDescriptorProtos - /// that were previously sent in response to earlier requests in the stream. + /// This message is used to answer file_by_filename, file_containing_symbol, + /// file_containing_extension requests with transitive dependencies. As + /// the repeated label is not allowed in oneof fields, we use a + /// FileDescriptorResponse message to encapsulate the repeated fields. + /// The reflection service is allowed to avoid sending FileDescriptorProtos + /// that were previously sent in response to earlier requests in the stream. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Reflection.V1Alpha.FileDescriptorResponse FileDescriptorResponse { @@ -647,7 +647,7 @@ namespace Grpc.Reflection.V1Alpha { /// Field number for the "all_extension_numbers_response" field. public const int AllExtensionNumbersResponseFieldNumber = 5; /// - /// This message is used to answer all_extension_numbers_of_type requst. + /// This message is used to answer all_extension_numbers_of_type requst. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Reflection.V1Alpha.ExtensionNumberResponse AllExtensionNumbersResponse { @@ -661,7 +661,7 @@ namespace Grpc.Reflection.V1Alpha { /// Field number for the "list_services_response" field. public const int ListServicesResponseFieldNumber = 6; /// - /// This message is used to answer list_services request. + /// This message is used to answer list_services request. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Reflection.V1Alpha.ListServiceResponse ListServicesResponse { @@ -675,7 +675,7 @@ namespace Grpc.Reflection.V1Alpha { /// Field number for the "error_response" field. public const int ErrorResponseFieldNumber = 7; /// - /// This message is used when an error occurs. + /// This message is used when an error occurs. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Reflection.V1Alpha.ErrorResponse ErrorResponse { @@ -893,9 +893,9 @@ namespace Grpc.Reflection.V1Alpha { } /// - /// Serialized FileDescriptorProto messages sent by the server answering - /// a file_by_filename, file_containing_symbol, or file_containing_extension - /// request. + /// Serialized FileDescriptorProto messages sent by the server answering + /// a file_by_filename, file_containing_symbol, or file_containing_extension + /// request. /// public sealed partial class FileDescriptorResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorResponse()); @@ -935,9 +935,9 @@ namespace Grpc.Reflection.V1Alpha { = pb::FieldCodec.ForBytes(10); private readonly pbc::RepeatedField fileDescriptorProto_ = new pbc::RepeatedField(); /// - /// Serialized FileDescriptorProto messages. We avoid taking a dependency on - /// descriptor.proto, which uses proto2 only features, by making them opaque - /// bytes instead. + /// Serialized FileDescriptorProto messages. We avoid taking a dependency on + /// descriptor.proto, which uses proto2 only features, by making them opaque + /// bytes instead. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField FileDescriptorProto { @@ -1012,8 +1012,8 @@ namespace Grpc.Reflection.V1Alpha { } /// - /// A list of extension numbers sent by the server answering - /// all_extension_numbers_of_type request. + /// A list of extension numbers sent by the server answering + /// all_extension_numbers_of_type request. /// public sealed partial class ExtensionNumberResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtensionNumberResponse()); @@ -1052,8 +1052,8 @@ namespace Grpc.Reflection.V1Alpha { public const int BaseTypeNameFieldNumber = 1; private string baseTypeName_ = ""; /// - /// Full name of the base type, including the package name. The format - /// is <package>.<type> + /// Full name of the base type, including the package name. The format + /// is <package>.<type> /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string BaseTypeName { @@ -1158,7 +1158,7 @@ namespace Grpc.Reflection.V1Alpha { } /// - /// A list of ServiceResponse sent by the server answering list_services request. + /// A list of ServiceResponse sent by the server answering list_services request. /// public sealed partial class ListServiceResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ListServiceResponse()); @@ -1198,8 +1198,8 @@ namespace Grpc.Reflection.V1Alpha { = pb::FieldCodec.ForMessage(10, global::Grpc.Reflection.V1Alpha.ServiceResponse.Parser); private readonly pbc::RepeatedField service_ = new pbc::RepeatedField(); /// - /// The information of each service may be expanded in the future, so we use - /// ServiceResponse message to encapsulate it. + /// The information of each service may be expanded in the future, so we use + /// ServiceResponse message to encapsulate it. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField Service { @@ -1274,8 +1274,8 @@ namespace Grpc.Reflection.V1Alpha { } /// - /// The information of a single service used by ListServiceResponse to answer - /// list_services request. + /// The information of a single service used by ListServiceResponse to answer + /// list_services request. /// public sealed partial class ServiceResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceResponse()); @@ -1313,8 +1313,8 @@ namespace Grpc.Reflection.V1Alpha { public const int NameFieldNumber = 1; private string name_ = ""; /// - /// Full name of a registered service, including its package name. The format - /// is <package>.<service> + /// Full name of a registered service, including its package name. The format + /// is <package>.<service> /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Name { @@ -1399,7 +1399,7 @@ namespace Grpc.Reflection.V1Alpha { } /// - /// The error code and error message sent by the server when an error occurs. + /// The error code and error message sent by the server when an error occurs. /// public sealed partial class ErrorResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ErrorResponse()); @@ -1438,7 +1438,7 @@ namespace Grpc.Reflection.V1Alpha { public const int ErrorCodeFieldNumber = 1; private int errorCode_; /// - /// This field uses the error codes defined in grpc::StatusCode. + /// This field uses the error codes defined in grpc::StatusCode. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int ErrorCode { From 766c97a4083e3c1bfc510a21e9c49440d63a03bd Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 22 Feb 2017 09:24:05 +0100 Subject: [PATCH 32/52] updgrade C# project.json to protobuf 3.2.0 --- src/csharp/Grpc.Examples/project.json | 2 +- src/csharp/Grpc.HealthCheck/project.json | 2 +- src/csharp/Grpc.IntegrationTesting/project.json | 2 +- src/csharp/Grpc.Reflection/project.json | 2 +- templates/src/csharp/Grpc.Examples/project.json.template | 2 +- templates/src/csharp/Grpc.HealthCheck/project.json.template | 2 +- .../src/csharp/Grpc.IntegrationTesting/project.json.template | 2 +- templates/src/csharp/Grpc.Reflection/project.json.template | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/csharp/Grpc.Examples/project.json b/src/csharp/Grpc.Examples/project.json index 21a730cb229..6343e591c9b 100644 --- a/src/csharp/Grpc.Examples/project.json +++ b/src/csharp/Grpc.Examples/project.json @@ -6,7 +6,7 @@ "Grpc.Core": { "target": "project" }, - "Google.Protobuf": "3.0.0" + "Google.Protobuf": "3.2.0" }, "frameworks": { "net45": { diff --git a/src/csharp/Grpc.HealthCheck/project.json b/src/csharp/Grpc.HealthCheck/project.json index 5d3b2f554b1..7f0c7a09a9a 100644 --- a/src/csharp/Grpc.HealthCheck/project.json +++ b/src/csharp/Grpc.HealthCheck/project.json @@ -22,7 +22,7 @@ }, "dependencies": { "Grpc.Core": "1.2.0-dev", - "Google.Protobuf": "3.0.0" + "Google.Protobuf": "3.2.0" }, "frameworks": { "net45": { diff --git a/src/csharp/Grpc.IntegrationTesting/project.json b/src/csharp/Grpc.IntegrationTesting/project.json index eba54318a5b..0513883ae72 100644 --- a/src/csharp/Grpc.IntegrationTesting/project.json +++ b/src/csharp/Grpc.IntegrationTesting/project.json @@ -54,7 +54,7 @@ "Grpc.Core": { "target": "project" }, - "Google.Protobuf": "3.0.0", + "Google.Protobuf": "3.2.0", "CommandLineParser.Unofficial": "2.0.275", "Moq": "4.6.38-alpha", "NUnit": "3.2.0", diff --git a/src/csharp/Grpc.Reflection/project.json b/src/csharp/Grpc.Reflection/project.json index bfc57661eb3..5a36bb957cc 100644 --- a/src/csharp/Grpc.Reflection/project.json +++ b/src/csharp/Grpc.Reflection/project.json @@ -22,7 +22,7 @@ }, "dependencies": { "Grpc.Core": "1.2.0-dev", - "Google.Protobuf": "3.0.0" + "Google.Protobuf": "3.2.0" }, "frameworks": { "net45": { diff --git a/templates/src/csharp/Grpc.Examples/project.json.template b/templates/src/csharp/Grpc.Examples/project.json.template index b8a8314de17..7e68ad7217e 100644 --- a/templates/src/csharp/Grpc.Examples/project.json.template +++ b/templates/src/csharp/Grpc.Examples/project.json.template @@ -6,7 +6,7 @@ "Grpc.Core": { "target": "project" }, - "Google.Protobuf": "3.0.0" + "Google.Protobuf": "3.2.0" }, "frameworks": { "net45": { diff --git a/templates/src/csharp/Grpc.HealthCheck/project.json.template b/templates/src/csharp/Grpc.HealthCheck/project.json.template index cba68940153..17ff81a0fb2 100644 --- a/templates/src/csharp/Grpc.HealthCheck/project.json.template +++ b/templates/src/csharp/Grpc.HealthCheck/project.json.template @@ -24,7 +24,7 @@ }, "dependencies": { "Grpc.Core": "${settings.csharp_version}", - "Google.Protobuf": "3.0.0" + "Google.Protobuf": "3.2.0" }, "frameworks": { "net45": { diff --git a/templates/src/csharp/Grpc.IntegrationTesting/project.json.template b/templates/src/csharp/Grpc.IntegrationTesting/project.json.template index 3ce94e58387..f159b918425 100644 --- a/templates/src/csharp/Grpc.IntegrationTesting/project.json.template +++ b/templates/src/csharp/Grpc.IntegrationTesting/project.json.template @@ -9,7 +9,7 @@ "Grpc.Core": { "target": "project" }, - "Google.Protobuf": "3.0.0", + "Google.Protobuf": "3.2.0", "CommandLineParser.Unofficial": "2.0.275", "Moq": "4.6.38-alpha", "NUnit": "3.2.0", diff --git a/templates/src/csharp/Grpc.Reflection/project.json.template b/templates/src/csharp/Grpc.Reflection/project.json.template index 8a33e1ccc97..4d911050455 100644 --- a/templates/src/csharp/Grpc.Reflection/project.json.template +++ b/templates/src/csharp/Grpc.Reflection/project.json.template @@ -24,7 +24,7 @@ }, "dependencies": { "Grpc.Core": "${settings.csharp_version}", - "Google.Protobuf": "3.0.0" + "Google.Protobuf": "3.2.0" }, "frameworks": { "net45": { From a66df54db7c735366cb89acbc793c1c92b687715 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 22 Feb 2017 09:37:42 +0100 Subject: [PATCH 33/52] update C# project.json dependencies --- templates/src/csharp/Grpc.Auth/project.json.template | 2 +- .../src/csharp/Grpc.Core.Tests/project.json.template | 8 ++++---- .../src/csharp/Grpc.Examples.Tests/project.json.template | 4 ++-- .../csharp/Grpc.HealthCheck.Tests/project.json.template | 4 ++-- .../csharp/Grpc.IntegrationTesting/project.json.template | 8 ++++---- .../csharp/Grpc.Reflection.Tests/project.json.template | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/templates/src/csharp/Grpc.Auth/project.json.template b/templates/src/csharp/Grpc.Auth/project.json.template index 8bcac1ac740..aa233db586c 100644 --- a/templates/src/csharp/Grpc.Auth/project.json.template +++ b/templates/src/csharp/Grpc.Auth/project.json.template @@ -24,7 +24,7 @@ }, "dependencies": { "Grpc.Core": "${settings.csharp_version}", - "Google.Apis.Auth": "1.16.0" + "Google.Apis.Auth": "1.21.0" }, "frameworks": { "net45": { }, diff --git a/templates/src/csharp/Grpc.Core.Tests/project.json.template b/templates/src/csharp/Grpc.Core.Tests/project.json.template index 8a3e0755ffb..b5f8190443a 100644 --- a/templates/src/csharp/Grpc.Core.Tests/project.json.template +++ b/templates/src/csharp/Grpc.Core.Tests/project.json.template @@ -6,10 +6,10 @@ "Grpc.Core": { "target": "project" }, - "Newtonsoft.Json": "8.0.3", - "NUnit": "3.2.0", - "NUnitLite": "3.2.0-*", - "NUnit.ConsoleRunner": "3.2.0", + "Newtonsoft.Json": "9.0.1", + "NUnit": "3.6.0", + "NUnitLite": "3.6.0", + "NUnit.ConsoleRunner": "3.6.0", "OpenCover": "4.6.519", "ReportGenerator": "2.4.4.0" }, diff --git a/templates/src/csharp/Grpc.Examples.Tests/project.json.template b/templates/src/csharp/Grpc.Examples.Tests/project.json.template index 0a9eb7c74d3..da60c017a36 100644 --- a/templates/src/csharp/Grpc.Examples.Tests/project.json.template +++ b/templates/src/csharp/Grpc.Examples.Tests/project.json.template @@ -6,8 +6,8 @@ "Grpc.Examples": { "target": "project" }, - "NUnit": "3.2.0", - "NUnitLite": "3.2.0-*" + "NUnit": "3.6.0", + "NUnitLite": "3.6.0" }, "frameworks": { "net45": { }, diff --git a/templates/src/csharp/Grpc.HealthCheck.Tests/project.json.template b/templates/src/csharp/Grpc.HealthCheck.Tests/project.json.template index c63da96db75..4a993326c32 100644 --- a/templates/src/csharp/Grpc.HealthCheck.Tests/project.json.template +++ b/templates/src/csharp/Grpc.HealthCheck.Tests/project.json.template @@ -6,8 +6,8 @@ "Grpc.HealthCheck": { "target": "project" }, - "NUnit": "3.2.0", - "NUnitLite": "3.2.0-*" + "NUnit": "3.6.0", + "NUnitLite": "3.6.0" }, "frameworks": { "net45": { }, diff --git a/templates/src/csharp/Grpc.IntegrationTesting/project.json.template b/templates/src/csharp/Grpc.IntegrationTesting/project.json.template index f159b918425..0b5d92088a5 100644 --- a/templates/src/csharp/Grpc.IntegrationTesting/project.json.template +++ b/templates/src/csharp/Grpc.IntegrationTesting/project.json.template @@ -10,10 +10,10 @@ "target": "project" }, "Google.Protobuf": "3.2.0", - "CommandLineParser.Unofficial": "2.0.275", - "Moq": "4.6.38-alpha", - "NUnit": "3.2.0", - "NUnitLite": "3.2.0-*" + "CommandLineParser": "2.1.1-beta", + "Moq": "4.7.0", + "NUnit": "3.6.0", + "NUnitLite": "3.6.0" }, "frameworks": { "net45": { diff --git a/templates/src/csharp/Grpc.Reflection.Tests/project.json.template b/templates/src/csharp/Grpc.Reflection.Tests/project.json.template index 2869609138b..65d200e30b5 100644 --- a/templates/src/csharp/Grpc.Reflection.Tests/project.json.template +++ b/templates/src/csharp/Grpc.Reflection.Tests/project.json.template @@ -6,8 +6,8 @@ "Grpc.Reflection": { "target": "project" }, - "NUnit": "3.2.0", - "NUnitLite": "3.2.0-*" + "NUnit": "3.6.0", + "NUnitLite": "3.6.0" }, "frameworks": { "net45": { }, From 018e23ab5abdeb3db141a04f4aa5084582aed19b Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 22 Feb 2017 09:48:41 +0100 Subject: [PATCH 34/52] regenerate projects --- src/csharp/Grpc.Auth/project.json | 2 +- src/csharp/Grpc.Core.Tests/project.json | 8 ++++---- src/csharp/Grpc.Examples.Tests/project.json | 4 ++-- src/csharp/Grpc.HealthCheck.Tests/project.json | 4 ++-- src/csharp/Grpc.IntegrationTesting/project.json | 8 ++++---- src/csharp/Grpc.Reflection.Tests/project.json | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/csharp/Grpc.Auth/project.json b/src/csharp/Grpc.Auth/project.json index 3805f4759e8..170149ace52 100644 --- a/src/csharp/Grpc.Auth/project.json +++ b/src/csharp/Grpc.Auth/project.json @@ -22,7 +22,7 @@ }, "dependencies": { "Grpc.Core": "1.2.0-dev", - "Google.Apis.Auth": "1.16.0" + "Google.Apis.Auth": "1.21.0" }, "frameworks": { "net45": { }, diff --git a/src/csharp/Grpc.Core.Tests/project.json b/src/csharp/Grpc.Core.Tests/project.json index 045207a413d..14e5ed51adb 100644 --- a/src/csharp/Grpc.Core.Tests/project.json +++ b/src/csharp/Grpc.Core.Tests/project.json @@ -45,10 +45,10 @@ "Grpc.Core": { "target": "project" }, - "Newtonsoft.Json": "8.0.3", - "NUnit": "3.2.0", - "NUnitLite": "3.2.0-*", - "NUnit.ConsoleRunner": "3.2.0", + "Newtonsoft.Json": "9.0.1", + "NUnit": "3.6.0", + "NUnitLite": "3.6.0", + "NUnit.ConsoleRunner": "3.6.0", "OpenCover": "4.6.519", "ReportGenerator": "2.4.4.0" }, diff --git a/src/csharp/Grpc.Examples.Tests/project.json b/src/csharp/Grpc.Examples.Tests/project.json index e509621a293..4ffcaf57fd9 100644 --- a/src/csharp/Grpc.Examples.Tests/project.json +++ b/src/csharp/Grpc.Examples.Tests/project.json @@ -45,8 +45,8 @@ "Grpc.Examples": { "target": "project" }, - "NUnit": "3.2.0", - "NUnitLite": "3.2.0-*" + "NUnit": "3.6.0", + "NUnitLite": "3.6.0" }, "frameworks": { "net45": { }, diff --git a/src/csharp/Grpc.HealthCheck.Tests/project.json b/src/csharp/Grpc.HealthCheck.Tests/project.json index 654454d1cb7..2814cbfe466 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/project.json +++ b/src/csharp/Grpc.HealthCheck.Tests/project.json @@ -45,8 +45,8 @@ "Grpc.HealthCheck": { "target": "project" }, - "NUnit": "3.2.0", - "NUnitLite": "3.2.0-*" + "NUnit": "3.6.0", + "NUnitLite": "3.6.0" }, "frameworks": { "net45": { }, diff --git a/src/csharp/Grpc.IntegrationTesting/project.json b/src/csharp/Grpc.IntegrationTesting/project.json index 0513883ae72..a42ff6ee0e8 100644 --- a/src/csharp/Grpc.IntegrationTesting/project.json +++ b/src/csharp/Grpc.IntegrationTesting/project.json @@ -55,10 +55,10 @@ "target": "project" }, "Google.Protobuf": "3.2.0", - "CommandLineParser.Unofficial": "2.0.275", - "Moq": "4.6.38-alpha", - "NUnit": "3.2.0", - "NUnitLite": "3.2.0-*" + "CommandLineParser": "2.1.1-beta", + "Moq": "4.7.0", + "NUnit": "3.6.0", + "NUnitLite": "3.6.0" }, "frameworks": { "net45": { diff --git a/src/csharp/Grpc.Reflection.Tests/project.json b/src/csharp/Grpc.Reflection.Tests/project.json index b90834a25eb..fc05557c884 100644 --- a/src/csharp/Grpc.Reflection.Tests/project.json +++ b/src/csharp/Grpc.Reflection.Tests/project.json @@ -45,8 +45,8 @@ "Grpc.Reflection": { "target": "project" }, - "NUnit": "3.2.0", - "NUnitLite": "3.2.0-*" + "NUnit": "3.6.0", + "NUnitLite": "3.6.0" }, "frameworks": { "net45": { }, From e2b2c8e193030c66fd81f4c4c70d31faf2bd2b42 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 22 Feb 2017 10:16:22 +0100 Subject: [PATCH 35/52] update nugets in csproj projects --- src/csharp/Grpc.Auth/Grpc.Auth.csproj | 26 ++++------ src/csharp/Grpc.Auth/packages.config | 10 ++-- .../Grpc.Core.Tests/Grpc.Core.Tests.csproj | 16 +++--- src/csharp/Grpc.Core.Tests/packages.config | 7 ++- .../Grpc.Examples.Tests.csproj | 12 ++--- .../Grpc.Examples.Tests/packages.config | 6 +-- src/csharp/Grpc.Examples/Grpc.Examples.csproj | 14 +++-- src/csharp/Grpc.Examples/packages.config | 4 +- .../Grpc.HealthCheck.Tests.csproj | 10 ++-- .../Grpc.HealthCheck.Tests/packages.config | 6 +-- .../Grpc.HealthCheck/Grpc.HealthCheck.csproj | 6 +-- src/csharp/Grpc.HealthCheck/packages.config | 2 +- .../Grpc.IntegrationTesting.Client.csproj | 26 ++++------ .../packages.config | 10 ++-- .../Grpc.IntegrationTesting.Server.csproj | 26 ++++------ .../packages.config | 10 ++-- .../Grpc.IntegrationTesting.csproj | 52 ++++++++----------- .../Grpc.IntegrationTesting/packages.config | 22 ++++---- .../Grpc.Reflection.Tests.csproj | 16 +++--- .../Grpc.Reflection.Tests/packages.config | 6 +-- .../Grpc.Reflection/Grpc.Reflection.csproj | 6 +-- src/csharp/Grpc.Reflection/packages.config | 2 +- 22 files changed, 130 insertions(+), 165 deletions(-) diff --git a/src/csharp/Grpc.Auth/Grpc.Auth.csproj b/src/csharp/Grpc.Auth/Grpc.Auth.csproj index db55ed5a6c8..9ef98529e85 100644 --- a/src/csharp/Grpc.Auth/Grpc.Auth.csproj +++ b/src/csharp/Grpc.Auth/Grpc.Auth.csproj @@ -34,32 +34,26 @@ - - ..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll - - - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll - - - ..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll - ..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll + + ..\packages\Google.Apis.Core.1.21.0\lib\net45\Google.Apis.Core.dll + - ..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll + ..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.dll - ..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll + ..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.PlatformServices.dll - ..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll + ..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.dll - ..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll + ..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.PlatformServices.dll + + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/src/csharp/Grpc.Auth/packages.config b/src/csharp/Grpc.Auth/packages.config index 11c6375c638..aecc65e8499 100644 --- a/src/csharp/Grpc.Auth/packages.config +++ b/src/csharp/Grpc.Auth/packages.config @@ -1,10 +1,8 @@  - - - - - - + + + + \ No newline at end of file diff --git a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj index a5e60e73285..375dc0b7f04 100644 --- a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj +++ b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj @@ -27,17 +27,17 @@ - - ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll - - - ..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll + + ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll + + ..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll + + + ..\packages\NUnitLite.3.6.0\lib\net45\nunitlite.dll diff --git a/src/csharp/Grpc.Core.Tests/packages.config b/src/csharp/Grpc.Core.Tests/packages.config index 4750735fadb..994a2787629 100644 --- a/src/csharp/Grpc.Core.Tests/packages.config +++ b/src/csharp/Grpc.Core.Tests/packages.config @@ -1,9 +1,8 @@  - - - - + + + diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index d22fe878259..c96243b1c70 100644 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -27,17 +27,17 @@ + + ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll + - ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll + ..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll - ..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll + ..\packages\NUnitLite.3.6.0\lib\net45\nunitlite.dll - ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll - - - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll + ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll diff --git a/src/csharp/Grpc.Examples.Tests/packages.config b/src/csharp/Grpc.Examples.Tests/packages.config index 0fed4dbd415..8a7f7a0652a 100644 --- a/src/csharp/Grpc.Examples.Tests/packages.config +++ b/src/csharp/Grpc.Examples.Tests/packages.config @@ -1,7 +1,7 @@  - - - + + + \ No newline at end of file diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj index 44acb6c2e3a..fc927543f73 100644 --- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj +++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj @@ -3,8 +3,6 @@ Debug AnyCPU - 10.0.0 - 2.0 {7DC1433E-3225-42C7-B7EA-546D56E27A4B} Library Grpc.Examples @@ -28,17 +26,17 @@ 4 - - ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll - - - ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll + + ..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll + + + ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll + diff --git a/src/csharp/Grpc.Examples/packages.config b/src/csharp/Grpc.Examples/packages.config index c7db26bd64b..79a898081ed 100644 --- a/src/csharp/Grpc.Examples/packages.config +++ b/src/csharp/Grpc.Examples/packages.config @@ -1,6 +1,6 @@  - - + + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index b82f9768612..71f0ee19b86 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -35,14 +35,14 @@ + + ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll + - ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll + ..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll - ..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll - - - ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll + ..\packages\NUnitLite.3.6.0\lib\net45\nunitlite.dll diff --git a/src/csharp/Grpc.HealthCheck.Tests/packages.config b/src/csharp/Grpc.HealthCheck.Tests/packages.config index e796d6b1358..48c94bc4a30 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/packages.config +++ b/src/csharp/Grpc.HealthCheck.Tests/packages.config @@ -1,6 +1,6 @@  - - - + + + \ No newline at end of file diff --git a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj index 63aa18584d8..171525b7086 100644 --- a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj +++ b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj @@ -36,12 +36,12 @@ - - ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll + + ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll + diff --git a/src/csharp/Grpc.HealthCheck/packages.config b/src/csharp/Grpc.HealthCheck/packages.config index 5ab40b7a8ce..eec292b306d 100644 --- a/src/csharp/Grpc.HealthCheck/packages.config +++ b/src/csharp/Grpc.HealthCheck/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj b/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj index 6bb5f33966e..297063cb9d8 100644 --- a/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj +++ b/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj @@ -34,32 +34,26 @@ - - ..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll - - - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll - - - ..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll - ..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll + + ..\packages\Google.Apis.Core.1.21.0\lib\net45\Google.Apis.Core.dll + - ..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll + ..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.dll - ..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll + ..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.PlatformServices.dll - ..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll + ..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.dll - ..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll + ..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.PlatformServices.dll + + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/src/csharp/Grpc.IntegrationTesting.Client/packages.config b/src/csharp/Grpc.IntegrationTesting.Client/packages.config index 11c6375c638..aecc65e8499 100644 --- a/src/csharp/Grpc.IntegrationTesting.Client/packages.config +++ b/src/csharp/Grpc.IntegrationTesting.Client/packages.config @@ -1,10 +1,8 @@  - - - - - - + + + + \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj b/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj index 081dc24fbf1..c23977620e6 100644 --- a/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj +++ b/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj @@ -34,32 +34,26 @@ - - ..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll - - - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll - - - ..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll - ..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll + + ..\packages\Google.Apis.Core.1.21.0\lib\net45\Google.Apis.Core.dll + - ..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll + ..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.dll - ..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll + ..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.PlatformServices.dll - ..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll + ..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.dll - ..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll + ..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.PlatformServices.dll + + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/src/csharp/Grpc.IntegrationTesting.Server/packages.config b/src/csharp/Grpc.IntegrationTesting.Server/packages.config index 11c6375c638..aecc65e8499 100644 --- a/src/csharp/Grpc.IntegrationTesting.Server/packages.config +++ b/src/csharp/Grpc.IntegrationTesting.Server/packages.config @@ -1,10 +1,8 @@  - - - - - - + + + + \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index f7abcf80469..38b9a5d3c59 100644 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -33,53 +33,47 @@ - - ..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll - - - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll - - - ..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll - - - ..\packages\CommandLineParser.Unofficial.2.0.275\lib\net45\CommandLineParser.Unofficial.dll + + ..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll - - ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll + + ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll - ..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll - - - ..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll + ..\packages\Google.Apis.Core.1.21.0\lib\net45\Google.Apis.Core.dll - ..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll + ..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.dll - ..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll + ..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.PlatformServices.dll - ..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll + ..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.dll - ..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll + ..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.PlatformServices.dll - ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll + ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll + + + ..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll + + + ..\packages\NUnitLite.3.6.0\lib\net45\nunitlite.dll + + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll + ..\packages\Castle.Core.4.0.0\lib\net45\Castle.Core.dll - ..\packages\Moq.4.6.38-alpha\lib\net45\Moq.dll + ..\packages\Moq.4.7.0\lib\net45\Moq.dll - - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll + + ..\packages\CommandLineParser.2.1.1-beta\lib\net45\CommandLine.dll diff --git a/src/csharp/Grpc.IntegrationTesting/packages.config b/src/csharp/Grpc.IntegrationTesting/packages.config index a03ee926f47..030f9d97b89 100644 --- a/src/csharp/Grpc.IntegrationTesting/packages.config +++ b/src/csharp/Grpc.IntegrationTesting/packages.config @@ -1,17 +1,15 @@  - - - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj b/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj index c5918b194ef..7e2b551799e 100644 --- a/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj +++ b/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj @@ -35,17 +35,17 @@ - - ..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll - - - ..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll + + ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll - ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll + ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll - - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll + + ..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll + + + ..\packages\NUnitLite.3.6.0\lib\net45\nunitlite.dll diff --git a/src/csharp/Grpc.Reflection.Tests/packages.config b/src/csharp/Grpc.Reflection.Tests/packages.config index 0fed4dbd415..8a7f7a0652a 100644 --- a/src/csharp/Grpc.Reflection.Tests/packages.config +++ b/src/csharp/Grpc.Reflection.Tests/packages.config @@ -1,7 +1,7 @@  - - - + + + \ No newline at end of file diff --git a/src/csharp/Grpc.Reflection/Grpc.Reflection.csproj b/src/csharp/Grpc.Reflection/Grpc.Reflection.csproj index 4e254a0b539..b0ab170e3f8 100644 --- a/src/csharp/Grpc.Reflection/Grpc.Reflection.csproj +++ b/src/csharp/Grpc.Reflection/Grpc.Reflection.csproj @@ -36,12 +36,12 @@ - - ..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll - ..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll + + ..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll + diff --git a/src/csharp/Grpc.Reflection/packages.config b/src/csharp/Grpc.Reflection/packages.config index 5ab40b7a8ce..eec292b306d 100644 --- a/src/csharp/Grpc.Reflection/packages.config +++ b/src/csharp/Grpc.Reflection/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file From 93c8951695b841afaef597edd7fef3f583aad4c3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 22 Feb 2017 10:28:57 +0100 Subject: [PATCH 36/52] NUnitVersion tests no longer needed --- .../Grpc.Core.Tests/Grpc.Core.Tests.csproj | 1 - .../Grpc.Core.Tests/NUnitVersionTest.cs | 77 ------------------- src/csharp/tests.json | 1 - 3 files changed, 79 deletions(-) delete mode 100644 src/csharp/Grpc.Core.Tests/NUnitVersionTest.cs diff --git a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj index 375dc0b7f04..a1a2e4eebd1 100644 --- a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj +++ b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj @@ -64,7 +64,6 @@ - diff --git a/src/csharp/Grpc.Core.Tests/NUnitVersionTest.cs b/src/csharp/Grpc.Core.Tests/NUnitVersionTest.cs deleted file mode 100644 index 1a9e441611d..00000000000 --- a/src/csharp/Grpc.Core.Tests/NUnitVersionTest.cs +++ /dev/null @@ -1,77 +0,0 @@ -#region Copyright notice and license - -// 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. - -#endregion - -using System; -using System.Threading; -using System.Threading.Tasks; -using Grpc.Core; -using Grpc.Core.Internal; -using Grpc.Core.Utils; -using NUnit.Framework; - -namespace Grpc.Core.Tests -{ - /// - /// Tests if the version of nunit-console used is sufficient to run async tests. - /// - public class NUnitVersionTest - { - private int testRunCount = 0; - - [TestFixtureTearDown] - public void Cleanup() - { - if (testRunCount != 2) - { - Console.Error.WriteLine("You are using and old version of NUnit that doesn't support async tests and skips them instead. " + - "This test has failed to indicate that."); - Console.Error.Flush(); - throw new Exception("NUnitVersionTest has failed."); - } - } - - [Test] - public void NUnitVersionTest1() - { - testRunCount++; - } - - // Old version of NUnit will skip this test - [Test] - public async Task NUnitVersionTest2() - { - testRunCount++; - await Task.Delay(10); - } - } -} diff --git a/src/csharp/tests.json b/src/csharp/tests.json index 63f2e97f2db..707d140f62c 100644 --- a/src/csharp/tests.json +++ b/src/csharp/tests.json @@ -22,7 +22,6 @@ "Grpc.Core.Tests.HalfcloseTest", "Grpc.Core.Tests.MarshallingErrorsTest", "Grpc.Core.Tests.MetadataTest", - "Grpc.Core.Tests.NUnitVersionTest", "Grpc.Core.Tests.PerformanceTest", "Grpc.Core.Tests.PInvokeTest", "Grpc.Core.Tests.ResponseHeadersTest", From 1293cbc153b1bb30b66b4e25f768aa92a307a112 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 22 Feb 2017 10:35:59 +0100 Subject: [PATCH 37/52] remove unneeded dependencies --- .../Grpc.IntegrationTesting.Client.csproj | 22 ------------------- .../packages.config | 8 ------- .../Grpc.IntegrationTesting.Server.csproj | 22 ------------------- .../packages.config | 8 ------- 4 files changed, 60 deletions(-) delete mode 100644 src/csharp/Grpc.IntegrationTesting.Client/packages.config delete mode 100644 src/csharp/Grpc.IntegrationTesting.Server/packages.config diff --git a/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj b/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj index 297063cb9d8..a793f3f6df8 100644 --- a/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj +++ b/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj @@ -34,27 +34,6 @@ - - ..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll - - - ..\packages\Google.Apis.Core.1.21.0\lib\net45\Google.Apis.Core.dll - - - ..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.dll - - - ..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.PlatformServices.dll - - - ..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.dll - - - ..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.PlatformServices.dll - - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - @@ -76,6 +55,5 @@ - \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting.Client/packages.config b/src/csharp/Grpc.IntegrationTesting.Client/packages.config deleted file mode 100644 index aecc65e8499..00000000000 --- a/src/csharp/Grpc.IntegrationTesting.Client/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj b/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj index c23977620e6..80d36363f71 100644 --- a/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj +++ b/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj @@ -34,27 +34,6 @@ - - ..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll - - - ..\packages\Google.Apis.Core.1.21.0\lib\net45\Google.Apis.Core.dll - - - ..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.dll - - - ..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.PlatformServices.dll - - - ..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.dll - - - ..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.PlatformServices.dll - - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - @@ -76,6 +55,5 @@ - \ No newline at end of file diff --git a/src/csharp/Grpc.IntegrationTesting.Server/packages.config b/src/csharp/Grpc.IntegrationTesting.Server/packages.config deleted file mode 100644 index aecc65e8499..00000000000 --- a/src/csharp/Grpc.IntegrationTesting.Server/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From 6820c8c74644a4771b72ebd95206afbbe68a7a31 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 22 Feb 2017 17:01:53 +0100 Subject: [PATCH 38/52] fix bazel_deps.sh --- .../dockerfile/test/bazel/Dockerfile.template | 48 ----------------- tools/distrib/python/bazel_deps.sh | 10 ++-- tools/dockerfile/bazel/Dockerfile | 52 ------------------- 3 files changed, 5 insertions(+), 105 deletions(-) delete mode 100644 templates/tools/dockerfile/test/bazel/Dockerfile.template delete mode 100644 tools/dockerfile/bazel/Dockerfile diff --git a/templates/tools/dockerfile/test/bazel/Dockerfile.template b/templates/tools/dockerfile/test/bazel/Dockerfile.template deleted file mode 100644 index 82f90bef681..00000000000 --- a/templates/tools/dockerfile/test/bazel/Dockerfile.template +++ /dev/null @@ -1,48 +0,0 @@ -%YAML 1.2 ---- | - # 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. - - FROM ubuntu:15.10 - - <%include file="../../apt_get_basic.include"/> - - #======================== - # Bazel installation - RUN apt-get install -y software-properties-common g++ - RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" > /etc/apt/sources.list.d/bazel.list - RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add - - RUN apt-get -y update - RUN apt-get -y install bazel - - RUN mkdir -p /var/local/jenkins - - # Define the default command. - CMD ["bash"] - diff --git a/tools/distrib/python/bazel_deps.sh b/tools/distrib/python/bazel_deps.sh index de3ee079708..f6d42d29eb6 100755 --- a/tools/distrib/python/bazel_deps.sh +++ b/tools/distrib/python/bazel_deps.sh @@ -33,14 +33,14 @@ cd $(dirname $0)/../../../ # First check if bazel is installed on the machine. If it is, then we don't need # to invoke the docker bazel. -if [ "bazel version" ] +if [ -x "$(command -v bazel)" ] then cd third_party/protobuf bazel query 'deps('$1')' else - docker build -t bazel `realpath ./tools/dockerfile/bazel/` - docker run -v "`realpath .`:/src/grpc/" \ - -w /src/grpc/third_party/protobuf \ - bazel \ + docker build -t bazel_local_img tools/dockerfile/test/sanity + docker run -v "$(realpath .):/src/grpc/:ro" \ + -w /src/grpc/third_party/protobuf \ + bazel_local_img \ bazel query 'deps('$1')' fi diff --git a/tools/dockerfile/bazel/Dockerfile b/tools/dockerfile/bazel/Dockerfile deleted file mode 100644 index 2a80a4d4d53..00000000000 --- a/tools/dockerfile/bazel/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -# 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. - -FROM ubuntu:wily -RUN apt-get update -RUN apt-get -y install software-properties-common python-software-properties -RUN add-apt-repository ppa:webupd8team/java -RUN apt-get update -RUN apt-get -y install \ - vim \ - wget \ - openjdk-8-jdk \ - pkg-config \ - zip \ - g++ \ - zlib1g-dev \ - unzip \ - git - -RUN git clone https://github.com/bazelbuild/bazel.git /bazel -RUN cd /bazel && ./compile.sh - -RUN ln -s /bazel/output/bazel /bin/ - -# ensure the installation has been extracted -RUN bazel From 5cf218e641358c136f1a34ccc70c0e3974c04abd Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 22 Feb 2017 17:02:49 +0100 Subject: [PATCH 39/52] regenerate protoc_lib_deps.py --- tools/distrib/python/grpcio_tools/protoc_lib_deps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/distrib/python/grpcio_tools/protoc_lib_deps.py b/tools/distrib/python/grpcio_tools/protoc_lib_deps.py index 569328e57ea..c2aa6198b3d 100644 --- a/tools/distrib/python/grpcio_tools/protoc_lib_deps.py +++ b/tools/distrib/python/grpcio_tools/protoc_lib_deps.py @@ -29,7 +29,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # AUTO-GENERATED BY make_grpcio_tools.py! -CC_FILES=['google/protobuf/compiler/zip_writer.cc', 'google/protobuf/compiler/subprocess.cc', 'google/protobuf/compiler/ruby/ruby_generator.cc', 'google/protobuf/compiler/python/python_generator.cc', 'google/protobuf/compiler/plugin.pb.cc', 'google/protobuf/compiler/plugin.cc', 'google/protobuf/compiler/php/php_generator.cc', 'google/protobuf/compiler/objectivec/objectivec_primitive_field.cc', 'google/protobuf/compiler/objectivec/objectivec_oneof.cc', 'google/protobuf/compiler/objectivec/objectivec_message_field.cc', 'google/protobuf/compiler/objectivec/objectivec_message.cc', 'google/protobuf/compiler/objectivec/objectivec_map_field.cc', 'google/protobuf/compiler/objectivec/objectivec_helpers.cc', 'google/protobuf/compiler/objectivec/objectivec_generator.cc', 'google/protobuf/compiler/objectivec/objectivec_file.cc', 'google/protobuf/compiler/objectivec/objectivec_field.cc', 'google/protobuf/compiler/objectivec/objectivec_extension.cc', 'google/protobuf/compiler/objectivec/objectivec_enum_field.cc', 'google/protobuf/compiler/objectivec/objectivec_enum.cc', 'google/protobuf/compiler/js/js_generator.cc', 'google/protobuf/compiler/javanano/javanano_primitive_field.cc', 'google/protobuf/compiler/javanano/javanano_message_field.cc', 'google/protobuf/compiler/javanano/javanano_message.cc', 'google/protobuf/compiler/javanano/javanano_map_field.cc', 'google/protobuf/compiler/javanano/javanano_helpers.cc', 'google/protobuf/compiler/javanano/javanano_generator.cc', 'google/protobuf/compiler/javanano/javanano_file.cc', 'google/protobuf/compiler/javanano/javanano_field.cc', 'google/protobuf/compiler/javanano/javanano_extension.cc', 'google/protobuf/compiler/javanano/javanano_enum_field.cc', 'google/protobuf/compiler/javanano/javanano_enum.cc', 'google/protobuf/compiler/java/java_string_field_lite.cc', 'google/protobuf/compiler/java/java_string_field.cc', 'google/protobuf/compiler/java/java_shared_code_generator.cc', 'google/protobuf/compiler/java/java_service.cc', 'google/protobuf/compiler/java/java_primitive_field_lite.cc', 'google/protobuf/compiler/java/java_primitive_field.cc', 'google/protobuf/compiler/java/java_name_resolver.cc', 'google/protobuf/compiler/java/java_message_lite.cc', 'google/protobuf/compiler/java/java_message_field_lite.cc', 'google/protobuf/compiler/java/java_message_field.cc', 'google/protobuf/compiler/java/java_message_builder_lite.cc', 'google/protobuf/compiler/java/java_message_builder.cc', 'google/protobuf/compiler/java/java_message.cc', 'google/protobuf/compiler/java/java_map_field_lite.cc', 'google/protobuf/compiler/java/java_map_field.cc', 'google/protobuf/compiler/java/java_lazy_message_field_lite.cc', 'google/protobuf/compiler/java/java_lazy_message_field.cc', 'google/protobuf/compiler/java/java_helpers.cc', 'google/protobuf/compiler/java/java_generator_factory.cc', 'google/protobuf/compiler/java/java_generator.cc', 'google/protobuf/compiler/java/java_file.cc', 'google/protobuf/compiler/java/java_field.cc', 'google/protobuf/compiler/java/java_extension_lite.cc', 'google/protobuf/compiler/java/java_extension.cc', 'google/protobuf/compiler/java/java_enum_lite.cc', 'google/protobuf/compiler/java/java_enum_field_lite.cc', 'google/protobuf/compiler/java/java_enum_field.cc', 'google/protobuf/compiler/java/java_enum.cc', 'google/protobuf/compiler/java/java_doc_comment.cc', 'google/protobuf/compiler/java/java_context.cc', 'google/protobuf/compiler/csharp/csharp_wrapper_field.cc', 'google/protobuf/compiler/csharp/csharp_source_generator_base.cc', 'google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc', 'google/protobuf/compiler/csharp/csharp_repeated_message_field.cc', 'google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc', 'google/protobuf/compiler/csharp/csharp_reflection_class.cc', 'google/protobuf/compiler/csharp/csharp_primitive_field.cc', 'google/protobuf/compiler/csharp/csharp_message_field.cc', 'google/protobuf/compiler/csharp/csharp_message.cc', 'google/protobuf/compiler/csharp/csharp_map_field.cc', 'google/protobuf/compiler/csharp/csharp_helpers.cc', 'google/protobuf/compiler/csharp/csharp_generator.cc', 'google/protobuf/compiler/csharp/csharp_field_base.cc', 'google/protobuf/compiler/csharp/csharp_enum_field.cc', 'google/protobuf/compiler/csharp/csharp_enum.cc', 'google/protobuf/compiler/csharp/csharp_doc_comment.cc', 'google/protobuf/compiler/cpp/cpp_string_field.cc', 'google/protobuf/compiler/cpp/cpp_service.cc', 'google/protobuf/compiler/cpp/cpp_primitive_field.cc', 'google/protobuf/compiler/cpp/cpp_message_field.cc', 'google/protobuf/compiler/cpp/cpp_message.cc', 'google/protobuf/compiler/cpp/cpp_map_field.cc', 'google/protobuf/compiler/cpp/cpp_helpers.cc', 'google/protobuf/compiler/cpp/cpp_generator.cc', 'google/protobuf/compiler/cpp/cpp_file.cc', 'google/protobuf/compiler/cpp/cpp_field.cc', 'google/protobuf/compiler/cpp/cpp_extension.cc', 'google/protobuf/compiler/cpp/cpp_enum_field.cc', 'google/protobuf/compiler/cpp/cpp_enum.cc', 'google/protobuf/compiler/command_line_interface.cc', 'google/protobuf/compiler/code_generator.cc', 'google/protobuf/wrappers.pb.cc', 'google/protobuf/wire_format.cc', 'google/protobuf/util/type_resolver_util.cc', 'google/protobuf/util/time_util.cc', 'google/protobuf/util/message_differencer.cc', 'google/protobuf/util/json_util.cc', 'google/protobuf/util/internal/utility.cc', 'google/protobuf/util/internal/type_info_test_helper.cc', 'google/protobuf/util/internal/type_info.cc', 'google/protobuf/util/internal/protostream_objectwriter.cc', 'google/protobuf/util/internal/protostream_objectsource.cc', 'google/protobuf/util/internal/proto_writer.cc', 'google/protobuf/util/internal/object_writer.cc', 'google/protobuf/util/internal/json_stream_parser.cc', 'google/protobuf/util/internal/json_objectwriter.cc', 'google/protobuf/util/internal/json_escaping.cc', 'google/protobuf/util/internal/field_mask_utility.cc', 'google/protobuf/util/internal/error_listener.cc', 'google/protobuf/util/internal/default_value_objectwriter.cc', 'google/protobuf/util/internal/datapiece.cc', 'google/protobuf/util/field_mask_util.cc', 'google/protobuf/util/field_comparator.cc', 'google/protobuf/unknown_field_set.cc', 'google/protobuf/type.pb.cc', 'google/protobuf/timestamp.pb.cc', 'google/protobuf/text_format.cc', 'google/protobuf/stubs/substitute.cc', 'google/protobuf/stubs/mathlimits.cc', 'google/protobuf/struct.pb.cc', 'google/protobuf/source_context.pb.cc', 'google/protobuf/service.cc', 'google/protobuf/reflection_ops.cc', 'google/protobuf/message.cc', 'google/protobuf/map_field.cc', 'google/protobuf/io/zero_copy_stream_impl.cc', 'google/protobuf/io/tokenizer.cc', 'google/protobuf/io/strtod.cc', 'google/protobuf/io/printer.cc', 'google/protobuf/io/gzip_stream.cc', 'google/protobuf/generated_message_reflection.cc', 'google/protobuf/field_mask.pb.cc', 'google/protobuf/extension_set_heavy.cc', 'google/protobuf/empty.pb.cc', 'google/protobuf/dynamic_message.cc', 'google/protobuf/duration.pb.cc', 'google/protobuf/descriptor_database.cc', 'google/protobuf/descriptor.pb.cc', 'google/protobuf/descriptor.cc', 'google/protobuf/compiler/parser.cc', 'google/protobuf/compiler/importer.cc', 'google/protobuf/api.pb.cc', 'google/protobuf/any.pb.cc', 'google/protobuf/any.cc', 'google/protobuf/wire_format_lite.cc', 'google/protobuf/stubs/time.cc', 'google/protobuf/stubs/strutil.cc', 'google/protobuf/stubs/structurally_valid.cc', 'google/protobuf/stubs/stringprintf.cc', 'google/protobuf/stubs/stringpiece.cc', 'google/protobuf/stubs/statusor.cc', 'google/protobuf/stubs/status.cc', 'google/protobuf/stubs/once.cc', 'google/protobuf/stubs/int128.cc', 'google/protobuf/stubs/common.cc', 'google/protobuf/stubs/bytestream.cc', 'google/protobuf/stubs/atomicops_internals_x86_msvc.cc', 'google/protobuf/stubs/atomicops_internals_x86_gcc.cc', 'google/protobuf/repeated_field.cc', 'google/protobuf/message_lite.cc', 'google/protobuf/io/zero_copy_stream_impl_lite.cc', 'google/protobuf/io/zero_copy_stream.cc', 'google/protobuf/io/coded_stream.cc', 'google/protobuf/generated_message_util.cc', 'google/protobuf/extension_set.cc', 'google/protobuf/arenastring.cc', 'google/protobuf/arena.cc'] +CC_FILES=['google/protobuf/compiler/zip_writer.cc', 'google/protobuf/compiler/subprocess.cc', 'google/protobuf/compiler/ruby/ruby_generator.cc', 'google/protobuf/compiler/python/python_generator.cc', 'google/protobuf/compiler/plugin.pb.cc', 'google/protobuf/compiler/plugin.cc', 'google/protobuf/compiler/php/php_generator.cc', 'google/protobuf/compiler/objectivec/objectivec_primitive_field.cc', 'google/protobuf/compiler/objectivec/objectivec_oneof.cc', 'google/protobuf/compiler/objectivec/objectivec_message_field.cc', 'google/protobuf/compiler/objectivec/objectivec_message.cc', 'google/protobuf/compiler/objectivec/objectivec_map_field.cc', 'google/protobuf/compiler/objectivec/objectivec_helpers.cc', 'google/protobuf/compiler/objectivec/objectivec_generator.cc', 'google/protobuf/compiler/objectivec/objectivec_file.cc', 'google/protobuf/compiler/objectivec/objectivec_field.cc', 'google/protobuf/compiler/objectivec/objectivec_extension.cc', 'google/protobuf/compiler/objectivec/objectivec_enum_field.cc', 'google/protobuf/compiler/objectivec/objectivec_enum.cc', 'google/protobuf/compiler/js/well_known_types_embed.cc', 'google/protobuf/compiler/js/js_generator.cc', 'google/protobuf/compiler/javanano/javanano_primitive_field.cc', 'google/protobuf/compiler/javanano/javanano_message_field.cc', 'google/protobuf/compiler/javanano/javanano_message.cc', 'google/protobuf/compiler/javanano/javanano_map_field.cc', 'google/protobuf/compiler/javanano/javanano_helpers.cc', 'google/protobuf/compiler/javanano/javanano_generator.cc', 'google/protobuf/compiler/javanano/javanano_file.cc', 'google/protobuf/compiler/javanano/javanano_field.cc', 'google/protobuf/compiler/javanano/javanano_extension.cc', 'google/protobuf/compiler/javanano/javanano_enum_field.cc', 'google/protobuf/compiler/javanano/javanano_enum.cc', 'google/protobuf/compiler/java/java_string_field_lite.cc', 'google/protobuf/compiler/java/java_string_field.cc', 'google/protobuf/compiler/java/java_shared_code_generator.cc', 'google/protobuf/compiler/java/java_service.cc', 'google/protobuf/compiler/java/java_primitive_field_lite.cc', 'google/protobuf/compiler/java/java_primitive_field.cc', 'google/protobuf/compiler/java/java_name_resolver.cc', 'google/protobuf/compiler/java/java_message_lite.cc', 'google/protobuf/compiler/java/java_message_field_lite.cc', 'google/protobuf/compiler/java/java_message_field.cc', 'google/protobuf/compiler/java/java_message_builder_lite.cc', 'google/protobuf/compiler/java/java_message_builder.cc', 'google/protobuf/compiler/java/java_message.cc', 'google/protobuf/compiler/java/java_map_field_lite.cc', 'google/protobuf/compiler/java/java_map_field.cc', 'google/protobuf/compiler/java/java_lazy_message_field_lite.cc', 'google/protobuf/compiler/java/java_lazy_message_field.cc', 'google/protobuf/compiler/java/java_helpers.cc', 'google/protobuf/compiler/java/java_generator_factory.cc', 'google/protobuf/compiler/java/java_generator.cc', 'google/protobuf/compiler/java/java_file.cc', 'google/protobuf/compiler/java/java_field.cc', 'google/protobuf/compiler/java/java_extension_lite.cc', 'google/protobuf/compiler/java/java_extension.cc', 'google/protobuf/compiler/java/java_enum_lite.cc', 'google/protobuf/compiler/java/java_enum_field_lite.cc', 'google/protobuf/compiler/java/java_enum_field.cc', 'google/protobuf/compiler/java/java_enum.cc', 'google/protobuf/compiler/java/java_doc_comment.cc', 'google/protobuf/compiler/java/java_context.cc', 'google/protobuf/compiler/csharp/csharp_wrapper_field.cc', 'google/protobuf/compiler/csharp/csharp_source_generator_base.cc', 'google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc', 'google/protobuf/compiler/csharp/csharp_repeated_message_field.cc', 'google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc', 'google/protobuf/compiler/csharp/csharp_reflection_class.cc', 'google/protobuf/compiler/csharp/csharp_primitive_field.cc', 'google/protobuf/compiler/csharp/csharp_message_field.cc', 'google/protobuf/compiler/csharp/csharp_message.cc', 'google/protobuf/compiler/csharp/csharp_map_field.cc', 'google/protobuf/compiler/csharp/csharp_helpers.cc', 'google/protobuf/compiler/csharp/csharp_generator.cc', 'google/protobuf/compiler/csharp/csharp_field_base.cc', 'google/protobuf/compiler/csharp/csharp_enum_field.cc', 'google/protobuf/compiler/csharp/csharp_enum.cc', 'google/protobuf/compiler/csharp/csharp_doc_comment.cc', 'google/protobuf/compiler/cpp/cpp_string_field.cc', 'google/protobuf/compiler/cpp/cpp_service.cc', 'google/protobuf/compiler/cpp/cpp_primitive_field.cc', 'google/protobuf/compiler/cpp/cpp_message_field.cc', 'google/protobuf/compiler/cpp/cpp_message.cc', 'google/protobuf/compiler/cpp/cpp_map_field.cc', 'google/protobuf/compiler/cpp/cpp_helpers.cc', 'google/protobuf/compiler/cpp/cpp_generator.cc', 'google/protobuf/compiler/cpp/cpp_file.cc', 'google/protobuf/compiler/cpp/cpp_field.cc', 'google/protobuf/compiler/cpp/cpp_extension.cc', 'google/protobuf/compiler/cpp/cpp_enum_field.cc', 'google/protobuf/compiler/cpp/cpp_enum.cc', 'google/protobuf/compiler/command_line_interface.cc', 'google/protobuf/compiler/code_generator.cc', 'google/protobuf/wrappers.pb.cc', 'google/protobuf/wire_format.cc', 'google/protobuf/util/type_resolver_util.cc', 'google/protobuf/util/time_util.cc', 'google/protobuf/util/message_differencer.cc', 'google/protobuf/util/json_util.cc', 'google/protobuf/util/internal/utility.cc', 'google/protobuf/util/internal/type_info_test_helper.cc', 'google/protobuf/util/internal/type_info.cc', 'google/protobuf/util/internal/protostream_objectwriter.cc', 'google/protobuf/util/internal/protostream_objectsource.cc', 'google/protobuf/util/internal/proto_writer.cc', 'google/protobuf/util/internal/object_writer.cc', 'google/protobuf/util/internal/json_stream_parser.cc', 'google/protobuf/util/internal/json_objectwriter.cc', 'google/protobuf/util/internal/json_escaping.cc', 'google/protobuf/util/internal/field_mask_utility.cc', 'google/protobuf/util/internal/error_listener.cc', 'google/protobuf/util/internal/default_value_objectwriter.cc', 'google/protobuf/util/internal/datapiece.cc', 'google/protobuf/util/field_mask_util.cc', 'google/protobuf/util/field_comparator.cc', 'google/protobuf/unknown_field_set.cc', 'google/protobuf/type.pb.cc', 'google/protobuf/timestamp.pb.cc', 'google/protobuf/text_format.cc', 'google/protobuf/stubs/substitute.cc', 'google/protobuf/stubs/mathlimits.cc', 'google/protobuf/struct.pb.cc', 'google/protobuf/source_context.pb.cc', 'google/protobuf/service.cc', 'google/protobuf/reflection_ops.cc', 'google/protobuf/message.cc', 'google/protobuf/map_field.cc', 'google/protobuf/io/zero_copy_stream_impl.cc', 'google/protobuf/io/tokenizer.cc', 'google/protobuf/io/strtod.cc', 'google/protobuf/io/printer.cc', 'google/protobuf/io/gzip_stream.cc', 'google/protobuf/generated_message_reflection.cc', 'google/protobuf/field_mask.pb.cc', 'google/protobuf/extension_set_heavy.cc', 'google/protobuf/empty.pb.cc', 'google/protobuf/dynamic_message.cc', 'google/protobuf/duration.pb.cc', 'google/protobuf/descriptor_database.cc', 'google/protobuf/descriptor.pb.cc', 'google/protobuf/descriptor.cc', 'google/protobuf/compiler/parser.cc', 'google/protobuf/compiler/importer.cc', 'google/protobuf/api.pb.cc', 'google/protobuf/any.pb.cc', 'google/protobuf/any.cc', 'google/protobuf/wire_format_lite.cc', 'google/protobuf/stubs/time.cc', 'google/protobuf/stubs/strutil.cc', 'google/protobuf/stubs/structurally_valid.cc', 'google/protobuf/stubs/stringprintf.cc', 'google/protobuf/stubs/stringpiece.cc', 'google/protobuf/stubs/statusor.cc', 'google/protobuf/stubs/status.cc', 'google/protobuf/stubs/once.cc', 'google/protobuf/stubs/int128.cc', 'google/protobuf/stubs/common.cc', 'google/protobuf/stubs/bytestream.cc', 'google/protobuf/stubs/atomicops_internals_x86_msvc.cc', 'google/protobuf/stubs/atomicops_internals_x86_gcc.cc', 'google/protobuf/repeated_field.cc', 'google/protobuf/message_lite.cc', 'google/protobuf/io/zero_copy_stream_impl_lite.cc', 'google/protobuf/io/zero_copy_stream.cc', 'google/protobuf/io/coded_stream.cc', 'google/protobuf/generated_message_util.cc', 'google/protobuf/extension_set.cc', 'google/protobuf/arenastring.cc', 'google/protobuf/arena.cc', 'google/protobuf/compiler/js/embed.cc'] PROTO_FILES=['google/protobuf/wrappers.proto', 'google/protobuf/type.proto', 'google/protobuf/timestamp.proto', 'google/protobuf/struct.proto', 'google/protobuf/source_context.proto', 'google/protobuf/field_mask.proto', 'google/protobuf/empty.proto', 'google/protobuf/duration.proto', 'google/protobuf/descriptor.proto', 'google/protobuf/compiler/plugin.proto', 'google/protobuf/api.proto', 'google/protobuf/any.proto'] CC_INCLUDE='third_party/protobuf/src' From a3d87cad7e2139f175ec41784f0c16cd5f76b981 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 23 Feb 2017 15:27:44 +0100 Subject: [PATCH 40/52] fix C# nuget restore --- .../packages.config | 3 --- .../packages.config | 3 --- tools/run_tests/helper_scripts/pre_build_csharp.bat | 12 ------------ tools/run_tests/helper_scripts/pre_build_csharp.sh | 12 ------------ 4 files changed, 30 deletions(-) delete mode 100644 src/csharp/Grpc.IntegrationTesting.QpsWorker/packages.config delete mode 100644 src/csharp/Grpc.IntegrationTesting.StressClient/packages.config diff --git a/src/csharp/Grpc.IntegrationTesting.QpsWorker/packages.config b/src/csharp/Grpc.IntegrationTesting.QpsWorker/packages.config deleted file mode 100644 index 79ece06bef6..00000000000 --- a/src/csharp/Grpc.IntegrationTesting.QpsWorker/packages.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/csharp/Grpc.IntegrationTesting.StressClient/packages.config b/src/csharp/Grpc.IntegrationTesting.StressClient/packages.config deleted file mode 100644 index 79ece06bef6..00000000000 --- a/src/csharp/Grpc.IntegrationTesting.StressClient/packages.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/tools/run_tests/helper_scripts/pre_build_csharp.bat b/tools/run_tests/helper_scripts/pre_build_csharp.bat index f37f63b5840..99df1c66268 100644 --- a/tools/run_tests/helper_scripts/pre_build_csharp.bat +++ b/tools/run_tests/helper_scripts/pre_build_csharp.bat @@ -89,18 +89,6 @@ if exist %NUGET% ( %NUGET% restore -PackagesDirectory ../packages || goto :error cd .. - cd Grpc.IntegrationTesting.Client || goto :error - %NUGET% restore -PackagesDirectory ../packages || goto :error - cd .. - - cd Grpc.IntegrationTesting.QpsWorker || goto :error - %NUGET% restore -PackagesDirectory ../packages || goto :error - cd .. - - cd Grpc.IntegrationTesting.StressClient || goto :error - %NUGET% restore -PackagesDirectory ../packages || goto :error - cd .. - cd Grpc.IntegrationTesting || goto :error %NUGET% restore -PackagesDirectory ../packages || goto :error diff --git a/tools/run_tests/helper_scripts/pre_build_csharp.sh b/tools/run_tests/helper_scripts/pre_build_csharp.sh index 1f808556f48..d7665e15af6 100755 --- a/tools/run_tests/helper_scripts/pre_build_csharp.sh +++ b/tools/run_tests/helper_scripts/pre_build_csharp.sh @@ -73,18 +73,6 @@ then nuget restore -PackagesDirectory ../packages cd .. - cd Grpc.IntegrationTesting.Client - nuget restore -PackagesDirectory ../packages - cd .. - - cd Grpc.IntegrationTesting.QpsWorker - nuget restore -PackagesDirectory ../packages - cd .. - - cd Grpc.IntegrationTesting.StressClient - nuget restore -PackagesDirectory ../packages - cd .. - cd Grpc.IntegrationTesting nuget restore -PackagesDirectory ../packages cd .. From 065d9244361ba3194b5104753b102dc7624347b7 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Mon, 27 Feb 2017 16:41:59 -0800 Subject: [PATCH 41/52] Updated python scripts to work with protobuf 3.2.0 Since the build script of python grpcio-tools package is very much entangled with the build system of protobuf, and protobuf build scripts added a build step that compiles js/embed.cc to create a preprocessor binary that takes some .js files and generates a single well_known_types_embed.cc which then gets linked to the rest of protobuf source tree. The generated code seems to be used only by the JS portion of protoc, so is not expected to affect our python build. Since we did not want to replicate the entire build process of protobuf, we decided to pre-generate the well_known_types_embed.cc and keep it in our repo and then substitute the js/embed.cc compiler file with it. --- ...otobuf_generated_well_known_types_embed.cc | 343 ++++++++++++++++++ tools/distrib/python/grpcio_tools/setup.py | 22 +- 2 files changed, 362 insertions(+), 3 deletions(-) create mode 100644 tools/distrib/python/grpcio_tools/grpc_tools/protobuf_generated_well_known_types_embed.cc diff --git a/tools/distrib/python/grpcio_tools/grpc_tools/protobuf_generated_well_known_types_embed.cc b/tools/distrib/python/grpcio_tools/grpc_tools/protobuf_generated_well_known_types_embed.cc new file mode 100644 index 00000000000..682837a27f0 --- /dev/null +++ b/tools/distrib/python/grpcio_tools/grpc_tools/protobuf_generated_well_known_types_embed.cc @@ -0,0 +1,343 @@ +// Copyright 2017, 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. + +// HACK: Embed the generated well_known_types_js.cc to make +// grpc-tools python package compilation easy. +#include +struct FileToc well_known_types_js[] = { +{"any.js", + "// Protocol Buffers - Google's data interchange format\n" + "// Copyright 2008 Google Inc. All rights reserved.\n" + "// https://developers.google.com/protocol-buffers/\n" + "//\n" + "// Redistribution and use in source and binary forms, with or without\n" + "// modification, are permitted provided that the following conditions are\n" + "// met:\n" + "//\n" + "// * Redistributions of source code must retain the above copyright\n" + "// notice, this list of conditions and the following disclaimer.\n" + "// * Redistributions in binary form must reproduce the above\n" + "// copyright notice, this list of conditions and the following disclaimer\n" + "// in the documentation and/or other materials provided with the\n" + "// distribution.\n" + "// * Neither the name of Google Inc. nor the names of its\n" + "// contributors may be used to endorse or promote products derived from\n" + "// this software without specific prior written permission.\n" + "//\n" + "// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n" + "// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n" + "// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n" + "// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n" + "// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n" + "// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n" + "// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n" + "// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n" + "// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n" + "// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n" + "// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" + "\n" + "/* This code will be inserted into generated code for\n" + " * google/protobuf/any.proto. */\n" + "\n" + "/**\n" + " * Returns the type name contained in this instance, if any.\n" + " * @return {string|undefined}\n" + " */\n" + "proto.google.protobuf.Any.prototype.getTypeName = function() {\n" + " return this.getTypeUrl().split('/').pop();\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Packs the given message instance into this Any.\n" + " * @param {!Uint8Array} serialized The serialized data to pack.\n" + " * @param {string} name The type name of this message object.\n" + " * @param {string=} opt_typeUrlPrefix the type URL prefix.\n" + " */\n" + "proto.google.protobuf.Any.prototype.pack = function(serialized, name,\n" + " opt_typeUrlPrefix) {\n" + " if (!opt_typeUrlPrefix) {\n" + " opt_typeUrlPrefix = 'type.googleapis.com/';\n" + " }\n" + "\n" + " if (opt_typeUrlPrefix.substr(-1) != '/') {\n" + " this.setTypeUrl(opt_typeUrlPrefix + '/' + name);\n" + " } else {\n" + " this.setTypeUrl(opt_typeUrlPrefix + name);\n" + " }\n" + "\n" + " this.setValue(serialized);\n" + "};\n" + "\n" + "\n" + "/**\n" + " * @template T\n" + " * Unpacks this Any into the given message object.\n" + " * @param {function(Uint8Array):T} deserialize Function that will deserialize\n" + " * the binary data properly.\n" + " * @param {string} name The expected type name of this message object.\n" + " * @return {?T} If the name matched the expected name, returns the deserialized\n" + " * object, otherwise returns undefined.\n" + " */\n" + "proto.google.protobuf.Any.prototype.unpack = function(deserialize, name) {\n" + " if (this.getTypeName() == name) {\n" + " return deserialize(this.getValue_asU8());\n" + " } else {\n" + " return null;\n" + " }\n" + "};\n" +}, +{"struct.js", + "// Protocol Buffers - Google's data interchange format\n" + "// Copyright 2008 Google Inc. All rights reserved.\n" + "// https://developers.google.com/protocol-buffers/\n" + "//\n" + "// Redistribution and use in source and binary forms, with or without\n" + "// modification, are permitted provided that the following conditions are\n" + "// met:\n" + "//\n" + "// * Redistributions of source code must retain the above copyright\n" + "// notice, this list of conditions and the following disclaimer.\n" + "// * Redistributions in binary form must reproduce the above\n" + "// copyright notice, this list of conditions and the following disclaimer\n" + "// in the documentation and/or other materials provided with the\n" + "// distribution.\n" + "// * Neither the name of Google Inc. nor the names of its\n" + "// contributors may be used to endorse or promote products derived from\n" + "// this software without specific prior written permission.\n" + "//\n" + "// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n" + "// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n" + "// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n" + "// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n" + "// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n" + "// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n" + "// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n" + "// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n" + "// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n" + "// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n" + "// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" + "\n" + "/* This code will be inserted into generated code for\n" + " * google/protobuf/struct.proto. */\n" + "\n" + "/**\n" + " * Typedef representing plain JavaScript values that can go into a\n" + " * Struct.\n" + " * @typedef {null|number|string|boolean|Array|Object}\n" + " */\n" + "proto.google.protobuf.JavaScriptValue;\n" + "\n" + "\n" + "/**\n" + " * Converts this Value object to a plain JavaScript value.\n" + " * @return {?proto.google.protobuf.JavaScriptValue} a plain JavaScript\n" + " * value representing this Struct.\n" + " */\n" + "proto.google.protobuf.Value.prototype.toJavaScript = function() {\n" + " var kindCase = proto.google.protobuf.Value.KindCase;\n" + " switch (this.getKindCase()) {\n" + " case kindCase.NULL_VALUE:\n" + " return null;\n" + " case kindCase.NUMBER_VALUE:\n" + " return this.getNumberValue();\n" + " case kindCase.STRING_VALUE:\n" + " return this.getStringValue();\n" + " case kindCase.BOOL_VALUE:\n" + " return this.getBoolValue();\n" + " case kindCase.STRUCT_VALUE:\n" + " return this.getStructValue().toJavaScript();\n" + " case kindCase.LIST_VALUE:\n" + " return this.getListValue().toJavaScript();\n" + " default:\n" + " throw new Error('Unexpected struct type');\n" + " }\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Converts this JavaScript value to a new Value proto.\n" + " * @param {!proto.google.protobuf.JavaScriptValue} value The value to\n" + " * convert.\n" + " * @return {!proto.google.protobuf.Value} The newly constructed value.\n" + " */\n" + "proto.google.protobuf.Value.fromJavaScript = function(value) {\n" + " var ret = new proto.google.protobuf.Value();\n" + " switch (goog.typeOf(value)) {\n" + " case 'string':\n" + " ret.setStringValue(/** @type {string} */ (value));\n" + " break;\n" + " case 'number':\n" + " ret.setNumberValue(/** @type {number} */ (value));\n" + " break;\n" + " case 'boolean':\n" + " ret.setBoolValue(/** @type {boolean} */ (value));\n" + " break;\n" + " case 'null':\n" + " ret.setNullValue(proto.google.protobuf.NullValue.NULL_VALUE);\n" + " break;\n" + " case 'array':\n" + " ret.setListValue(proto.google.protobuf.ListValue.fromJavaScript(\n" + " /** @type{!Array} */ (value)));\n" + " break;\n" + " case 'object':\n" + " ret.setStructValue(proto.google.protobuf.Struct.fromJavaScript(\n" + " /** @type{!Object} */ (value)));\n" + " break;\n" + " default:\n" + " throw new Error('Unexpected struct type.');\n" + " }\n" + "\n" + " return ret;\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Converts this ListValue object to a plain JavaScript array.\n" + " * @return {!Array} a plain JavaScript array representing this List.\n" + " */\n" + "proto.google.protobuf.ListValue.prototype.toJavaScript = function() {\n" + " var ret = [];\n" + " var values = this.getValuesList();\n" + "\n" + " for (var i = 0; i < values.length; i++) {\n" + " ret[i] = values[i].toJavaScript();\n" + " }\n" + "\n" + " return ret;\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Constructs a ListValue protobuf from this plain JavaScript array.\n" + " * @param {!Array} array a plain JavaScript array\n" + " * @return {proto.google.protobuf.ListValue} a new ListValue object\n" + " */\n" + "proto.google.protobuf.ListValue.fromJavaScript = function(array) {\n" + " var ret = new proto.google.protobuf.ListValue();\n" + "\n" + " for (var i = 0; i < array.length; i++) {\n" + " ret.addValues(proto.google.protobuf.Value.fromJavaScript(array[i]));\n" + " }\n" + "\n" + " return ret;\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Converts this Struct object to a plain JavaScript object.\n" + " * @return {!Object} a plain\n" + " * JavaScript object representing this Struct.\n" + " */\n" + "proto.google.protobuf.Struct.prototype.toJavaScript = function() {\n" + " var ret = {};\n" + "\n" + " this.getFieldsMap().forEach(function(value, key) {\n" + " ret[key] = value.toJavaScript();\n" + " });\n" + "\n" + " return ret;\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Constructs a Struct protobuf from this plain JavaScript object.\n" + " * @param {!Object} obj a plain JavaScript object\n" + " * @return {proto.google.protobuf.Struct} a new Struct object\n" + " */\n" + "proto.google.protobuf.Struct.fromJavaScript = function(obj) {\n" + " var ret = new proto.google.protobuf.Struct();\n" + " var map = ret.getFieldsMap();\n" + "\n" + " for (var property in obj) {\n" + " var val = obj[property];\n" + " map.set(property, proto.google.protobuf.Value.fromJavaScript(val));\n" + " }\n" + "\n" + " return ret;\n" + "};\n" +}, +{"timestamp.js", + "// Protocol Buffers - Google's data interchange format\n" + "// Copyright 2008 Google Inc. All rights reserved.\n" + "// https://developers.google.com/protocol-buffers/\n" + "//\n" + "// Redistribution and use in source and binary forms, with or without\n" + "// modification, are permitted provided that the following conditions are\n" + "// met:\n" + "//\n" + "// * Redistributions of source code must retain the above copyright\n" + "// notice, this list of conditions and the following disclaimer.\n" + "// * Redistributions in binary form must reproduce the above\n" + "// copyright notice, this list of conditions and the following disclaimer\n" + "// in the documentation and/or other materials provided with the\n" + "// distribution.\n" + "// * Neither the name of Google Inc. nor the names of its\n" + "// contributors may be used to endorse or promote products derived from\n" + "// this software without specific prior written permission.\n" + "//\n" + "// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n" + "// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n" + "// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n" + "// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n" + "// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n" + "// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n" + "// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n" + "// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n" + "// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n" + "// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n" + "// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" + "\n" + "/* This code will be inserted into generated code for\n" + " * google/protobuf/timestamp.proto. */\n" + "\n" + "/**\n" + " * Returns a JavaScript 'Date' object corresponding to this Timestamp.\n" + " * @return {!Date}\n" + " */\n" + "proto.google.protobuf.Timestamp.prototype.toDate = function() {\n" + " var seconds = this.getSeconds();\n" + " var nanos = this.getNanos();\n" + "\n" + " return new Date((seconds * 1000) + (nanos / 1000000));\n" + "};\n" + "\n" + "\n" + "/**\n" + " * Sets the value of this Timestamp object to be the given Date.\n" + " * @param {!Date} value The value to set.\n" + " */\n" + "proto.google.protobuf.Timestamp.prototype.fromDate = function(value) {\n" + " var millis = value.getTime();\n" + " this.setSeconds(Math.floor(value.getTime() / 1000));\n" + " this.setNanos(value.getMilliseconds() * 1000000);\n" + "};\n" +}, + {NULL, NULL} // Terminate the list. +}; diff --git a/tools/distrib/python/grpcio_tools/setup.py b/tools/distrib/python/grpcio_tools/setup.py index 502d7ef27b8..79d9fccb4a8 100644 --- a/tools/distrib/python/grpcio_tools/setup.py +++ b/tools/distrib/python/grpcio_tools/setup.py @@ -157,11 +157,27 @@ def extension_modules(): plugin_sources = [os.path.join('grpc_tools', '_protoc_compiler.pyx')] else: plugin_sources = [os.path.join('grpc_tools', '_protoc_compiler.cpp')] + plugin_sources += [ os.path.join('grpc_tools', 'main.cc'), - os.path.join('grpc_root', 'src', 'compiler', 'python_generator.cc')] + [ - os.path.join(CC_INCLUDE, cc_file) - for cc_file in CC_FILES] + os.path.join('grpc_root', 'src', 'compiler', 'python_generator.cc')] + + #HACK: Substitute the embed.cc, which is a JS to C++ + # preprocessor with the generated code. + # The generated code should not be material + # to the parts of protoc we use (it affects + # the JavaScript code generator, supposedly), + # but we need to be cautious about it. + cc_files_clone = list(CC_FILES) + JS_EMBED_PROCESSOR_SOURCE_FILE = 'google/protobuf/compiler/js/embed.cc' + JS_WELL_KNOWN_TYPES_FILE = 'google/protobuf/compiler/js/well_known_types_embed.cc' + if JS_EMBED_PROCESSOR_SOURCE_FILE in cc_files_clone: + cc_files_clone.remove(JS_EMBED_PROCESSOR_SOURCE_FILE) + if JS_WELL_KNOWN_TYPES_FILE in cc_files_clone: + cc_files_clone.remove(JS_WELL_KNOWN_TYPES_FILE) + plugin_sources += [os.path.join('grpc_tools', 'protobuf_generated_well_known_types_embed.cc')] + plugin_sources += [os.path.join(CC_INCLUDE, cc_file) for cc_file in cc_files_clone] + plugin_ext = extension.Extension( name='grpc_tools._protoc_compiler', sources=plugin_sources, From 3b7bcc3eb01c4f6cd1c88df0ba86ba39f7eb4635 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 7 Mar 2017 12:59:41 +0100 Subject: [PATCH 42/52] fix grpcio_tools build on windows --- tools/distrib/python/grpcio_tools/setup.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/distrib/python/grpcio_tools/setup.py b/tools/distrib/python/grpcio_tools/setup.py index 79d9fccb4a8..b6916fa16fb 100644 --- a/tools/distrib/python/grpcio_tools/setup.py +++ b/tools/distrib/python/grpcio_tools/setup.py @@ -169,12 +169,13 @@ def extension_modules(): # the JavaScript code generator, supposedly), # but we need to be cautious about it. cc_files_clone = list(CC_FILES) - JS_EMBED_PROCESSOR_SOURCE_FILE = 'google/protobuf/compiler/js/embed.cc' - JS_WELL_KNOWN_TYPES_FILE = 'google/protobuf/compiler/js/well_known_types_embed.cc' - if JS_EMBED_PROCESSOR_SOURCE_FILE in cc_files_clone: - cc_files_clone.remove(JS_EMBED_PROCESSOR_SOURCE_FILE) - if JS_WELL_KNOWN_TYPES_FILE in cc_files_clone: - cc_files_clone.remove(JS_WELL_KNOWN_TYPES_FILE) + embed_cc_file = os.path.normpath('google/protobuf/compiler/js/embed.cc') + well_known_types_file = os.path.normpath( + 'google/protobuf/compiler/js/well_known_types_embed.cc') + if embed_cc_file in cc_files_clone: + cc_files_clone.remove(embed_cc_file) + if well_known_types_file in cc_files_clone: + cc_files_clone.remove(well_known_types_file) plugin_sources += [os.path.join('grpc_tools', 'protobuf_generated_well_known_types_embed.cc')] plugin_sources += [os.path.join(CC_INCLUDE, cc_file) for cc_file in cc_files_clone] From f26236a159300c92633fafd0a906691165bc3289 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 7 Mar 2017 09:43:51 -0800 Subject: [PATCH 43/52] Silence accept4 message when its irrelevant --- src/core/lib/iomgr/tcp_server_posix.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/core/lib/iomgr/tcp_server_posix.c b/src/core/lib/iomgr/tcp_server_posix.c index 36f878fdd4d..b93e9c410ac 100644 --- a/src/core/lib/iomgr/tcp_server_posix.c +++ b/src/core/lib/iomgr/tcp_server_posix.c @@ -114,6 +114,8 @@ struct grpc_tcp_server { /* is this server shutting down? */ bool shutdown; + /* have listeners been shutdown? */ + bool shutdown_listeners; /* use SO_REUSEPORT */ bool so_reuseport; /* expand wildcard addresses to a list of all local addresses */ @@ -422,7 +424,12 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *err) { grpc_fd_notify_on_read(exec_ctx, sp->emfd, &sp->read_closure); return; default: - gpr_log(GPR_ERROR, "Failed accept4: %s", strerror(errno)); + if (!sp->server->shutdown_listeners) { + gpr_log(GPR_ERROR, "Failed accept4: %s", strerror(errno)); + } else { + /* if we have shutdown listeners, accept4 could fail, and we + needn't notify users */ + } goto error; } } @@ -438,11 +445,6 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *err) { grpc_fd *fdobj = grpc_fd_create(fd, name); - if (read_notifier_pollset == NULL) { - gpr_log(GPR_ERROR, "Read notifier pollset is not set on the fd"); - goto error; - } - grpc_pollset_add_fd(exec_ctx, read_notifier_pollset, fdobj); // Create acceptor. @@ -941,6 +943,7 @@ void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) { void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) { gpr_mu_lock(&s->mu); + s->shutdown_listeners = true; /* shutdown all fd's */ if (s->active_ports) { grpc_tcp_listener *sp; From 702a445dc199bd3308bbb70b94ef50386cedd215 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 7 Mar 2017 09:53:00 -0800 Subject: [PATCH 44/52] Fix initialization --- src/core/lib/iomgr/tcp_server_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/lib/iomgr/tcp_server_posix.c b/src/core/lib/iomgr/tcp_server_posix.c index b93e9c410ac..a17f6d48eff 100644 --- a/src/core/lib/iomgr/tcp_server_posix.c +++ b/src/core/lib/iomgr/tcp_server_posix.c @@ -163,7 +163,7 @@ grpc_error *grpc_tcp_server_create(grpc_exec_ctx *exec_ctx, grpc_tcp_server **server) { gpr_once_init(&check_init, init); - grpc_tcp_server *s = gpr_malloc(sizeof(grpc_tcp_server)); + grpc_tcp_server *s = gpr_zalloc(sizeof(grpc_tcp_server)); s->so_reuseport = has_so_reuseport; s->resource_quota = grpc_resource_quota_create(NULL); s->expand_wildcard_addrs = false; From 9cf08b6bea66a801506f66193389822d3049c112 Mon Sep 17 00:00:00 2001 From: Robbie Shade Date: Tue, 7 Mar 2017 10:34:17 -0500 Subject: [PATCH 45/52] Fix flaky use-after-free in udp_server --- src/core/lib/iomgr/udp_server.c | 6 +++++- third_party/gflags | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/lib/iomgr/udp_server.c b/src/core/lib/iomgr/udp_server.c index 2a1c8d39fae..d1bcd89af1f 100644 --- a/src/core/lib/iomgr/udp_server.c +++ b/src/core/lib/iomgr/udp_server.c @@ -485,7 +485,11 @@ void grpc_udp_server_start(grpc_exec_ctx *exec_ctx, grpc_udp_server *s, grpc_schedule_on_exec_ctx); grpc_fd_notify_on_write(exec_ctx, sp->emfd, &sp->write_closure); - s->active_ports++; + /* Registered for both read and write callbacks: increment active_ports + * twice to account for this, and delay free-ing of memory until both + * on_read and on_write have fired. */ + s->active_ports += 2; + sp = sp->next; } diff --git a/third_party/gflags b/third_party/gflags index 30dbc81fb5f..f8a0efe03aa 160000 --- a/third_party/gflags +++ b/third_party/gflags @@ -1 +1 @@ -Subproject commit 30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e +Subproject commit f8a0efe03aa69b3336d8e228b37d4ccb17324b88 From 7c1aafb3f9dbc284f2041773002379c9def00f72 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Tue, 7 Mar 2017 14:07:53 -0800 Subject: [PATCH 46/52] Revert "Fix flaky use-after-free in udp_server" --- src/core/lib/iomgr/udp_server.c | 6 +----- third_party/gflags | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core/lib/iomgr/udp_server.c b/src/core/lib/iomgr/udp_server.c index d1bcd89af1f..2a1c8d39fae 100644 --- a/src/core/lib/iomgr/udp_server.c +++ b/src/core/lib/iomgr/udp_server.c @@ -485,11 +485,7 @@ void grpc_udp_server_start(grpc_exec_ctx *exec_ctx, grpc_udp_server *s, grpc_schedule_on_exec_ctx); grpc_fd_notify_on_write(exec_ctx, sp->emfd, &sp->write_closure); - /* Registered for both read and write callbacks: increment active_ports - * twice to account for this, and delay free-ing of memory until both - * on_read and on_write have fired. */ - s->active_ports += 2; - + s->active_ports++; sp = sp->next; } diff --git a/third_party/gflags b/third_party/gflags index f8a0efe03aa..30dbc81fb5f 160000 --- a/third_party/gflags +++ b/third_party/gflags @@ -1 +1 @@ -Subproject commit f8a0efe03aa69b3336d8e228b37d4ccb17324b88 +Subproject commit 30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e From 9b3c73d1cd1544a7ccb6ee231862a072b4a46cd1 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 7 Mar 2017 22:10:15 +0000 Subject: [PATCH 47/52] Updated protobuf dependency for python to 3.2.0 --- setup.py | 2 +- src/python/grpcio_health_checking/setup.py | 2 +- src/python/grpcio_reflection/setup.py | 2 +- src/python/grpcio_tests/setup.py | 2 +- templates/tools/dockerfile/python_deps.include | 2 +- tools/distrib/python/grpcio_tools/setup.py | 2 +- tools/dockerfile/grpc_artifact_linux_x64/Dockerfile | 2 +- tools/dockerfile/grpc_artifact_linux_x86/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile | 2 +- .../interoptest/grpc_interop_csharpcoreclr/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_go/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_java/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_node/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_python/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile | 2 +- .../stress_test/grpc_interop_stress_csharp/Dockerfile | 2 +- tools/dockerfile/stress_test/grpc_interop_stress_cxx/Dockerfile | 2 +- tools/dockerfile/stress_test/grpc_interop_stress_go/Dockerfile | 2 +- .../dockerfile/stress_test/grpc_interop_stress_java/Dockerfile | 2 +- .../dockerfile/stress_test/grpc_interop_stress_node/Dockerfile | 2 +- tools/dockerfile/stress_test/grpc_interop_stress_php/Dockerfile | 2 +- .../stress_test/grpc_interop_stress_python/Dockerfile | 2 +- .../dockerfile/stress_test/grpc_interop_stress_ruby/Dockerfile | 2 +- tools/dockerfile/test/csharp_coreclr_x64/Dockerfile | 2 +- tools/dockerfile/test/csharp_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_jessie_x86/Dockerfile | 2 +- tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_wheezy_x64/Dockerfile | 2 +- tools/dockerfile/test/fuzzer/Dockerfile | 2 +- tools/dockerfile/test/multilang_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/node_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/php7_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/php_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/python_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/python_pyenv_x64/Dockerfile | 2 +- tools/dockerfile/test/ruby_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/sanity/Dockerfile | 2 +- 41 files changed, 41 insertions(+), 41 deletions(-) diff --git a/setup.py b/setup.py index 234252a16ca..d5b843fdace 100644 --- a/setup.py +++ b/setup.py @@ -209,7 +209,7 @@ INSTALL_REQUIRES = ( 'enum34>=1.0.4', # TODO(atash): eventually split the grpcio package into a metapackage # depending on protobuf and the runtime component (independent of protobuf) - 'protobuf>=3.0.0', + 'protobuf>=3.2.0', ) if not PY3: diff --git a/src/python/grpcio_health_checking/setup.py b/src/python/grpcio_health_checking/setup.py index 072c3263c6e..52ee98a2d5b 100644 --- a/src/python/grpcio_health_checking/setup.py +++ b/src/python/grpcio_health_checking/setup.py @@ -47,7 +47,7 @@ PACKAGE_DIRECTORIES = { SETUP_REQUIRES = ( 'grpcio-tools>={version}'.format(version=grpc_version.VERSION),) -INSTALL_REQUIRES = ('protobuf>=3.0.0', +INSTALL_REQUIRES = ('protobuf>=3.2.0', 'grpcio>={version}'.format(version=grpc_version.VERSION),) COMMAND_CLASS = { diff --git a/src/python/grpcio_reflection/setup.py b/src/python/grpcio_reflection/setup.py index 19aafe443a9..e85092db570 100644 --- a/src/python/grpcio_reflection/setup.py +++ b/src/python/grpcio_reflection/setup.py @@ -47,7 +47,7 @@ PACKAGE_DIRECTORIES = { SETUP_REQUIRES = ( 'grpcio-tools>={version}'.format(version=grpc_version.VERSION),) -INSTALL_REQUIRES = ('protobuf>=3.0.0', +INSTALL_REQUIRES = ('protobuf>=3.2.0', 'grpcio>={version}'.format(version=grpc_version.VERSION),) COMMAND_CLASS = { diff --git a/src/python/grpcio_tests/setup.py b/src/python/grpcio_tests/setup.py index b0c73fc575b..b9f0264dae3 100644 --- a/src/python/grpcio_tests/setup.py +++ b/src/python/grpcio_tests/setup.py @@ -56,7 +56,7 @@ INSTALL_REQUIRES = ( 'grpcio>={version}'.format(version=grpc_version.VERSION), 'grpcio-tools>={version}'.format(version=grpc_version.VERSION), 'grpcio-health-checking>={version}'.format(version=grpc_version.VERSION), - 'oauth2client>=1.4.7', 'protobuf>=3.0.0', 'six>=1.10',) + 'oauth2client>=1.4.7', 'protobuf>=3.2.0', 'six>=1.10',) COMMAND_CLASS = { # Run `preprocess` *before* doing any packaging! diff --git a/templates/tools/dockerfile/python_deps.include b/templates/tools/dockerfile/python_deps.include index 26c91f495d5..2c129814184 100644 --- a/templates/tools/dockerfile/python_deps.include +++ b/templates/tools/dockerfile/python_deps.include @@ -11,4 +11,4 @@ RUN apt-get update && apt-get install -y ${'\\'} # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 diff --git a/tools/distrib/python/grpcio_tools/setup.py b/tools/distrib/python/grpcio_tools/setup.py index b6916fa16fb..ed27f1f8350 100644 --- a/tools/distrib/python/grpcio_tools/setup.py +++ b/tools/distrib/python/grpcio_tools/setup.py @@ -207,7 +207,7 @@ setuptools.setup( ext_modules=extension_modules(), packages=setuptools.find_packages('.'), install_requires=[ - 'protobuf>=3.0.0', + 'protobuf>=3.2.0', 'grpcio>={version}'.format(version=grpc_version.VERSION), ], package_data=package_data(), diff --git a/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile b/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile index 669e3557b89..34799447171 100644 --- a/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile +++ b/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 ################## diff --git a/tools/dockerfile/grpc_artifact_linux_x86/Dockerfile b/tools/dockerfile/grpc_artifact_linux_x86/Dockerfile index 860b8f4fb94..75d156f6d85 100644 --- a/tools/dockerfile/grpc_artifact_linux_x86/Dockerfile +++ b/tools/dockerfile/grpc_artifact_linux_x86/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 ################## diff --git a/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile index 087cc4e2bb4..14a2468abc7 100644 --- a/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================ # C# dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile index efe6e39118b..91639829dcd 100644 --- a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================ # C# dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile index aa77d5f1272..2d10e3fdfef 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================= # C++ dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile index 05e963d1e67..d3bf071c72e 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile @@ -45,7 +45,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile index 3a5e15d21bd..66d9b4f6403 100644 --- a/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile @@ -45,7 +45,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 RUN pip install twisted h2 diff --git a/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile index b5fe54f9918..2023467d593 100644 --- a/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile @@ -60,7 +60,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 # Trigger download of as many Gradle artifacts as possible. diff --git a/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile index d9a75018295..9945260ea4a 100644 --- a/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================== # Node dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile index 10a88916ada..94c17078d34 100644 --- a/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile index dae64e5c8cb..679c8ff47a6 100644 --- a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================== # Ruby dependencies diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_csharp/Dockerfile b/tools/dockerfile/stress_test/grpc_interop_stress_csharp/Dockerfile index 328825392b7..cd1e9343417 100644 --- a/tools/dockerfile/stress_test/grpc_interop_stress_csharp/Dockerfile +++ b/tools/dockerfile/stress_test/grpc_interop_stress_csharp/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_cxx/Dockerfile b/tools/dockerfile/stress_test/grpc_interop_stress_cxx/Dockerfile index e082da648b3..d0f66d99556 100644 --- a/tools/dockerfile/stress_test/grpc_interop_stress_cxx/Dockerfile +++ b/tools/dockerfile/stress_test/grpc_interop_stress_cxx/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_go/Dockerfile b/tools/dockerfile/stress_test/grpc_interop_stress_go/Dockerfile index 1e2b7d8c671..bbf7de7f91d 100644 --- a/tools/dockerfile/stress_test/grpc_interop_stress_go/Dockerfile +++ b/tools/dockerfile/stress_test/grpc_interop_stress_go/Dockerfile @@ -47,7 +47,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 # Using login shell removes Go from path, so we add it. RUN ln -s /usr/local/go/bin/go /usr/local/bin diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_java/Dockerfile b/tools/dockerfile/stress_test/grpc_interop_stress_java/Dockerfile index 0c17ff595ef..229ea469c42 100644 --- a/tools/dockerfile/stress_test/grpc_interop_stress_java/Dockerfile +++ b/tools/dockerfile/stress_test/grpc_interop_stress_java/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_node/Dockerfile b/tools/dockerfile/stress_test/grpc_interop_stress_node/Dockerfile index 0594f69a5b8..5fd0bc0eb21 100644 --- a/tools/dockerfile/stress_test/grpc_interop_stress_node/Dockerfile +++ b/tools/dockerfile/stress_test/grpc_interop_stress_node/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================== # Node dependencies diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_php/Dockerfile b/tools/dockerfile/stress_test/grpc_interop_stress_php/Dockerfile index 0fe9c151e53..b5198b46529 100644 --- a/tools/dockerfile/stress_test/grpc_interop_stress_php/Dockerfile +++ b/tools/dockerfile/stress_test/grpc_interop_stress_php/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================== # Ruby dependencies diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_python/Dockerfile b/tools/dockerfile/stress_test/grpc_interop_stress_python/Dockerfile index 20d2d3f57be..8e1de51f331 100644 --- a/tools/dockerfile/stress_test/grpc_interop_stress_python/Dockerfile +++ b/tools/dockerfile/stress_test/grpc_interop_stress_python/Dockerfile @@ -93,7 +93,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 RUN pip install coverage diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_ruby/Dockerfile b/tools/dockerfile/stress_test/grpc_interop_stress_ruby/Dockerfile index f459153fe54..9d291aac583 100644 --- a/tools/dockerfile/stress_test/grpc_interop_stress_ruby/Dockerfile +++ b/tools/dockerfile/stress_test/grpc_interop_stress_ruby/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/test/csharp_coreclr_x64/Dockerfile b/tools/dockerfile/test/csharp_coreclr_x64/Dockerfile index efe6e39118b..91639829dcd 100644 --- a/tools/dockerfile/test/csharp_coreclr_x64/Dockerfile +++ b/tools/dockerfile/test/csharp_coreclr_x64/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================ # C# dependencies diff --git a/tools/dockerfile/test/csharp_jessie_x64/Dockerfile b/tools/dockerfile/test/csharp_jessie_x64/Dockerfile index 087cc4e2bb4..14a2468abc7 100644 --- a/tools/dockerfile/test/csharp_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/csharp_jessie_x64/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================ # C# dependencies diff --git a/tools/dockerfile/test/cxx_jessie_x64/Dockerfile b/tools/dockerfile/test/cxx_jessie_x64/Dockerfile index e968a0f589b..4bb97c7aa9e 100644 --- a/tools/dockerfile/test/cxx_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_jessie_x64/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/cxx_jessie_x86/Dockerfile b/tools/dockerfile/test/cxx_jessie_x86/Dockerfile index f9854802546..c4b710b5dfb 100644 --- a/tools/dockerfile/test/cxx_jessie_x86/Dockerfile +++ b/tools/dockerfile/test/cxx_jessie_x86/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile b/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile index 2b3f4af3e6d..bd742dff341 100644 --- a/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile b/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile index 2d282276d31..bc46b3055a6 100644 --- a/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile b/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile index f22fcacc139..f7d7f542c11 100644 --- a/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/fuzzer/Dockerfile b/tools/dockerfile/test/fuzzer/Dockerfile index bd04f07cea5..b398b70b64f 100644 --- a/tools/dockerfile/test/fuzzer/Dockerfile +++ b/tools/dockerfile/test/fuzzer/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/multilang_jessie_x64/Dockerfile b/tools/dockerfile/test/multilang_jessie_x64/Dockerfile index 2540b52ec8f..5d0c1686f18 100644 --- a/tools/dockerfile/test/multilang_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/multilang_jessie_x64/Dockerfile @@ -133,7 +133,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/test/node_jessie_x64/Dockerfile b/tools/dockerfile/test/node_jessie_x64/Dockerfile index 7f93933ecac..4595aa6bea1 100644 --- a/tools/dockerfile/test/node_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/node_jessie_x64/Dockerfile @@ -87,7 +87,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================== # Node dependencies diff --git a/tools/dockerfile/test/php7_jessie_x64/Dockerfile b/tools/dockerfile/test/php7_jessie_x64/Dockerfile index 221338956ef..0e2c103afd1 100644 --- a/tools/dockerfile/test/php7_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/php7_jessie_x64/Dockerfile @@ -88,7 +88,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/test/php_jessie_x64/Dockerfile b/tools/dockerfile/test/php_jessie_x64/Dockerfile index 17ea36b76c4..c6f3dde39a5 100644 --- a/tools/dockerfile/test/php_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/php_jessie_x64/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================= # PHP dependencies diff --git a/tools/dockerfile/test/python_jessie_x64/Dockerfile b/tools/dockerfile/test/python_jessie_x64/Dockerfile index 10a88916ada..94c17078d34 100644 --- a/tools/dockerfile/test/python_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/python_jessie_x64/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/test/python_pyenv_x64/Dockerfile b/tools/dockerfile/test/python_pyenv_x64/Dockerfile index ecd785a86d3..105f06e548b 100644 --- a/tools/dockerfile/test/python_pyenv_x64/Dockerfile +++ b/tools/dockerfile/test/python_pyenv_x64/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 # Install dependencies for pyenv RUN apt-get update && apt-get install -y \ diff --git a/tools/dockerfile/test/ruby_jessie_x64/Dockerfile b/tools/dockerfile/test/ruby_jessie_x64/Dockerfile index dae64e5c8cb..679c8ff47a6 100644 --- a/tools/dockerfile/test/ruby_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/ruby_jessie_x64/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #================== # Ruby dependencies diff --git a/tools/dockerfile/test/sanity/Dockerfile b/tools/dockerfile/test/sanity/Dockerfile index 811384fda14..0da2a1914ac 100644 --- a/tools/dockerfile/test/sanity/Dockerfile +++ b/tools/dockerfile/test/sanity/Dockerfile @@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install pip --upgrade RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 #======================== # Sanity test dependencies From b094b2c31e2f4aa3ae18f92ca1611b87f37c9296 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 7 Mar 2017 15:53:03 -0800 Subject: [PATCH 48/52] Actually print error message --- test/core/util/port_server_client.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/core/util/port_server_client.c b/test/core/util/port_server_client.c index a851d016355..38054dd1e74 100644 --- a/test/core/util/port_server_client.c +++ b/test/core/util/port_server_client.c @@ -162,6 +162,15 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg, if (failed) { grpc_httpcli_request req; memset(&req, 0, sizeof(req)); + if (pr->retries >= 5) { + gpr_mu_lock(pr->mu); + pr->port = 0; + GRPC_LOG_IF_ERROR( + "pollset_kick", + grpc_pollset_kick(grpc_polling_entity_pollset(&pr->pops), NULL)); + gpr_mu_unlock(pr->mu); + return; + } GPR_ASSERT(pr->retries < 10); gpr_sleep_until(gpr_time_add( gpr_now(GPR_CLOCK_REALTIME), From 6921820fab0c9a2df8d4f258de76086cf7596b28 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 7 Mar 2017 15:54:33 -0800 Subject: [PATCH 49/52] Ensure port server is running on remote hosts --- tools/run_tests/run_performance_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/run_performance_tests.py b/tools/run_tests/run_performance_tests.py index 7c04d228ba3..ee4102c5913 100755 --- a/tools/run_tests/run_performance_tests.py +++ b/tools/run_tests/run_performance_tests.py @@ -101,7 +101,7 @@ def create_qpsworker_job(language, shortname=None, port=10000, remote_host=None, user_at_host = '%s@%s' % (_REMOTE_HOST_USERNAME, remote_host) ssh_cmd = ['ssh'] cmdline = ['timeout', '%s' % (worker_timeout + 30)] + cmdline - ssh_cmd.extend([str(user_at_host), 'cd ~/performance_workspace/grpc/ && %s' % ' '.join(cmdline)]) + ssh_cmd.extend([str(user_at_host), 'cd ~/performance_workspace/grpc/ && tools/run_tests/start_port_server.py && %s' % ' '.join(cmdline)]) cmdline = ssh_cmd jobspec = jobset.JobSpec( From 144446434507dcc6d4583a04e723904df5cd2718 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 7 Mar 2017 16:21:55 -0800 Subject: [PATCH 50/52] Fix locking --- src/core/lib/iomgr/tcp_server_posix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/lib/iomgr/tcp_server_posix.c b/src/core/lib/iomgr/tcp_server_posix.c index a17f6d48eff..5f286a6723c 100644 --- a/src/core/lib/iomgr/tcp_server_posix.c +++ b/src/core/lib/iomgr/tcp_server_posix.c @@ -424,12 +424,14 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *err) { grpc_fd_notify_on_read(exec_ctx, sp->emfd, &sp->read_closure); return; default: + gpr_mu_lock(&sp->server->mu); if (!sp->server->shutdown_listeners) { gpr_log(GPR_ERROR, "Failed accept4: %s", strerror(errno)); } else { /* if we have shutdown listeners, accept4 could fail, and we needn't notify users */ } + gpr_mu_unlock(&sp->server->mu); goto error; } } From 5a59c43e7af9d8697280eb44f87bb156258dae59 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 7 Mar 2017 19:57:13 +0100 Subject: [PATCH 51/52] make report naming internal-CI compliant --- tools/run_tests/run_tests_matrix.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 5f5df70d1da..47422451f8d 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -49,6 +49,9 @@ _RUNTESTS_TIMEOUT = 4*60*60 # Number of jobs assigned to each run_tests.py instance _DEFAULT_INNER_JOBS = 2 +# report suffix is important for reports to get picked up by internal CI +_REPORT_SUFFIX = 'sponge_log.xml' + def _docker_jobspec(name, runtests_args=[], inner_jobs=_DEFAULT_INNER_JOBS): """Run a single instance of run_tests.py in a docker container""" @@ -57,7 +60,7 @@ def _docker_jobspec(name, runtests_args=[], inner_jobs=_DEFAULT_INNER_JOBS): '--use_docker', '-t', '-j', str(inner_jobs), - '-x', 'report_%s.xml' % name, + '-x', 'report_%s_%s' % (name, _REPORT_SUFFIX), '--report_suite_name', '%s' % name] + runtests_args, shortname='run_tests_%s' % name, timeout_seconds=_RUNTESTS_TIMEOUT) @@ -74,7 +77,7 @@ def _workspace_jobspec(name, runtests_args=[], workspace_name=None, inner_jobs=_ 'tools/run_tests/helper_scripts/run_tests_in_workspace.sh', '-t', '-j', str(inner_jobs), - '-x', '../report_%s.xml' % name, + '-x', '../report_%s_%s' % (name, _REPORT_SUFFIX), '--report_suite_name', '%s' % name] + runtests_args, environ=env, shortname='run_tests_%s' % name, @@ -415,7 +418,7 @@ if __name__ == "__main__": skipped_results = jobset.run(skipped_jobs, skip_jobs=True) resultset.update(skipped_results) - report_utils.render_junit_xml_report(resultset, 'report.xml', + report_utils.render_junit_xml_report(resultset, 'report_%s' % _REPORT_SUFFIX, suite_name='aggregate_tests') if num_failures == 0: From e2bdbfe075d2accdf9269ab60cafffc8ba420a59 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 8 Mar 2017 11:55:07 -0800 Subject: [PATCH 52/52] Fix misplaced assert in run_tests.py --- tools/run_tests/run_tests.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index d4983403cc0..61de2c93a9c 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -1465,10 +1465,9 @@ def _build_and_run( sample_size = int(num_jobs * args.sample_percent/100.0) massaged_one_run = random.sample(massaged_one_run, sample_size) if not isclose(args.sample_percent, 100.0): + assert args.runs_per_test == 1, "Can't do sampling (-p) over multiple runs (-n)." print("Running %d tests out of %d (~%d%%)" % (sample_size, num_jobs, args.sample_percent)) - else: - assert args.runs_per_test == 1, "Can't do sampling (-p) over multiple runs (-n)." if infinite_runs: assert len(massaged_one_run) > 0, 'Must have at least one test for a -n inf run' runs_sequence = (itertools.repeat(massaged_one_run) if infinite_runs