From 09c55da6c2a2de682fa31acd0d2d313109cdb353 Mon Sep 17 00:00:00 2001 From: Christopher Warrington <chwarr@microsoft.com> Date: Tue, 7 May 2019 12:14:40 -0700 Subject: [PATCH 01/17] Update Google Benchmark v1.5.0 to get CMake < 3.6 fix Google Benchmark v1.4.1 uses a CMake feature that is only in version >= 3.6. This was an inadvertent change in Google Benchmark (too high of a version) that has been [fixed upstream][1] in v1.5.0. Google Benchmark v1.5.0 now requires CMake >= 3.5.1. [Another PR][2] will bump gRPC's minimum version as well. [1]: https://github.com/google/benchmark/commit/505be96ab23056580a3a2315abba048f4428b04e [2]: https://github.com/grpc/grpc/pull/19467 --- third_party/benchmark | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/benchmark b/third_party/benchmark index e776aa0275e..090faecb454 160000 --- a/third_party/benchmark +++ b/third_party/benchmark @@ -1 +1 @@ -Subproject commit e776aa0275e293707b6a0901e0e8d8a8a3679508 +Subproject commit 090faecb454fbd6e6e17a75ef8146acb037118d4 From f113001d14410814777a7475867132107c7c77d6 Mon Sep 17 00:00:00 2001 From: Pavel Koshelev <wonderspak@gmail.com> Date: Thu, 29 Aug 2019 11:49:47 +0300 Subject: [PATCH 02/17] Enable bitcode for ios native libraries --- src/csharp/experimental/build_native_ext_for_ios.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/csharp/experimental/build_native_ext_for_ios.sh b/src/csharp/experimental/build_native_ext_for_ios.sh index 130f4c51e96..876588daa06 100755 --- a/src/csharp/experimental/build_native_ext_for_ios.sh +++ b/src/csharp/experimental/build_native_ext_for_ios.sh @@ -28,7 +28,7 @@ function build { PATH_CC="$(xcrun --sdk $SDK --find clang)" PATH_CXX="$(xcrun --sdk $SDK --find clang++)" - CPPFLAGS="-O2 -Wframe-larger-than=16384 -arch $ARCH -isysroot $(xcrun --sdk $SDK --show-sdk-path) -mios-version-min=6.0 -DPB_NO_PACKED_STRUCTS=1" + CPPFLAGS="-O2 -Wframe-larger-than=16384 -arch $ARCH -isysroot $(xcrun --sdk $SDK --show-sdk-path) -fembed-bitcode -mios-version-min=6.0 -DPB_NO_PACKED_STRUCTS=1" LDFLAGS="-arch $ARCH -isysroot $(xcrun --sdk $SDK --show-sdk-path) -Wl,ios_version_min=6.0" # TODO(jtattermusch): revisit the build arguments From 7357f63c09096f4dcff953ff87a5cc59e2a726c9 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Thu, 29 Aug 2019 10:39:04 -0400 Subject: [PATCH 03/17] update check_submodules.sh and grpc_deps.bzl --- bazel/grpc_deps.bzl | 6 +++--- tools/run_tests/sanity/check_submodules.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index b226f15aa2a..7bee7547b61 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -157,9 +157,9 @@ def grpc_deps(): if "com_github_google_benchmark" not in native.existing_rules(): http_archive( name = "com_github_google_benchmark", - sha256 = "c7682e9007ddfd94072647abab3e89ffd9084089460ae47d67060974467b58bf", - strip_prefix = "benchmark-e776aa0275e293707b6a0901e0e8d8a8a3679508", - url = "https://github.com/google/benchmark/archive/e776aa0275e293707b6a0901e0e8d8a8a3679508.tar.gz", + sha256 = "f68aec93154d010324c05bcd8c5cc53468b87af88d87acb5ddcfaa1bba044837", + strip_prefix = "benchmark-090faecb454fbd6e6e17a75ef8146acb037118d4", + url = "https://github.com/google/benchmark/archive/090faecb454fbd6e6e17a75ef8146acb037118d4.tar.gz", ) if "com_github_cares_cares" not in native.existing_rules(): diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index d5eb6677796..98c1a1ecb5c 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -27,7 +27,7 @@ want_submodules=$(mktemp /tmp/submXXXXXX) git submodule | awk '{ print $1 }' | sort > "$submodules" cat << EOF | awk '{ print $1 }' | sort > "$want_submodules" 74d91756c11bc22f9b0108b94da9326f7f9e376f third_party/abseil-cpp (74d9175) - e776aa0275e293707b6a0901e0e8d8a8a3679508 third_party/benchmark (v1.2.0) + 090faecb454fbd6e6e17a75ef8146acb037118d4 third_party/benchmark (v1.5.0) 73594cde8c9a52a102c4341c244c833aa61b9c06 third_party/bloaty (remotes/origin/wide-14-g73594cd) b29b21a81b32ec273f118f589f46d56ad3332420 third_party/boringssl (remotes/origin/chromium-stable) afc30d43eef92979b05776ec0963c9cede5fb80f third_party/boringssl-with-bazel (fips-20180716-116-gafc30d43e) From 0ee7a3ae9321a7af2151070feef6bf11be2a9890 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Thu, 29 Aug 2019 10:40:22 -0400 Subject: [PATCH 04/17] regenerate projects --- Makefile | 3 +++ grpc.gyp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Makefile b/Makefile index a0692f38d20..afeda543c40 100644 --- a/Makefile +++ b/Makefile @@ -7954,8 +7954,11 @@ endif LIBBENCHMARK_SRC = \ third_party/benchmark/src/benchmark.cc \ + third_party/benchmark/src/benchmark_api_internal.cc \ third_party/benchmark/src/benchmark_main.cc \ + third_party/benchmark/src/benchmark_name.cc \ third_party/benchmark/src/benchmark_register.cc \ + third_party/benchmark/src/benchmark_runner.cc \ third_party/benchmark/src/colorprint.cc \ third_party/benchmark/src/commandlineflags.cc \ third_party/benchmark/src/complexity.cc \ diff --git a/grpc.gyp b/grpc.gyp index ba847d99548..aef5f61fb2a 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -2241,8 +2241,11 @@ ], 'sources': [ 'third_party/benchmark/src/benchmark.cc', + 'third_party/benchmark/src/benchmark_api_internal.cc', 'third_party/benchmark/src/benchmark_main.cc', + 'third_party/benchmark/src/benchmark_name.cc', 'third_party/benchmark/src/benchmark_register.cc', + 'third_party/benchmark/src/benchmark_runner.cc', 'third_party/benchmark/src/colorprint.cc', 'third_party/benchmark/src/commandlineflags.cc', 'third_party/benchmark/src/complexity.cc', From 65eb9c9ddb188bddaf5b2a1fa2f04812903b7337 Mon Sep 17 00:00:00 2001 From: Vijay Pai <vpai@google.com> Date: Fri, 30 Aug 2019 08:14:44 -0700 Subject: [PATCH 05/17] Revert "Test message size of 100MB" --- test/core/util/test_config.cc | 4 --- test/core/util/test_config.h | 3 -- test/cpp/end2end/async_end2end_test.cc | 38 ++++---------------------- 3 files changed, 6 insertions(+), 39 deletions(-) diff --git a/test/core/util/test_config.cc b/test/core/util/test_config.cc index 5033dc7b66a..5b248a01daa 100644 --- a/test/core/util/test_config.cc +++ b/test/core/util/test_config.cc @@ -342,10 +342,6 @@ bool BuiltUnderUbsan() { #endif } -bool grpc_test_built_under_tsan_or_msan() { - return BuiltUnderTsan() || BuiltUnderMsan(); -}; - int64_t grpc_test_sanitizer_slowdown_factor() { int64_t sanitizer_multiplier = 1; if (BuiltUnderValgrind()) { diff --git a/test/core/util/test_config.h b/test/core/util/test_config.h index 905d61f1dd6..112af3176f9 100644 --- a/test/core/util/test_config.h +++ b/test/core/util/test_config.h @@ -24,9 +24,6 @@ extern int64_t g_fixture_slowdown_factor; extern int64_t g_poller_slowdown_factor; -/* Returns if the test is built under TSAN or MSAN. */ -bool grpc_test_built_under_tsan_or_msan(); - /* Returns an appropriate scaling factor for timeouts. */ int64_t grpc_test_slowdown_factor(); diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 879f16815ee..6ca0edf123e 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -34,7 +34,6 @@ #include "src/core/ext/filters/client_channel/backup_poller.h" #include "src/core/lib/gpr/tls.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/port.h" #include "src/proto/grpc/health/v1/health.grpc.pb.h" #include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h" @@ -60,18 +59,6 @@ namespace testing { namespace { -const size_t MAX_TEST_MESSAGE_SIZE = -#if defined(GPR_APPLE) - // The test will time out with macos build. - GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH; -#else - // Don't test extreme size under tsan or msan, because it uses too much - // memory. - grpc_test_built_under_tsan_or_msan() - ? GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH - : GPR_MAX(100 * 1024 * 1024, GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH); -#endif - void* tag(int i) { return (void*)static_cast<intptr_t>(i); } int detag(void* p) { return static_cast<int>(reinterpret_cast<intptr_t>(p)); } @@ -231,17 +218,6 @@ class ServerBuilderSyncPluginDisabler : public ::grpc::ServerBuilderOption { } }; -class ServerBuilderMaxRecvMessageSizeOption - : public ::grpc::ServerBuilderOption { - public: - void UpdateArguments(ChannelArguments* arg) override { - arg->SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, -1); - } - - void UpdatePlugins( - std::vector<std::unique_ptr<ServerBuilderPlugin>>* plugins) override {} -}; - class TestScenario { public: TestScenario(bool inproc_stub, const grpc::string& creds_type, bool hcs, @@ -314,9 +290,6 @@ class AsyncEnd2endTest : public ::testing::TestWithParam<TestScenario> { std::unique_ptr<ServerBuilderOption> sync_plugin_disabler( new ServerBuilderSyncPluginDisabler()); builder.SetOption(move(sync_plugin_disabler)); - std::unique_ptr<ServerBuilderOption> max_recv_option( - new ServerBuilderMaxRecvMessageSizeOption()); - builder.SetOption(move(max_recv_option)); server_ = builder.BuildAndStart(); } @@ -324,7 +297,6 @@ class AsyncEnd2endTest : public ::testing::TestWithParam<TestScenario> { ChannelArguments args; auto channel_creds = GetCredentialsProvider()->GetChannelCredentials( GetParam().credentials_type, &args); - args.SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, -1); std::shared_ptr<Channel> channel = !(GetParam().inproc) ? ::grpc::CreateCustomChannel( server_address_.str(), channel_creds, args) @@ -1850,7 +1822,7 @@ TEST_P(AsyncEnd2endServerTryCancelTest, ServerBidiStreamingTryCancelAfter) { } std::vector<TestScenario> CreateTestScenarios(bool test_secure, - bool test_big_message) { + bool test_message_size_limit) { std::vector<TestScenario> scenarios; std::vector<grpc::string> credentials_types; std::vector<grpc::string> messages; @@ -1872,8 +1844,9 @@ std::vector<TestScenario> CreateTestScenarios(bool test_secure, GPR_ASSERT(!credentials_types.empty()); messages.push_back("Hello"); - if (test_big_message) { - for (size_t k = 1; k < MAX_TEST_MESSAGE_SIZE / 1024; k *= 32) { + if (test_message_size_limit) { + for (size_t k = 1; k < GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH / 1024; + k *= 32) { grpc::string big_msg; for (size_t i = 0; i < k * 1024; ++i) { char c = 'a' + (i % 26); @@ -1881,7 +1854,8 @@ std::vector<TestScenario> CreateTestScenarios(bool test_secure, } messages.push_back(big_msg); } - messages.push_back(grpc::string(MAX_TEST_MESSAGE_SIZE - 10, 'a')); + messages.push_back( + grpc::string(GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH - 10, 'a')); } // TODO (sreek) Renable tests with health check service after the issue From 7b2c253530c9675148e552d2761a0a8f28daed60 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Mon, 2 Sep 2019 10:57:36 -0400 Subject: [PATCH 06/17] Revert "only generate full or lite client, never both" This reverts commit 1b8418b5460a63c331288cd475db7198cb2c494a. --- src/compiler/csharp_generator.cc | 56 +++++++++++++++++--------------- src/compiler/csharp_generator.h | 4 +-- src/compiler/csharp_plugin.cc | 12 +++---- 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index d7ba4f2636a..7f178f63bb0 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -176,8 +176,9 @@ std::string GetServiceClassName(const ServiceDescriptor* service) { return service->name(); } -std::string GetClientClassName(const ServiceDescriptor* service) { - return service->name() + "Client"; +std::string GetClientClassName(const ServiceDescriptor* service, + bool lite_client) { + return service->name() + (lite_client ? "LiteClient" : "Client"); } std::string GetServerClassName(const ServiceDescriptor* service) { @@ -420,28 +421,26 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service, out->Print("/// <summary>Client for $servicename$</summary>\n", "servicename", GetServiceClassName(service)); out->Print("public partial class $name$ : grpc::ClientBase<$name$>\n", - "name", GetClientClassName(service)); + "name", GetClientClassName(service, lite_client)); } else { out->Print("/// <summary>Lite client for $servicename$</summary>\n", "servicename", GetServiceClassName(service)); out->Print("public partial class $name$ : grpc::LiteClientBase\n", "name", - GetClientClassName(service)); + GetClientClassName(service, lite_client)); } out->Print("{\n"); out->Indent(); // constructors - if (!lite_client) { - out->Print( - "/// <summary>Creates a new client for $servicename$</summary>\n" - "/// <param name=\"channel\">The channel to use to make remote " - "calls.</param>\n", - "servicename", GetServiceClassName(service)); - out->Print("public $name$(grpc::ChannelBase channel) : base(channel)\n", - "name", GetClientClassName(service)); - out->Print("{\n"); - out->Print("}\n"); - } + out->Print( + "/// <summary>Creates a new client for $servicename$</summary>\n" + "/// <param name=\"channel\">The channel to use to make remote " + "calls.</param>\n", + "servicename", GetServiceClassName(service)); + out->Print("public $name$(grpc::ChannelBase channel) : base(channel)\n", + "name", GetClientClassName(service)); + out->Print("{\n"); + out->Print("}\n"); out->Print( "/// <summary>Creates a new client for $servicename$ that uses a custom " "<c>CallInvoker</c>.</summary>\n" @@ -450,14 +449,14 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service, "servicename", GetServiceClassName(service)); out->Print( "public $name$(grpc::CallInvoker callInvoker) : base(callInvoker)\n", - "name", GetClientClassName(service)); + "name", GetClientClassName(service, lite_client)); out->Print("{\n"); out->Print("}\n"); out->Print( "/// <summary>Protected parameterless constructor to allow creation" " of test doubles.</summary>\n"); out->Print("protected $name$() : base()\n", "name", - GetClientClassName(service)); + GetClientClassName(service, lite_client)); out->Print("{\n"); out->Print("}\n"); if (!lite_client) { @@ -469,7 +468,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service, out->Print( "protected $name$(ClientBaseConfiguration configuration)" " : base(configuration)\n", - "name", GetClientClassName(service)); + "name", GetClientClassName(service, lite_client)); out->Print("{\n"); out->Print("}\n"); } @@ -598,11 +597,11 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service, out->Print( "protected override $name$ NewInstance(ClientBaseConfiguration " "configuration)\n", - "name", GetClientClassName(service)); + "name", GetClientClassName(service, lite_client)); out->Print("{\n"); out->Indent(); out->Print("return new $name$(configuration);\n", "name", - GetClientClassName(service)); + GetClientClassName(service, lite_client)); out->Outdent(); out->Print("}\n"); } @@ -686,8 +685,8 @@ void GenerateBindServiceWithBinderMethod(Printer* out, } void GenerateService(Printer* out, const ServiceDescriptor* service, - bool generate_client, bool generate_server, - bool internal_access, bool lite_client) { + bool generate_client, bool generate_lite_client, + bool generate_server, bool internal_access) { GenerateDocCommentBody(out, service); out->Print("$access_level$ static partial class $classname$\n", "access_level", GetAccessLevel(internal_access), "classname", @@ -709,7 +708,10 @@ void GenerateService(Printer* out, const ServiceDescriptor* service, GenerateServerClass(out, service); } if (generate_client) { - GenerateClientStub(out, service, lite_client); + GenerateClientStub(out, service, false); + } + if (generate_lite_client) { + GenerateClientStub(out, service, true); } if (generate_server) { @@ -724,8 +726,8 @@ void GenerateService(Printer* out, const ServiceDescriptor* service, } // anonymous namespace grpc::string GetServices(const FileDescriptor* file, bool generate_client, - bool generate_server, bool internal_access, - bool lite_client) { + bool generate_lite_client, bool generate_server, + bool internal_access) { grpc::string output; { // Scope the output stream so it closes and finalizes output to the string. @@ -766,8 +768,8 @@ grpc::string GetServices(const FileDescriptor* file, bool generate_client, out.Indent(); } for (int i = 0; i < file->service_count(); i++) { - GenerateService(&out, file->service(i), generate_client, generate_server, - internal_access, lite_client); + GenerateService(&out, file->service(i), generate_client, + generate_lite_client, generate_server, internal_access); } if (file_namespace != "") { out.Outdent(); diff --git a/src/compiler/csharp_generator.h b/src/compiler/csharp_generator.h index d4c13c67363..842d136494c 100644 --- a/src/compiler/csharp_generator.h +++ b/src/compiler/csharp_generator.h @@ -26,8 +26,8 @@ namespace grpc_csharp_generator { grpc::string GetServices(const grpc::protobuf::FileDescriptor* file, - bool generate_client, bool generate_server, - bool internal_access, bool lite_client); + bool generate_client, bool generate_lite_client, + bool generate_server, bool internal_access); } // namespace grpc_csharp_generator diff --git a/src/compiler/csharp_plugin.cc b/src/compiler/csharp_plugin.cc index c503fd61ded..a495f876792 100644 --- a/src/compiler/csharp_plugin.cc +++ b/src/compiler/csharp_plugin.cc @@ -38,19 +38,18 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { bool generate_client = true; bool generate_server = true; + bool generate_lite_client = true; bool internal_access = false; - bool lite_client = false; for (size_t i = 0; i < options.size(); i++) { if (options[i].first == "no_client") { generate_client = false; + } else if (options[i].first == "no_lite_client") { + // TODO: better option + generate_lite_client = false; } else if (options[i].first == "no_server") { generate_server = false; } else if (options[i].first == "internal_access") { internal_access = true; - } else if (options[i].first == "lite_client") { - // will only be used if generate_client is true. - // NOTE: experimental option, can be removed in future release - lite_client = true; } else { *error = "Unknown generator option: " + options[i].first; return false; @@ -58,7 +57,8 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { } grpc::string code = grpc_csharp_generator::GetServices( - file, generate_client, generate_server, internal_access, lite_client); + file, generate_client, generate_lite_client, generate_server, + internal_access); if (code.size() == 0) { return true; // don't generate a file if there are no services } From f73c03f47c29b0ef2bfe0f1fb0975ce210bce59a Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Mon, 2 Sep 2019 10:58:00 -0400 Subject: [PATCH 07/17] Revert "C# lite client codegen" This reverts commit 25e3d26e8cb361692101555cdb199933079cd90f. --- src/compiler/csharp_generator.cc | 96 +++++++++++++------------------- src/compiler/csharp_generator.h | 4 +- src/compiler/csharp_plugin.cc | 7 +-- 3 files changed, 41 insertions(+), 66 deletions(-) diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index 7f178f63bb0..f630da7c58e 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -176,9 +176,8 @@ std::string GetServiceClassName(const ServiceDescriptor* service) { return service->name(); } -std::string GetClientClassName(const ServiceDescriptor* service, - bool lite_client) { - return service->name() + (lite_client ? "LiteClient" : "Client"); +std::string GetClientClassName(const ServiceDescriptor* service) { + return service->name() + "Client"; } std::string GetServerClassName(const ServiceDescriptor* service) { @@ -415,19 +414,11 @@ void GenerateServerClass(Printer* out, const ServiceDescriptor* service) { out->Print("\n"); } -void GenerateClientStub(Printer* out, const ServiceDescriptor* service, - bool lite_client) { - if (!lite_client) { - out->Print("/// <summary>Client for $servicename$</summary>\n", - "servicename", GetServiceClassName(service)); - out->Print("public partial class $name$ : grpc::ClientBase<$name$>\n", - "name", GetClientClassName(service, lite_client)); - } else { - out->Print("/// <summary>Lite client for $servicename$</summary>\n", - "servicename", GetServiceClassName(service)); - out->Print("public partial class $name$ : grpc::LiteClientBase\n", "name", - GetClientClassName(service, lite_client)); - } +void GenerateClientStub(Printer* out, const ServiceDescriptor* service) { + out->Print("/// <summary>Client for $servicename$</summary>\n", "servicename", + GetServiceClassName(service)); + out->Print("public partial class $name$ : grpc::ClientBase<$name$>\n", "name", + GetClientClassName(service)); out->Print("{\n"); out->Indent(); @@ -449,30 +440,26 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service, "servicename", GetServiceClassName(service)); out->Print( "public $name$(grpc::CallInvoker callInvoker) : base(callInvoker)\n", - "name", GetClientClassName(service, lite_client)); + "name", GetClientClassName(service)); out->Print("{\n"); out->Print("}\n"); out->Print( "/// <summary>Protected parameterless constructor to allow creation" " of test doubles.</summary>\n"); out->Print("protected $name$() : base()\n", "name", - GetClientClassName(service, lite_client)); + GetClientClassName(service)); out->Print("{\n"); out->Print("}\n"); - if (!lite_client) { - out->Print( - "/// <summary>Protected constructor to allow creation of configured " - "clients.</summary>\n" - "/// <param name=\"configuration\">The client " - "configuration.</param>\n"); - out->Print( - "protected $name$(ClientBaseConfiguration configuration)" - " : base(configuration)\n", - "name", GetClientClassName(service, lite_client)); - out->Print("{\n"); - out->Print("}\n"); - } - out->Print("\n"); + out->Print( + "/// <summary>Protected constructor to allow creation of configured " + "clients.</summary>\n" + "/// <param name=\"configuration\">The client configuration.</param>\n"); + out->Print( + "protected $name$(ClientBaseConfiguration configuration)" + " : base(configuration)\n", + "name", GetClientClassName(service)); + out->Print("{\n"); + out->Print("}\n\n"); for (int i = 0; i < service->method_count(); i++) { const MethodDescriptor* method = service->method(i); @@ -590,21 +577,19 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service, } // override NewInstance method - if (!lite_client) { - out->Print( - "/// <summary>Creates a new instance of client from given " - "<c>ClientBaseConfiguration</c>.</summary>\n"); - out->Print( - "protected override $name$ NewInstance(ClientBaseConfiguration " - "configuration)\n", - "name", GetClientClassName(service, lite_client)); - out->Print("{\n"); - out->Indent(); - out->Print("return new $name$(configuration);\n", "name", - GetClientClassName(service, lite_client)); - out->Outdent(); - out->Print("}\n"); - } + out->Print( + "/// <summary>Creates a new instance of client from given " + "<c>ClientBaseConfiguration</c>.</summary>\n"); + out->Print( + "protected override $name$ NewInstance(ClientBaseConfiguration " + "configuration)\n", + "name", GetClientClassName(service)); + out->Print("{\n"); + out->Indent(); + out->Print("return new $name$(configuration);\n", "name", + GetClientClassName(service)); + out->Outdent(); + out->Print("}\n"); out->Outdent(); out->Print("}\n"); @@ -685,8 +670,8 @@ void GenerateBindServiceWithBinderMethod(Printer* out, } void GenerateService(Printer* out, const ServiceDescriptor* service, - bool generate_client, bool generate_lite_client, - bool generate_server, bool internal_access) { + bool generate_client, bool generate_server, + bool internal_access) { GenerateDocCommentBody(out, service); out->Print("$access_level$ static partial class $classname$\n", "access_level", GetAccessLevel(internal_access), "classname", @@ -708,12 +693,8 @@ void GenerateService(Printer* out, const ServiceDescriptor* service, GenerateServerClass(out, service); } if (generate_client) { - GenerateClientStub(out, service, false); - } - if (generate_lite_client) { - GenerateClientStub(out, service, true); + GenerateClientStub(out, service); } - if (generate_server) { GenerateBindServiceMethod(out, service); GenerateBindServiceWithBinderMethod(out, service); @@ -726,8 +707,7 @@ void GenerateService(Printer* out, const ServiceDescriptor* service, } // anonymous namespace grpc::string GetServices(const FileDescriptor* file, bool generate_client, - bool generate_lite_client, bool generate_server, - bool internal_access) { + bool generate_server, bool internal_access) { grpc::string output; { // Scope the output stream so it closes and finalizes output to the string. @@ -768,8 +748,8 @@ grpc::string GetServices(const FileDescriptor* file, bool generate_client, out.Indent(); } for (int i = 0; i < file->service_count(); i++) { - GenerateService(&out, file->service(i), generate_client, - generate_lite_client, generate_server, internal_access); + GenerateService(&out, file->service(i), generate_client, generate_server, + internal_access); } if (file_namespace != "") { out.Outdent(); diff --git a/src/compiler/csharp_generator.h b/src/compiler/csharp_generator.h index 842d136494c..fd36e11851b 100644 --- a/src/compiler/csharp_generator.h +++ b/src/compiler/csharp_generator.h @@ -26,8 +26,8 @@ namespace grpc_csharp_generator { grpc::string GetServices(const grpc::protobuf::FileDescriptor* file, - bool generate_client, bool generate_lite_client, - bool generate_server, bool internal_access); + bool generate_client, bool generate_server, + bool internal_access); } // namespace grpc_csharp_generator diff --git a/src/compiler/csharp_plugin.cc b/src/compiler/csharp_plugin.cc index a495f876792..5f13aa6749e 100644 --- a/src/compiler/csharp_plugin.cc +++ b/src/compiler/csharp_plugin.cc @@ -38,14 +38,10 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { bool generate_client = true; bool generate_server = true; - bool generate_lite_client = true; bool internal_access = false; for (size_t i = 0; i < options.size(); i++) { if (options[i].first == "no_client") { generate_client = false; - } else if (options[i].first == "no_lite_client") { - // TODO: better option - generate_lite_client = false; } else if (options[i].first == "no_server") { generate_server = false; } else if (options[i].first == "internal_access") { @@ -57,8 +53,7 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { } grpc::string code = grpc_csharp_generator::GetServices( - file, generate_client, generate_lite_client, generate_server, - internal_access); + file, generate_client, generate_server, internal_access); if (code.size() == 0) { return true; // don't generate a file if there are no services } From 28f031f915e0a7b326f4845b868bd2b35f7f3ed3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Mon, 2 Sep 2019 11:12:11 -0400 Subject: [PATCH 08/17] Revert "also generate code with "lite_client" option set" This reverts commit 4a4cf280a1d5f8690ee063a22a6b4b1d1d49f27f. --- .../math_with_protoc_options.proto | 65 ------------------- src/csharp/generate_proto_csharp.sh | 2 - 2 files changed, 67 deletions(-) delete mode 100644 src/csharp/Grpc.Examples/math_with_protoc_options.proto diff --git a/src/csharp/Grpc.Examples/math_with_protoc_options.proto b/src/csharp/Grpc.Examples/math_with_protoc_options.proto deleted file mode 100644 index ca13c6d4466..00000000000 --- a/src/csharp/Grpc.Examples/math_with_protoc_options.proto +++ /dev/null @@ -1,65 +0,0 @@ - -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package math_with_protoc_options; - -message DivArgs { - int64 dividend = 1; - int64 divisor = 2; -} - -message DivReply { - int64 quotient = 1; - int64 remainder = 2; -} - -message FibArgs { - int64 limit = 1; -} - -message Num { - int64 num = 1; -} - -message FibReply { - int64 count = 1; -} - -service Math { - // Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient - // and remainder. - rpc Div (DivArgs) returns (DivReply) { - } - - // DivMany accepts an arbitrary number of division args from the client stream - // and sends back the results in the reply stream. The stream continues until - // the client closes its end; the server does the same after sending all the - // replies. The stream ends immediately if either end aborts. - rpc DivMany (stream DivArgs) returns (stream DivReply) { - } - - // Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib - // generates up to limit numbers; otherwise it continues until the call is - // canceled. Unlike Fib above, Fib has no final FibReply. - rpc Fib (FibArgs) returns (stream Num) { - } - - // Sum sums a stream of numbers, returning the final result once the stream - // is closed. - rpc Sum (stream Num) returns (Num) { - } -} diff --git a/src/csharp/generate_proto_csharp.sh b/src/csharp/generate_proto_csharp.sh index 81463ace6ad..e79728ff959 100755 --- a/src/csharp/generate_proto_csharp.sh +++ b/src/csharp/generate_proto_csharp.sh @@ -26,8 +26,6 @@ TESTING_DIR=src/csharp/Grpc.IntegrationTesting $PROTOC --plugin=$PLUGIN --csharp_out=$EXAMPLES_DIR --grpc_out=$EXAMPLES_DIR \ -I src/proto src/proto/math/math.proto -$PROTOC --plugin=$PLUGIN --csharp_out=$EXAMPLES_DIR --grpc_out=$EXAMPLES_DIR --grpc_opt=lite_client,no_server \ - -I src/csharp/Grpc.Examples src/csharp/Grpc.Examples/math_with_protoc_options.proto $PROTOC --plugin=$PLUGIN --csharp_out=$HEALTHCHECK_DIR --grpc_out=$HEALTHCHECK_DIR \ -I src/proto src/proto/grpc/health/v1/health.proto From e84d0a2875b4e10b217fcf140a2cec8475b0a0e6 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Mon, 2 Sep 2019 11:15:32 -0400 Subject: [PATCH 09/17] remove LiteClientBase --- src/csharp/Grpc.Core.Api/LiteClientBase.cs | 63 ---------------------- 1 file changed, 63 deletions(-) delete mode 100644 src/csharp/Grpc.Core.Api/LiteClientBase.cs diff --git a/src/csharp/Grpc.Core.Api/LiteClientBase.cs b/src/csharp/Grpc.Core.Api/LiteClientBase.cs deleted file mode 100644 index 132f10a912f..00000000000 --- a/src/csharp/Grpc.Core.Api/LiteClientBase.cs +++ /dev/null @@ -1,63 +0,0 @@ -#region Copyright notice and license - -// Copyright 2019 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#endregion - -using System; -using Grpc.Core.Internal; -using Grpc.Core.Utils; - -namespace Grpc.Core -{ - /// <summary> - /// Base class for lightweight client-side stubs. - /// All calls are invoked via a <c>CallInvoker</c>. - /// Lite client stubs have no configuration knobs, all configuration - /// is provided by decorating the call invoker. - /// Note: experimental API that can change or be removed without any prior notice. - /// </summary> - public abstract class LiteClientBase - { - readonly CallInvoker callInvoker; - - /// <summary> - /// Initializes a new instance of <c>LiteClientBase</c> class that - /// throws <c>NotImplementedException</c> upon invocation of any RPC. - /// This constructor is only provided to allow creation of test doubles - /// for client classes (e.g. mocking requires a parameterless constructor). - /// </summary> - protected LiteClientBase() : this(new UnimplementedCallInvoker()) - { - } - - /// <summary> - /// Initializes a new instance of <c>ClientBase</c> class. - /// </summary> - /// <param name="callInvoker">The <c>CallInvoker</c> for remote call invocation.</param> - public LiteClientBase(CallInvoker callInvoker) - { - this.callInvoker = GrpcPreconditions.CheckNotNull(callInvoker, nameof(callInvoker)); - } - - /// <summary> - /// Gets the call invoker. - /// </summary> - protected CallInvoker CallInvoker - { - get { return this.callInvoker; } - } - } -} From 3a6042b824170fbca329aa07a8137b9359a7432a Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Mon, 2 Sep 2019 11:22:08 -0400 Subject: [PATCH 10/17] regenerate C# protos --- .../Grpc.IntegrationTesting/Messages.cs | 137 +++++++++++++++--- 1 file changed, 113 insertions(+), 24 deletions(-) diff --git a/src/csharp/Grpc.IntegrationTesting/Messages.cs b/src/csharp/Grpc.IntegrationTesting/Messages.cs index 5c5042b75b6..dab90d8ae46 100644 --- a/src/csharp/Grpc.IntegrationTesting/Messages.cs +++ b/src/csharp/Grpc.IntegrationTesting/Messages.cs @@ -28,7 +28,7 @@ namespace Grpc.Testing { "LnRlc3RpbmciGgoJQm9vbFZhbHVlEg0KBXZhbHVlGAEgASgIIkAKB1BheWxv", "YWQSJwoEdHlwZRgBIAEoDjIZLmdycGMudGVzdGluZy5QYXlsb2FkVHlwZRIM", "CgRib2R5GAIgASgMIisKCkVjaG9TdGF0dXMSDAoEY29kZRgBIAEoBRIPCgdt", - "ZXNzYWdlGAIgASgJIuYCCg1TaW1wbGVSZXF1ZXN0EjAKDXJlc3BvbnNlX3R5", + "ZXNzYWdlGAIgASgJIoYDCg1TaW1wbGVSZXF1ZXN0EjAKDXJlc3BvbnNlX3R5", "cGUYASABKA4yGS5ncnBjLnRlc3RpbmcuUGF5bG9hZFR5cGUSFQoNcmVzcG9u", "c2Vfc2l6ZRgCIAEoBRImCgdwYXlsb2FkGAMgASgLMhUuZ3JwYy50ZXN0aW5n", "LlBheWxvYWQSFQoNZmlsbF91c2VybmFtZRgEIAEoCBIYChBmaWxsX29hdXRo", @@ -36,34 +36,38 @@ namespace Grpc.Testing { "cnBjLnRlc3RpbmcuQm9vbFZhbHVlEjEKD3Jlc3BvbnNlX3N0YXR1cxgHIAEo", "CzIYLmdycGMudGVzdGluZy5FY2hvU3RhdHVzEjIKEWV4cGVjdF9jb21wcmVz", "c2VkGAggASgLMhcuZ3JwYy50ZXN0aW5nLkJvb2xWYWx1ZRIWCg5maWxsX3Nl", - "cnZlcl9pZBgJIAEoCCJyCg5TaW1wbGVSZXNwb25zZRImCgdwYXlsb2FkGAEg", - "ASgLMhUuZ3JwYy50ZXN0aW5nLlBheWxvYWQSEAoIdXNlcm5hbWUYAiABKAkS", - "EwoLb2F1dGhfc2NvcGUYAyABKAkSEQoJc2VydmVyX2lkGAQgASgJIncKGVN0", - "cmVhbWluZ0lucHV0Q2FsbFJlcXVlc3QSJgoHcGF5bG9hZBgBIAEoCzIVLmdy", - "cGMudGVzdGluZy5QYXlsb2FkEjIKEWV4cGVjdF9jb21wcmVzc2VkGAIgASgL", - "MhcuZ3JwYy50ZXN0aW5nLkJvb2xWYWx1ZSI9ChpTdHJlYW1pbmdJbnB1dENh", - "bGxSZXNwb25zZRIfChdhZ2dyZWdhdGVkX3BheWxvYWRfc2l6ZRgBIAEoBSJk", - "ChJSZXNwb25zZVBhcmFtZXRlcnMSDAoEc2l6ZRgBIAEoBRITCgtpbnRlcnZh", - "bF91cxgCIAEoBRIrCgpjb21wcmVzc2VkGAMgASgLMhcuZ3JwYy50ZXN0aW5n", - "LkJvb2xWYWx1ZSLoAQoaU3RyZWFtaW5nT3V0cHV0Q2FsbFJlcXVlc3QSMAoN", - "cmVzcG9uc2VfdHlwZRgBIAEoDjIZLmdycGMudGVzdGluZy5QYXlsb2FkVHlw", - "ZRI9ChNyZXNwb25zZV9wYXJhbWV0ZXJzGAIgAygLMiAuZ3JwYy50ZXN0aW5n", - "LlJlc3BvbnNlUGFyYW1ldGVycxImCgdwYXlsb2FkGAMgASgLMhUuZ3JwYy50", - "ZXN0aW5nLlBheWxvYWQSMQoPcmVzcG9uc2Vfc3RhdHVzGAcgASgLMhguZ3Jw", - "Yy50ZXN0aW5nLkVjaG9TdGF0dXMiRQobU3RyZWFtaW5nT3V0cHV0Q2FsbFJl", - "c3BvbnNlEiYKB3BheWxvYWQYASABKAsyFS5ncnBjLnRlc3RpbmcuUGF5bG9h", - "ZCIzCg9SZWNvbm5lY3RQYXJhbXMSIAoYbWF4X3JlY29ubmVjdF9iYWNrb2Zm", - "X21zGAEgASgFIjMKDVJlY29ubmVjdEluZm8SDgoGcGFzc2VkGAEgASgIEhIK", - "CmJhY2tvZmZfbXMYAiADKAUqHwoLUGF5bG9hZFR5cGUSEAoMQ09NUFJFU1NB", - "QkxFEABiBnByb3RvMw==")); + "cnZlcl9pZBgJIAEoCBIeChZmaWxsX2dycGNsYl9yb3V0ZV90eXBlGAogASgI", + "IqwBCg5TaW1wbGVSZXNwb25zZRImCgdwYXlsb2FkGAEgASgLMhUuZ3JwYy50", + "ZXN0aW5nLlBheWxvYWQSEAoIdXNlcm5hbWUYAiABKAkSEwoLb2F1dGhfc2Nv", + "cGUYAyABKAkSEQoJc2VydmVyX2lkGAQgASgJEjgKEWdycGNsYl9yb3V0ZV90", + "eXBlGAUgASgOMh0uZ3JwYy50ZXN0aW5nLkdycGNsYlJvdXRlVHlwZSJ3ChlT", + "dHJlYW1pbmdJbnB1dENhbGxSZXF1ZXN0EiYKB3BheWxvYWQYASABKAsyFS5n", + "cnBjLnRlc3RpbmcuUGF5bG9hZBIyChFleHBlY3RfY29tcHJlc3NlZBgCIAEo", + "CzIXLmdycGMudGVzdGluZy5Cb29sVmFsdWUiPQoaU3RyZWFtaW5nSW5wdXRD", + "YWxsUmVzcG9uc2USHwoXYWdncmVnYXRlZF9wYXlsb2FkX3NpemUYASABKAUi", + "ZAoSUmVzcG9uc2VQYXJhbWV0ZXJzEgwKBHNpemUYASABKAUSEwoLaW50ZXJ2", + "YWxfdXMYAiABKAUSKwoKY29tcHJlc3NlZBgDIAEoCzIXLmdycGMudGVzdGlu", + "Zy5Cb29sVmFsdWUi6AEKGlN0cmVhbWluZ091dHB1dENhbGxSZXF1ZXN0EjAK", + "DXJlc3BvbnNlX3R5cGUYASABKA4yGS5ncnBjLnRlc3RpbmcuUGF5bG9hZFR5", + "cGUSPQoTcmVzcG9uc2VfcGFyYW1ldGVycxgCIAMoCzIgLmdycGMudGVzdGlu", + "Zy5SZXNwb25zZVBhcmFtZXRlcnMSJgoHcGF5bG9hZBgDIAEoCzIVLmdycGMu", + "dGVzdGluZy5QYXlsb2FkEjEKD3Jlc3BvbnNlX3N0YXR1cxgHIAEoCzIYLmdy", + "cGMudGVzdGluZy5FY2hvU3RhdHVzIkUKG1N0cmVhbWluZ091dHB1dENhbGxS", + "ZXNwb25zZRImCgdwYXlsb2FkGAEgASgLMhUuZ3JwYy50ZXN0aW5nLlBheWxv", + "YWQiMwoPUmVjb25uZWN0UGFyYW1zEiAKGG1heF9yZWNvbm5lY3RfYmFja29m", + "Zl9tcxgBIAEoBSIzCg1SZWNvbm5lY3RJbmZvEg4KBnBhc3NlZBgBIAEoCBIS", + "CgpiYWNrb2ZmX21zGAIgAygFKh8KC1BheWxvYWRUeXBlEhAKDENPTVBSRVNT", + "QUJMRRAAKm8KD0dycGNsYlJvdXRlVHlwZRIdChlHUlBDTEJfUk9VVEVfVFlQ", + "RV9VTktOT1dOEAASHgoaR1JQQ0xCX1JPVVRFX1RZUEVfRkFMTEJBQ0sQARId", + "ChlHUlBDTEJfUk9VVEVfVFlQRV9CQUNLRU5EEAJiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.PayloadType), }, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.PayloadType), typeof(global::Grpc.Testing.GrpclbRouteType), }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.BoolValue), global::Grpc.Testing.BoolValue.Parser, new[]{ "Value" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Payload), global::Grpc.Testing.Payload.Parser, new[]{ "Type", "Body" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.EchoStatus), global::Grpc.Testing.EchoStatus.Parser, new[]{ "Code", "Message" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleRequest), global::Grpc.Testing.SimpleRequest.Parser, new[]{ "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope", "ResponseCompressed", "ResponseStatus", "ExpectCompressed", "FillServerId" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleResponse), global::Grpc.Testing.SimpleResponse.Parser, new[]{ "Payload", "Username", "OauthScope", "ServerId" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleRequest), global::Grpc.Testing.SimpleRequest.Parser, new[]{ "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope", "ResponseCompressed", "ResponseStatus", "ExpectCompressed", "FillServerId", "FillGrpclbRouteType" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleResponse), global::Grpc.Testing.SimpleResponse.Parser, new[]{ "Payload", "Username", "OauthScope", "ServerId", "GrpclbRouteType" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.StreamingInputCallRequest), global::Grpc.Testing.StreamingInputCallRequest.Parser, new[]{ "Payload", "ExpectCompressed" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.StreamingInputCallResponse), global::Grpc.Testing.StreamingInputCallResponse.Parser, new[]{ "AggregatedPayloadSize" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ResponseParameters), global::Grpc.Testing.ResponseParameters.Parser, new[]{ "Size", "IntervalUs", "Compressed" }, null, null, null), @@ -87,6 +91,29 @@ namespace Grpc.Testing { [pbr::OriginalName("COMPRESSABLE")] Compressable = 0, } + /// <summary> + /// The type of route that a client took to reach a server w.r.t. gRPCLB. + /// The server must fill in "fallback" if it detects that the RPC reached + /// the server via the "gRPCLB fallback" path, and "backend" if it detects + /// that the RPC reached the server via "gRPCLB backend" path (i.e. if it got + /// the address of this server from the gRPCLB server BalanceLoad RPC). Exactly + /// how this detection is done is context and server dependant. + /// </summary> + public enum GrpclbRouteType { + /// <summary> + /// Server didn't detect the route that a client took to reach it. + /// </summary> + [pbr::OriginalName("GRPCLB_ROUTE_TYPE_UNKNOWN")] Unknown = 0, + /// <summary> + /// Indicates that a client reached a server via gRPCLB fallback. + /// </summary> + [pbr::OriginalName("GRPCLB_ROUTE_TYPE_FALLBACK")] Fallback = 1, + /// <summary> + /// Indicates that a client reached a server as a gRPCLB-given backend. + /// </summary> + [pbr::OriginalName("GRPCLB_ROUTE_TYPE_BACKEND")] Backend = 2, + } + #endregion #region Messages @@ -591,6 +618,7 @@ namespace Grpc.Testing { responseStatus_ = other.responseStatus_ != null ? other.responseStatus_.Clone() : null; expectCompressed_ = other.expectCompressed_ != null ? other.expectCompressed_.Clone() : null; fillServerId_ = other.fillServerId_; + fillGrpclbRouteType_ = other.fillGrpclbRouteType_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -729,6 +757,20 @@ namespace Grpc.Testing { } } + /// <summary>Field number for the "fill_grpclb_route_type" field.</summary> + public const int FillGrpclbRouteTypeFieldNumber = 10; + private bool fillGrpclbRouteType_; + /// <summary> + /// Whether SimpleResponse should include grpclb_route_type. + /// </summary> + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool FillGrpclbRouteType { + get { return fillGrpclbRouteType_; } + set { + fillGrpclbRouteType_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as SimpleRequest); @@ -751,6 +793,7 @@ namespace Grpc.Testing { if (!object.Equals(ResponseStatus, other.ResponseStatus)) return false; if (!object.Equals(ExpectCompressed, other.ExpectCompressed)) return false; if (FillServerId != other.FillServerId) return false; + if (FillGrpclbRouteType != other.FillGrpclbRouteType) return false; return Equals(_unknownFields, other._unknownFields); } @@ -766,6 +809,7 @@ namespace Grpc.Testing { if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode(); if (expectCompressed_ != null) hash ^= ExpectCompressed.GetHashCode(); if (FillServerId != false) hash ^= FillServerId.GetHashCode(); + if (FillGrpclbRouteType != false) hash ^= FillGrpclbRouteType.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -815,6 +859,10 @@ namespace Grpc.Testing { output.WriteRawTag(72); output.WriteBool(FillServerId); } + if (FillGrpclbRouteType != false) { + output.WriteRawTag(80); + output.WriteBool(FillGrpclbRouteType); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -850,6 +898,9 @@ namespace Grpc.Testing { if (FillServerId != false) { size += 1 + 1; } + if (FillGrpclbRouteType != false) { + size += 1 + 1; + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -900,6 +951,9 @@ namespace Grpc.Testing { if (other.FillServerId != false) { FillServerId = other.FillServerId; } + if (other.FillGrpclbRouteType != false) { + FillGrpclbRouteType = other.FillGrpclbRouteType; + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -959,6 +1013,10 @@ namespace Grpc.Testing { FillServerId = input.ReadBool(); break; } + case 80: { + FillGrpclbRouteType = input.ReadBool(); + break; + } } } } @@ -997,6 +1055,7 @@ namespace Grpc.Testing { username_ = other.username_; oauthScope_ = other.oauthScope_; serverId_ = other.serverId_; + grpclbRouteType_ = other.grpclbRouteType_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -1063,6 +1122,20 @@ namespace Grpc.Testing { } } + /// <summary>Field number for the "grpclb_route_type" field.</summary> + public const int GrpclbRouteTypeFieldNumber = 5; + private global::Grpc.Testing.GrpclbRouteType grpclbRouteType_ = 0; + /// <summary> + /// gRPCLB Path. + /// </summary> + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Grpc.Testing.GrpclbRouteType GrpclbRouteType { + get { return grpclbRouteType_; } + set { + grpclbRouteType_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as SimpleResponse); @@ -1080,6 +1153,7 @@ namespace Grpc.Testing { if (Username != other.Username) return false; if (OauthScope != other.OauthScope) return false; if (ServerId != other.ServerId) return false; + if (GrpclbRouteType != other.GrpclbRouteType) return false; return Equals(_unknownFields, other._unknownFields); } @@ -1090,6 +1164,7 @@ namespace Grpc.Testing { if (Username.Length != 0) hash ^= Username.GetHashCode(); if (OauthScope.Length != 0) hash ^= OauthScope.GetHashCode(); if (ServerId.Length != 0) hash ^= ServerId.GetHashCode(); + if (GrpclbRouteType != 0) hash ^= GrpclbRouteType.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1119,6 +1194,10 @@ namespace Grpc.Testing { output.WriteRawTag(34); output.WriteString(ServerId); } + if (GrpclbRouteType != 0) { + output.WriteRawTag(40); + output.WriteEnum((int) GrpclbRouteType); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -1139,6 +1218,9 @@ namespace Grpc.Testing { if (ServerId.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(ServerId); } + if (GrpclbRouteType != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) GrpclbRouteType); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -1165,6 +1247,9 @@ namespace Grpc.Testing { if (other.ServerId.Length != 0) { ServerId = other.ServerId; } + if (other.GrpclbRouteType != 0) { + GrpclbRouteType = other.GrpclbRouteType; + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1195,6 +1280,10 @@ namespace Grpc.Testing { ServerId = input.ReadString(); break; } + case 40: { + GrpclbRouteType = (global::Grpc.Testing.GrpclbRouteType) input.ReadEnum(); + break; + } } } } From 2ea334a60b6cb9f2a6d750cd7e033441d86c33d1 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Mon, 2 Sep 2019 11:27:38 -0400 Subject: [PATCH 11/17] remove no-longer-needed generated files --- .../Grpc.Examples/MathWithProtocOptions.cs | 759 ------------------ .../MathWithProtocOptionsGrpc.cs | 208 ----- 2 files changed, 967 deletions(-) delete mode 100644 src/csharp/Grpc.Examples/MathWithProtocOptions.cs delete mode 100644 src/csharp/Grpc.Examples/MathWithProtocOptionsGrpc.cs diff --git a/src/csharp/Grpc.Examples/MathWithProtocOptions.cs b/src/csharp/Grpc.Examples/MathWithProtocOptions.cs deleted file mode 100644 index ef9a5a4ff5c..00000000000 --- a/src/csharp/Grpc.Examples/MathWithProtocOptions.cs +++ /dev/null @@ -1,759 +0,0 @@ -// <auto-generated> -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: math_with_protoc_options.proto -// </auto-generated> -#pragma warning disable 1591, 0612, 3021 -#region Designer generated code - -using pb = global::Google.Protobuf; -using pbc = global::Google.Protobuf.Collections; -using pbr = global::Google.Protobuf.Reflection; -using scg = global::System.Collections.Generic; -namespace MathWithProtocOptions { - - /// <summary>Holder for reflection information generated from math_with_protoc_options.proto</summary> - public static partial class MathWithProtocOptionsReflection { - - #region Descriptor - /// <summary>File descriptor for math_with_protoc_options.proto</summary> - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static MathWithProtocOptionsReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ch5tYXRoX3dpdGhfcHJvdG9jX29wdGlvbnMucHJvdG8SGG1hdGhfd2l0aF9w", - "cm90b2Nfb3B0aW9ucyIsCgdEaXZBcmdzEhAKCGRpdmlkZW5kGAEgASgDEg8K", - "B2Rpdmlzb3IYAiABKAMiLwoIRGl2UmVwbHkSEAoIcXVvdGllbnQYASABKAMS", - "EQoJcmVtYWluZGVyGAIgASgDIhgKB0ZpYkFyZ3MSDQoFbGltaXQYASABKAMi", - "EgoDTnVtEgsKA251bRgBIAEoAyIZCghGaWJSZXBseRINCgVjb3VudBgBIAEo", - "AzLEAgoETWF0aBJOCgNEaXYSIS5tYXRoX3dpdGhfcHJvdG9jX29wdGlvbnMu", - "RGl2QXJncxoiLm1hdGhfd2l0aF9wcm90b2Nfb3B0aW9ucy5EaXZSZXBseSIA", - "ElYKB0Rpdk1hbnkSIS5tYXRoX3dpdGhfcHJvdG9jX29wdGlvbnMuRGl2QXJn", - "cxoiLm1hdGhfd2l0aF9wcm90b2Nfb3B0aW9ucy5EaXZSZXBseSIAKAEwARJL", - "CgNGaWISIS5tYXRoX3dpdGhfcHJvdG9jX29wdGlvbnMuRmliQXJncxodLm1h", - "dGhfd2l0aF9wcm90b2Nfb3B0aW9ucy5OdW0iADABEkcKA1N1bRIdLm1hdGhf", - "d2l0aF9wcm90b2Nfb3B0aW9ucy5OdW0aHS5tYXRoX3dpdGhfcHJvdG9jX29w", - "dGlvbnMuTnVtIgAoAWIGcHJvdG8z")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::MathWithProtocOptions.DivArgs), global::MathWithProtocOptions.DivArgs.Parser, new[]{ "Dividend", "Divisor" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::MathWithProtocOptions.DivReply), global::MathWithProtocOptions.DivReply.Parser, new[]{ "Quotient", "Remainder" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::MathWithProtocOptions.FibArgs), global::MathWithProtocOptions.FibArgs.Parser, new[]{ "Limit" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::MathWithProtocOptions.Num), global::MathWithProtocOptions.Num.Parser, new[]{ "Num_" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::MathWithProtocOptions.FibReply), global::MathWithProtocOptions.FibReply.Parser, new[]{ "Count" }, null, null, null) - })); - } - #endregion - - } - #region Messages - public sealed partial class DivArgs : pb::IMessage<DivArgs> { - private static readonly pb::MessageParser<DivArgs> _parser = new pb::MessageParser<DivArgs>(() => new DivArgs()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser<DivArgs> Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::MathWithProtocOptions.MathWithProtocOptionsReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DivArgs() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DivArgs(DivArgs other) : this() { - dividend_ = other.dividend_; - divisor_ = other.divisor_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DivArgs Clone() { - return new DivArgs(this); - } - - /// <summary>Field number for the "dividend" field.</summary> - public const int DividendFieldNumber = 1; - private long dividend_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Dividend { - get { return dividend_; } - set { - dividend_ = value; - } - } - - /// <summary>Field number for the "divisor" field.</summary> - public const int DivisorFieldNumber = 2; - private long divisor_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Divisor { - get { return divisor_; } - set { - divisor_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as DivArgs); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DivArgs other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Dividend != other.Dividend) return false; - if (Divisor != other.Divisor) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Dividend != 0L) hash ^= Dividend.GetHashCode(); - if (Divisor != 0L) hash ^= Divisor.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - 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 (Dividend != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Dividend); - } - if (Divisor != 0L) { - output.WriteRawTag(16); - output.WriteInt64(Divisor); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Dividend != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Dividend); - } - if (Divisor != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Divisor); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DivArgs other) { - if (other == null) { - return; - } - if (other.Dividend != 0L) { - Dividend = other.Dividend; - } - if (other.Divisor != 0L) { - Divisor = other.Divisor; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Dividend = input.ReadInt64(); - break; - } - case 16: { - Divisor = input.ReadInt64(); - break; - } - } - } - } - - } - - public sealed partial class DivReply : pb::IMessage<DivReply> { - private static readonly pb::MessageParser<DivReply> _parser = new pb::MessageParser<DivReply>(() => new DivReply()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser<DivReply> Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::MathWithProtocOptions.MathWithProtocOptionsReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DivReply() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DivReply(DivReply other) : this() { - quotient_ = other.quotient_; - remainder_ = other.remainder_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DivReply Clone() { - return new DivReply(this); - } - - /// <summary>Field number for the "quotient" field.</summary> - public const int QuotientFieldNumber = 1; - private long quotient_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Quotient { - get { return quotient_; } - set { - quotient_ = value; - } - } - - /// <summary>Field number for the "remainder" field.</summary> - public const int RemainderFieldNumber = 2; - private long remainder_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Remainder { - get { return remainder_; } - set { - remainder_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as DivReply); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DivReply other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Quotient != other.Quotient) return false; - if (Remainder != other.Remainder) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Quotient != 0L) hash ^= Quotient.GetHashCode(); - if (Remainder != 0L) hash ^= Remainder.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - 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 (Quotient != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Quotient); - } - if (Remainder != 0L) { - output.WriteRawTag(16); - output.WriteInt64(Remainder); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Quotient != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Quotient); - } - if (Remainder != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Remainder); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DivReply other) { - if (other == null) { - return; - } - if (other.Quotient != 0L) { - Quotient = other.Quotient; - } - if (other.Remainder != 0L) { - Remainder = other.Remainder; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Quotient = input.ReadInt64(); - break; - } - case 16: { - Remainder = input.ReadInt64(); - break; - } - } - } - } - - } - - public sealed partial class FibArgs : pb::IMessage<FibArgs> { - private static readonly pb::MessageParser<FibArgs> _parser = new pb::MessageParser<FibArgs>(() => new FibArgs()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser<FibArgs> Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::MathWithProtocOptions.MathWithProtocOptionsReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FibArgs() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FibArgs(FibArgs other) : this() { - limit_ = other.limit_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FibArgs Clone() { - return new FibArgs(this); - } - - /// <summary>Field number for the "limit" field.</summary> - public const int LimitFieldNumber = 1; - private long limit_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Limit { - get { return limit_; } - set { - limit_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as FibArgs); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(FibArgs other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Limit != other.Limit) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Limit != 0L) hash ^= Limit.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - 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 (Limit != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Limit); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Limit != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Limit); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(FibArgs other) { - if (other == null) { - return; - } - if (other.Limit != 0L) { - Limit = other.Limit; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Limit = input.ReadInt64(); - break; - } - } - } - } - - } - - public sealed partial class Num : pb::IMessage<Num> { - private static readonly pb::MessageParser<Num> _parser = new pb::MessageParser<Num>(() => new Num()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser<Num> Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::MathWithProtocOptions.MathWithProtocOptionsReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Num() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Num(Num other) : this() { - num_ = other.num_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Num Clone() { - return new Num(this); - } - - /// <summary>Field number for the "num" field.</summary> - public const int Num_FieldNumber = 1; - private long num_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Num_ { - get { return num_; } - set { - num_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Num); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Num other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Num_ != other.Num_) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Num_ != 0L) hash ^= Num_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - 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 (Num_ != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Num_); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Num_ != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Num_); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Num other) { - if (other == null) { - return; - } - if (other.Num_ != 0L) { - Num_ = other.Num_; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Num_ = input.ReadInt64(); - break; - } - } - } - } - - } - - public sealed partial class FibReply : pb::IMessage<FibReply> { - private static readonly pb::MessageParser<FibReply> _parser = new pb::MessageParser<FibReply>(() => new FibReply()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser<FibReply> Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::MathWithProtocOptions.MathWithProtocOptionsReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FibReply() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FibReply(FibReply other) : this() { - count_ = other.count_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FibReply Clone() { - return new FibReply(this); - } - - /// <summary>Field number for the "count" field.</summary> - public const int CountFieldNumber = 1; - private long count_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public long Count { - get { return count_; } - set { - count_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as FibReply); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(FibReply other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Count != other.Count) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Count != 0L) hash ^= Count.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - 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 (Count != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Count); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Count != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Count); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(FibReply other) { - if (other == null) { - return; - } - if (other.Count != 0L) { - Count = other.Count; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Count = input.ReadInt64(); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/csharp/Grpc.Examples/MathWithProtocOptionsGrpc.cs b/src/csharp/Grpc.Examples/MathWithProtocOptionsGrpc.cs deleted file mode 100644 index dd61b72163f..00000000000 --- a/src/csharp/Grpc.Examples/MathWithProtocOptionsGrpc.cs +++ /dev/null @@ -1,208 +0,0 @@ -// <auto-generated> -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: math_with_protoc_options.proto -// </auto-generated> -// Original file comments: -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#pragma warning disable 0414, 1591 -#region Designer generated code - -using grpc = global::Grpc.Core; - -namespace MathWithProtocOptions { - public static partial class Math - { - static readonly string __ServiceName = "math_with_protoc_options.Math"; - - static readonly grpc::Marshaller<global::MathWithProtocOptions.DivArgs> __Marshaller_math_with_protoc_options_DivArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathWithProtocOptions.DivArgs.Parser.ParseFrom); - static readonly grpc::Marshaller<global::MathWithProtocOptions.DivReply> __Marshaller_math_with_protoc_options_DivReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathWithProtocOptions.DivReply.Parser.ParseFrom); - static readonly grpc::Marshaller<global::MathWithProtocOptions.FibArgs> __Marshaller_math_with_protoc_options_FibArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathWithProtocOptions.FibArgs.Parser.ParseFrom); - static readonly grpc::Marshaller<global::MathWithProtocOptions.Num> __Marshaller_math_with_protoc_options_Num = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathWithProtocOptions.Num.Parser.ParseFrom); - - static readonly grpc::Method<global::MathWithProtocOptions.DivArgs, global::MathWithProtocOptions.DivReply> __Method_Div = new grpc::Method<global::MathWithProtocOptions.DivArgs, global::MathWithProtocOptions.DivReply>( - grpc::MethodType.Unary, - __ServiceName, - "Div", - __Marshaller_math_with_protoc_options_DivArgs, - __Marshaller_math_with_protoc_options_DivReply); - - static readonly grpc::Method<global::MathWithProtocOptions.DivArgs, global::MathWithProtocOptions.DivReply> __Method_DivMany = new grpc::Method<global::MathWithProtocOptions.DivArgs, global::MathWithProtocOptions.DivReply>( - grpc::MethodType.DuplexStreaming, - __ServiceName, - "DivMany", - __Marshaller_math_with_protoc_options_DivArgs, - __Marshaller_math_with_protoc_options_DivReply); - - static readonly grpc::Method<global::MathWithProtocOptions.FibArgs, global::MathWithProtocOptions.Num> __Method_Fib = new grpc::Method<global::MathWithProtocOptions.FibArgs, global::MathWithProtocOptions.Num>( - grpc::MethodType.ServerStreaming, - __ServiceName, - "Fib", - __Marshaller_math_with_protoc_options_FibArgs, - __Marshaller_math_with_protoc_options_Num); - - static readonly grpc::Method<global::MathWithProtocOptions.Num, global::MathWithProtocOptions.Num> __Method_Sum = new grpc::Method<global::MathWithProtocOptions.Num, global::MathWithProtocOptions.Num>( - grpc::MethodType.ClientStreaming, - __ServiceName, - "Sum", - __Marshaller_math_with_protoc_options_Num, - __Marshaller_math_with_protoc_options_Num); - - /// <summary>Service descriptor</summary> - public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor - { - get { return global::MathWithProtocOptions.MathWithProtocOptionsReflection.Descriptor.Services[0]; } - } - - /// <summary>Lite client for Math</summary> - public partial class MathClient : grpc::LiteClientBase - { - /// <summary>Creates a new client for Math that uses a custom <c>CallInvoker</c>.</summary> - /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> - public MathClient(grpc::CallInvoker callInvoker) : base(callInvoker) - { - } - /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> - protected MathClient() : base() - { - } - - /// <summary> - /// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient - /// and remainder. - /// </summary> - /// <param name="request">The request to send to the server.</param> - /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> - /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> - /// <param name="cancellationToken">An optional token for canceling the call.</param> - /// <returns>The response received from the server.</returns> - public virtual global::MathWithProtocOptions.DivReply Div(global::MathWithProtocOptions.DivArgs request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Div(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// <summary> - /// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient - /// and remainder. - /// </summary> - /// <param name="request">The request to send to the server.</param> - /// <param name="options">The options for the call.</param> - /// <returns>The response received from the server.</returns> - public virtual global::MathWithProtocOptions.DivReply Div(global::MathWithProtocOptions.DivArgs request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_Div, null, options, request); - } - /// <summary> - /// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient - /// and remainder. - /// </summary> - /// <param name="request">The request to send to the server.</param> - /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> - /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> - /// <param name="cancellationToken">An optional token for canceling the call.</param> - /// <returns>The call object.</returns> - public virtual grpc::AsyncUnaryCall<global::MathWithProtocOptions.DivReply> DivAsync(global::MathWithProtocOptions.DivArgs request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return DivAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// <summary> - /// Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient - /// and remainder. - /// </summary> - /// <param name="request">The request to send to the server.</param> - /// <param name="options">The options for the call.</param> - /// <returns>The call object.</returns> - public virtual grpc::AsyncUnaryCall<global::MathWithProtocOptions.DivReply> DivAsync(global::MathWithProtocOptions.DivArgs request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_Div, null, options, request); - } - /// <summary> - /// DivMany accepts an arbitrary number of division args from the client stream - /// and sends back the results in the reply stream. The stream continues until - /// the client closes its end; the server does the same after sending all the - /// replies. The stream ends immediately if either end aborts. - /// </summary> - /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> - /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> - /// <param name="cancellationToken">An optional token for canceling the call.</param> - /// <returns>The call object.</returns> - public virtual grpc::AsyncDuplexStreamingCall<global::MathWithProtocOptions.DivArgs, global::MathWithProtocOptions.DivReply> DivMany(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return DivMany(new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// <summary> - /// DivMany accepts an arbitrary number of division args from the client stream - /// and sends back the results in the reply stream. The stream continues until - /// the client closes its end; the server does the same after sending all the - /// replies. The stream ends immediately if either end aborts. - /// </summary> - /// <param name="options">The options for the call.</param> - /// <returns>The call object.</returns> - public virtual grpc::AsyncDuplexStreamingCall<global::MathWithProtocOptions.DivArgs, global::MathWithProtocOptions.DivReply> DivMany(grpc::CallOptions options) - { - return CallInvoker.AsyncDuplexStreamingCall(__Method_DivMany, null, options); - } - /// <summary> - /// Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib - /// generates up to limit numbers; otherwise it continues until the call is - /// canceled. Unlike Fib above, Fib has no final FibReply. - /// </summary> - /// <param name="request">The request to send to the server.</param> - /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> - /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> - /// <param name="cancellationToken">An optional token for canceling the call.</param> - /// <returns>The call object.</returns> - public virtual grpc::AsyncServerStreamingCall<global::MathWithProtocOptions.Num> Fib(global::MathWithProtocOptions.FibArgs request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Fib(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// <summary> - /// Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib - /// generates up to limit numbers; otherwise it continues until the call is - /// canceled. Unlike Fib above, Fib has no final FibReply. - /// </summary> - /// <param name="request">The request to send to the server.</param> - /// <param name="options">The options for the call.</param> - /// <returns>The call object.</returns> - public virtual grpc::AsyncServerStreamingCall<global::MathWithProtocOptions.Num> Fib(global::MathWithProtocOptions.FibArgs request, grpc::CallOptions options) - { - return CallInvoker.AsyncServerStreamingCall(__Method_Fib, null, options, request); - } - /// <summary> - /// Sum sums a stream of numbers, returning the final result once the stream - /// is closed. - /// </summary> - /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> - /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> - /// <param name="cancellationToken">An optional token for canceling the call.</param> - /// <returns>The call object.</returns> - public virtual grpc::AsyncClientStreamingCall<global::MathWithProtocOptions.Num, global::MathWithProtocOptions.Num> Sum(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return Sum(new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// <summary> - /// Sum sums a stream of numbers, returning the final result once the stream - /// is closed. - /// </summary> - /// <param name="options">The options for the call.</param> - /// <returns>The call object.</returns> - public virtual grpc::AsyncClientStreamingCall<global::MathWithProtocOptions.Num, global::MathWithProtocOptions.Num> Sum(grpc::CallOptions options) - { - return CallInvoker.AsyncClientStreamingCall(__Method_Sum, null, options); - } - } - - } -} -#endregion From 7b54e095cbed9cbec7da473e56012578eaa938e8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Mon, 2 Sep 2019 12:30:22 -0400 Subject: [PATCH 12/17] fix microbenchmarks --- src/csharp/Grpc.Microbenchmarks/PingBenchmark.cs | 2 +- src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/csharp/Grpc.Microbenchmarks/PingBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/PingBenchmark.cs index 3949040aac0..cbcf5d361ca 100644 --- a/src/csharp/Grpc.Microbenchmarks/PingBenchmark.cs +++ b/src/csharp/Grpc.Microbenchmarks/PingBenchmark.cs @@ -86,7 +86,7 @@ namespace Grpc.Microbenchmarks await server.ShutdownAsync(); } - class PingClient : LiteClientBase + class PingClient : ClientBase { public PingClient(CallInvoker callInvoker) : base(callInvoker) { } public AsyncUnaryCall<string> PingAsync(string request, CallOptions options) diff --git a/src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs index 8448f03dd62..1f87b41169c 100644 --- a/src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs +++ b/src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs @@ -91,7 +91,7 @@ namespace Grpc.Microbenchmarks await channel.ShutdownAsync(); } - class PingClient : LiteClientBase + class PingClient : ClientBase { public PingClient(CallInvoker callInvoker) : base(callInvoker) { } From 903d30080d99b1601093b7af5a6db4c154bd7f27 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Tue, 3 Sep 2019 01:36:24 -0400 Subject: [PATCH 13/17] Revert "Mark as experiemental" This reverts commit 4275312e5174149357283c263e10c45c5552dd4b. --- src/csharp/Grpc.Tools/build/_grpc/Grpc.CSharp.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/csharp/Grpc.Tools/build/_grpc/Grpc.CSharp.xml b/src/csharp/Grpc.Tools/build/_grpc/Grpc.CSharp.xml index 2728c8bfdc2..dd220bf564d 100644 --- a/src/csharp/Grpc.Tools/build/_grpc/Grpc.CSharp.xml +++ b/src/csharp/Grpc.Tools/build/_grpc/Grpc.CSharp.xml @@ -28,7 +28,7 @@ <EnumProperty Name="ClientBaseType" DisplayName="gRPC Client Base Type" Category="gRPC" Default="ClientBase" - Description="The base type to use for the client. This is an experimental feature."> + Description="The base type to use for the client."> <EnumValue Name="ClientBase" DisplayName="Use ClientBase" /> <EnumValue Name="LiteClientBase" DisplayName="Use LiteClientBase" /> <EnumProperty.DataSource> From bac5b38c3641582684da353094fa6d1d6dfbf5ae Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Tue, 3 Sep 2019 01:38:32 -0400 Subject: [PATCH 14/17] Revert "Feedbackg" This reverts commit a0adb5003ce6066b795009cc9f2d3abaca9180b7. --- src/csharp/Grpc.Tools/build/_grpc/Grpc.CSharp.xml | 11 ----------- src/csharp/Grpc.Tools/build/_grpc/_Grpc.Tools.targets | 4 +--- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/csharp/Grpc.Tools/build/_grpc/Grpc.CSharp.xml b/src/csharp/Grpc.Tools/build/_grpc/Grpc.CSharp.xml index dd220bf564d..66862582dad 100644 --- a/src/csharp/Grpc.Tools/build/_grpc/Grpc.CSharp.xml +++ b/src/csharp/Grpc.Tools/build/_grpc/Grpc.CSharp.xml @@ -26,16 +26,5 @@ </EnumProperty.DataSource> </EnumProperty> - <EnumProperty Name="ClientBaseType" DisplayName="gRPC Client Base Type" - Category="gRPC" Default="ClientBase" - Description="The base type to use for the client."> - <EnumValue Name="ClientBase" DisplayName="Use ClientBase" /> - <EnumValue Name="LiteClientBase" DisplayName="Use LiteClientBase" /> - <EnumProperty.DataSource> - <DataSource ItemType="Protobuf" SourceOfDefaultValue="AfterContext" - PersistenceStyle="Attribute" /> - </EnumProperty.DataSource> - </EnumProperty> - </Rule> </ProjectSchemaDefinitions> diff --git a/src/csharp/Grpc.Tools/build/_grpc/_Grpc.Tools.targets b/src/csharp/Grpc.Tools/build/_grpc/_Grpc.Tools.targets index bc78e340e33..493212fe7e5 100644 --- a/src/csharp/Grpc.Tools/build/_grpc/_Grpc.Tools.targets +++ b/src/csharp/Grpc.Tools/build/_grpc/_Grpc.Tools.targets @@ -38,13 +38,11 @@ </Protobuf_Compile> <Protobuf_Compile Condition=" '%(Protobuf_Compile.GrpcServices)' == 'Client' "> <_GrpcOutputOptions>%(Protobuf_Compile._GrpcOutputOptions);no_server</_GrpcOutputOptions> + <_GrpcOutputOptions Condition=" '%(Protobuf_Compile.ClientType)' == 'LiteClient' ">%(Protobuf_Compile._GrpcOutputOptions);lite_client</_GrpcOutputOptions> </Protobuf_Compile> <Protobuf_Compile Condition=" '%(Protobuf_Compile.GrpcServices)' == 'Server' "> <_GrpcOutputOptions>%(Protobuf_Compile._GrpcOutputOptions);no_client</_GrpcOutputOptions> </Protobuf_Compile> - <Protobuf_Compile Condition=" '%(Protobuf_Compile.GrpcServices)' == 'Client' or '%(Protobuf_Compile.GrpcServices)' == 'Both' "> - <_GrpcOutputOptions Condition=" '%(Protobuf_Compile.ClientBaseType)' == 'LiteClientBase' ">%(Protobuf_Compile._GrpcOutputOptions);lite_client</_GrpcOutputOptions> - </Protobuf_Compile> </ItemGroup> </Target> </Project> From 0afe3dba92921230ab87b88ad3d62895e40375cb Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Tue, 3 Sep 2019 01:39:01 -0400 Subject: [PATCH 15/17] Revert "Add MSBuild metadata to set LiteClient for client generation." This reverts commit 9b3c9e3635a360bfe2b7bd8b09e787b5d8f73d11. --- src/csharp/Grpc.Tools/build/_grpc/_Grpc.Tools.targets | 1 - 1 file changed, 1 deletion(-) diff --git a/src/csharp/Grpc.Tools/build/_grpc/_Grpc.Tools.targets b/src/csharp/Grpc.Tools/build/_grpc/_Grpc.Tools.targets index 493212fe7e5..dd01b8183db 100644 --- a/src/csharp/Grpc.Tools/build/_grpc/_Grpc.Tools.targets +++ b/src/csharp/Grpc.Tools/build/_grpc/_Grpc.Tools.targets @@ -38,7 +38,6 @@ </Protobuf_Compile> <Protobuf_Compile Condition=" '%(Protobuf_Compile.GrpcServices)' == 'Client' "> <_GrpcOutputOptions>%(Protobuf_Compile._GrpcOutputOptions);no_server</_GrpcOutputOptions> - <_GrpcOutputOptions Condition=" '%(Protobuf_Compile.ClientType)' == 'LiteClient' ">%(Protobuf_Compile._GrpcOutputOptions);lite_client</_GrpcOutputOptions> </Protobuf_Compile> <Protobuf_Compile Condition=" '%(Protobuf_Compile.GrpcServices)' == 'Server' "> <_GrpcOutputOptions>%(Protobuf_Compile._GrpcOutputOptions);no_client</_GrpcOutputOptions> From 3c5715466fb95a83186277f9e68e818316f9f32f Mon Sep 17 00:00:00 2001 From: Jan Tattermusch <jtattermusch@google.com> Date: Tue, 3 Sep 2019 17:03:11 +0200 Subject: [PATCH 16/17] remove C# workaround for DeadlineExceeded status #2685 --- src/csharp/Grpc.Core.Tests/TimeoutsTest.cs | 10 +++------- .../Grpc.Examples.Tests/MathClientServerTests.cs | 4 +--- src/csharp/Grpc.IntegrationTesting/InteropClient.cs | 3 +-- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/csharp/Grpc.Core.Tests/TimeoutsTest.cs b/src/csharp/Grpc.Core.Tests/TimeoutsTest.cs index 55e69a01813..d92a2b9ff72 100644 --- a/src/csharp/Grpc.Core.Tests/TimeoutsTest.cs +++ b/src/csharp/Grpc.Core.Tests/TimeoutsTest.cs @@ -96,8 +96,7 @@ namespace Grpc.Core.Tests }); var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: DateTime.MinValue)), "abc")); - // We can't guarantee the status code always DeadlineExceeded. See issue #2685. - Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal }); + Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode); } [Test] @@ -110,8 +109,7 @@ namespace Grpc.Core.Tests }); var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: DateTime.UtcNow.Add(TimeSpan.FromSeconds(5)))), "abc")); - // We can't guarantee the status code always DeadlineExceeded. See issue #2685. - Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal }); + Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode); } [Test] @@ -130,9 +128,7 @@ namespace Grpc.Core.Tests }); var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(deadline: DateTime.UtcNow.Add(TimeSpan.FromSeconds(5)))), "abc")); - // We can't guarantee the status code always DeadlineExceeded. See issue #2685. - Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal }); - + Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode); Assert.IsTrue(await serverReceivedCancellationTcs.Task); } } diff --git a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs index ded80ffba5f..6fa27a6b9af 100644 --- a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs +++ b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs @@ -136,9 +136,7 @@ namespace Math.Tests deadline: DateTime.UtcNow.AddMilliseconds(500))) { var ex = Assert.ThrowsAsync<RpcException>(async () => await call.ResponseStream.ToListAsync()); - - // We can't guarantee the status code always DeadlineExceeded. See issue #2685. - Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal }); + Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode); } } diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs index 83b0095f7f0..53cd4562ead 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs @@ -476,8 +476,7 @@ namespace Grpc.IntegrationTesting } catch (RpcException ex) { - // We can't guarantee the status code always DeadlineExceeded. See issue #2685. - Assert.Contains(ex.Status.StatusCode, new[] { StatusCode.DeadlineExceeded, StatusCode.Internal }); + Assert.AreEqual(StatusCode.DeadlineExceeded, ex.Status.StatusCode); } } Console.WriteLine("Passed!"); From b28b483628e28b1438652896e705c1164b08b5a0 Mon Sep 17 00:00:00 2001 From: Moiz Haidry <mhaidry@google.com> Date: Tue, 3 Sep 2019 09:05:56 -0700 Subject: [PATCH 17/17] Assing Nana to next Github rotation --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/cleanup_request.md | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- .github/pull_request_template.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index e44c8966012..4709997666e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Report a bug about: Create a report to help us improve labels: kind/bug, priority/P2 -assignees: mhaidrygoog +assignees: nanahpang --- diff --git a/.github/ISSUE_TEMPLATE/cleanup_request.md b/.github/ISSUE_TEMPLATE/cleanup_request.md index 4fe128984b9..4ec33fafb58 100644 --- a/.github/ISSUE_TEMPLATE/cleanup_request.md +++ b/.github/ISSUE_TEMPLATE/cleanup_request.md @@ -2,7 +2,7 @@ name: Request a cleanup about: Suggest a cleanup in our repository labels: kind/internal cleanup -assignees: mhaidrygoog +assignees: nanahpang --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 499de024dd4..efa5b1611bb 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Request a feature about: Suggest an idea for this project labels: kind/enhancement -assignees: mhaidrygoog +assignees: nanahpang --- diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index ac8c41a9f26..55d8d600541 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,4 +8,4 @@ If you know who should review your pull request, please remove the mentioning be --> -@mhaidrygoog \ No newline at end of file +@nanahpang