From 8a30491657eec10a17e9de3a2a9cc5743bcabee2 Mon Sep 17 00:00:00 2001 From: Tanvi Jagtap <139093547+tanvi-jagtap@users.noreply.github.com> Date: Wed, 12 Jun 2024 22:48:45 -0700 Subject: [PATCH 01/10] [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36817) [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT Replacing GPR_ASSERT with c assert. These changes have been made using string replacement and regex. Closes #36817 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36817 from tanvi-jagtap:gpr_assert_removal_in_php 2222f9541314679e5a73f301bfafd5a70f280471 PiperOrigin-RevId: 642855768 --- src/ruby/ext/grpc/rb_call.c | 4 ++-- src/ruby/ext/grpc/rb_channel.c | 28 +++++++++++----------- src/ruby/ext/grpc/rb_channel_args.c | 2 +- src/ruby/ext/grpc/rb_compression_options.c | 6 ++--- src/ruby/ext/grpc/rb_event_thread.c | 4 ++-- src/ruby/ext/grpc/rb_grpc.c | 8 +++---- src/ruby/ext/grpc/rb_grpc.h | 8 +++++++ 7 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/ruby/ext/grpc/rb_call.c b/src/ruby/ext/grpc/rb_call.c index dde2901e6b2..9f8ede4defe 100644 --- a/src/ruby/ext/grpc/rb_call.c +++ b/src/ruby/ext/grpc/rb_call.c @@ -437,7 +437,7 @@ static int grpc_rb_md_ary_fill_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) { tmp_str); return ST_STOP; } - GPR_ASSERT(md_ary->count < md_ary->capacity); + GRPC_RUBY_ASSERT(md_ary->count < md_ary->capacity); md_ary->metadata[md_ary->count].key = key_slice; md_ary->metadata[md_ary->count].value = value_slice; md_ary->count += 1; @@ -453,7 +453,7 @@ static int grpc_rb_md_ary_fill_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) { tmp_str); return ST_STOP; } - GPR_ASSERT(md_ary->count < md_ary->capacity); + GRPC_RUBY_ASSERT(md_ary->count < md_ary->capacity); md_ary->metadata[md_ary->count].key = key_slice; md_ary->metadata[md_ary->count].value = value_slice; md_ary->count += 1; diff --git a/src/ruby/ext/grpc/rb_channel.c b/src/ruby/ext/grpc/rb_channel.c index 48099c258b6..580ef9ebd25 100644 --- a/src/ruby/ext/grpc/rb_channel.c +++ b/src/ruby/ext/grpc/rb_channel.c @@ -123,7 +123,7 @@ static void* run_poll_channels_loop_unblocking_func_wrapper(void* arg); // Needs to be called under global_connection_polling_mu static void grpc_rb_channel_watch_connection_state_op_complete( watch_state_op* op, int success) { - GPR_ASSERT(!op->op.api_callback_args.called_back); + GRPC_RUBY_ASSERT(!op->op.api_callback_args.called_back); op->op.api_callback_args.called_back = 1; op->op.api_callback_args.success = success; // wake up the watch API call that's waiting on this op @@ -133,7 +133,7 @@ static void grpc_rb_channel_watch_connection_state_op_complete( /* Avoids destroying a channel twice. */ static void grpc_rb_channel_safe_destroy(bg_watched_channel* bg) { gpr_mu_lock(&global_connection_polling_mu); - GPR_ASSERT(bg_watched_channel_list_lookup(bg)); + GRPC_RUBY_ASSERT(bg_watched_channel_list_lookup(bg)); if (!bg->channel_destroyed) { grpc_channel_destroy(bg->channel); bg->channel_destroyed = 1; @@ -253,7 +253,7 @@ static VALUE grpc_rb_channel_init(int argc, VALUE* argv, VALUE self) { ch = grpc_channel_create(target_chars, creds, &wrapper->args); } - GPR_ASSERT(ch); + GRPC_RUBY_ASSERT(ch); stack.channel = ch; stack.wrapper = wrapper; rb_thread_call_without_gvl( @@ -416,7 +416,7 @@ static void grpc_rb_channel_maybe_recreate_channel_after_fork( if (bg->channel_destroyed) { // There must be one ref at this point, held by the ruby-level channel // object, drop this one here. - GPR_ASSERT(bg->refcount == 1); + GRPC_RUBY_ASSERT(bg->refcount == 1); rb_thread_call_without_gvl(channel_safe_destroy_without_gil, bg, NULL, NULL); // re-create C-core channel @@ -581,8 +581,8 @@ static void bg_watched_channel_list_free_and_remove( bg_watched_channel* target) { bg_watched_channel* bg = NULL; - GPR_ASSERT(bg_watched_channel_list_lookup(target)); - GPR_ASSERT(target->channel_destroyed && target->refcount == 0); + GRPC_RUBY_ASSERT(bg_watched_channel_list_lookup(target)); + GRPC_RUBY_ASSERT(target->channel_destroyed && target->refcount == 0); if (bg_watched_channel_list_head == target) { bg_watched_channel_list_head = target->next; gpr_free(target); @@ -597,7 +597,7 @@ static void bg_watched_channel_list_free_and_remove( } bg = bg->next; } - GPR_ASSERT(0); + GRPC_RUBY_ASSERT(0); } /* Initialize a grpc_rb_channel's "protected grpc_channel" and try to push @@ -621,11 +621,11 @@ static void grpc_rb_channel_try_register_connection_polling( grpc_connectivity_state conn_state; watch_state_op* op = NULL; if (bg->refcount == 0) { - GPR_ASSERT(bg->channel_destroyed); + GRPC_RUBY_ASSERT(bg->channel_destroyed); bg_watched_channel_list_free_and_remove(bg); return; } - GPR_ASSERT(bg->refcount == 1); + GRPC_RUBY_ASSERT(bg->refcount == 1); if (bg->channel_destroyed || g_abort_channel_polling) { return; } @@ -633,7 +633,7 @@ static void grpc_rb_channel_try_register_connection_polling( if (conn_state == GRPC_CHANNEL_SHUTDOWN) { return; } - GPR_ASSERT(bg_watched_channel_list_lookup(bg)); + GRPC_RUBY_ASSERT(bg_watched_channel_list_lookup(bg)); // prevent bg from being free'd by GC while background thread is watching it bg->refcount++; op = gpr_zalloc(sizeof(watch_state_op)); @@ -679,7 +679,7 @@ static void* run_poll_channels_loop_no_gil(void* arg) { grpc_rb_channel_watch_connection_state_op_complete( (watch_state_op*)event.tag, event.success); } else { - GPR_ASSERT(0); + GRPC_RUBY_ASSERT(0); } } gpr_mu_unlock(&global_connection_polling_mu); @@ -769,9 +769,9 @@ static void do_basic_init() { */ void grpc_rb_channel_polling_thread_start() { gpr_once_init(&g_once_init, do_basic_init); - GPR_ASSERT(!RTEST(g_channel_polling_thread)); - GPR_ASSERT(!g_abort_channel_polling); - GPR_ASSERT(g_channel_polling_cq == NULL); + GRPC_RUBY_ASSERT(!RTEST(g_channel_polling_thread)); + GRPC_RUBY_ASSERT(!g_abort_channel_polling); + GRPC_RUBY_ASSERT(g_channel_polling_cq == NULL); g_channel_polling_cq = grpc_completion_queue_create_for_next(NULL); g_channel_polling_thread = rb_thread_create(run_poll_channels_loop, NULL); diff --git a/src/ruby/ext/grpc/rb_channel_args.c b/src/ruby/ext/grpc/rb_channel_args.c index 0dd43bcec96..4c252397e2a 100644 --- a/src/ruby/ext/grpc/rb_channel_args.c +++ b/src/ruby/ext/grpc/rb_channel_args.c @@ -160,7 +160,7 @@ void grpc_rb_hash_convert_to_channel_args(VALUE src_hash, } void grpc_rb_channel_args_destroy(grpc_channel_args* args) { - GPR_ASSERT(args != NULL); + GRPC_RUBY_ASSERT(args != NULL); if (args->args == NULL) return; for (int i = 0; i < args->num_args; i++) { // the key was created with gpr_strdup diff --git a/src/ruby/ext/grpc/rb_compression_options.c b/src/ruby/ext/grpc/rb_compression_options.c index 155c5dafe37..7bdc33004e8 100644 --- a/src/ruby/ext/grpc/rb_compression_options.c +++ b/src/ruby/ext/grpc/rb_compression_options.c @@ -181,9 +181,9 @@ void grpc_rb_compression_options_algorithm_name_to_value_internal( char* name_slice_str = grpc_slice_to_c_string(name_slice); char* error_message_str = NULL; VALUE error_message_ruby_str = Qnil; - GPR_ASSERT(gpr_asprintf(&error_message_str, - "Invalid compression algorithm name: %s", - name_slice_str) != -1); + GRPC_RUBY_ASSERT(gpr_asprintf(&error_message_str, + "Invalid compression algorithm name: %s", + name_slice_str) != -1); gpr_free(name_slice_str); error_message_ruby_str = rb_str_new(error_message_str, strlen(error_message_str)); diff --git a/src/ruby/ext/grpc/rb_event_thread.c b/src/ruby/ext/grpc/rb_event_thread.c index b22ca4c7f5d..eaa77965de4 100644 --- a/src/ruby/ext/grpc/rb_event_thread.c +++ b/src/ruby/ext/grpc/rb_event_thread.c @@ -149,12 +149,12 @@ void grpc_rb_event_queue_thread_start() { event_queue.head = event_queue.tail = NULL; } event_queue.abort = false; - GPR_ASSERT(!RTEST(g_event_thread)); + GRPC_RUBY_ASSERT(!RTEST(g_event_thread)); g_event_thread = rb_thread_create(grpc_rb_event_thread, NULL); } void grpc_rb_event_queue_thread_stop() { - GPR_ASSERT(g_one_time_init_done); + GRPC_RUBY_ASSERT(g_one_time_init_done); if (!RTEST(g_event_thread)) { gpr_log(GPR_ERROR, "GRPC_RUBY: call credentials thread stop: thread not running"); diff --git a/src/ruby/ext/grpc/rb_grpc.c b/src/ruby/ext/grpc/rb_grpc.c index 01c4777d800..0f73dc1d4b6 100644 --- a/src/ruby/ext/grpc/rb_grpc.c +++ b/src/ruby/ext/grpc/rb_grpc.c @@ -248,12 +248,12 @@ static pid_t g_init_pid; static long g_init_tid; static bool grpc_ruby_initial_pid(void) { - GPR_ASSERT(g_init_pid != 0); + GRPC_RUBY_ASSERT(g_init_pid != 0); return g_init_pid == getpid(); } static bool grpc_ruby_initial_thread(void) { - GPR_ASSERT(g_init_tid != 0); + GRPC_RUBY_ASSERT(g_init_tid != 0); return sys_gettid() == g_init_tid; } @@ -263,8 +263,8 @@ static void grpc_ruby_reset_init_state(void) { } static void grpc_ruby_basic_init(void) { - GPR_ASSERT(g_init_pid == 0); - GPR_ASSERT(g_init_tid == 0); + GRPC_RUBY_ASSERT(g_init_pid == 0); + GRPC_RUBY_ASSERT(g_init_tid == 0); grpc_ruby_reset_init_state(); // TODO(apolcyn): ideally, we should share logic with C-core // for determining whether or not fork support is enabled, rather diff --git a/src/ruby/ext/grpc/rb_grpc.h b/src/ruby/ext/grpc/rb_grpc.h index 1e7d391935f..7518b79e390 100644 --- a/src/ruby/ext/grpc/rb_grpc.h +++ b/src/ruby/ext/grpc/rb_grpc.h @@ -21,6 +21,8 @@ #include +#include + #include /* grpc_rb_mGrpcCore is the module containing the ruby wrapper GRPC classes. */ @@ -78,4 +80,10 @@ void grpc_rb_fork_unsafe_end(); void grpc_ruby_init(); +#define GRPC_RUBY_ASSERT(x) \ + if (!(x)) { \ + fprintf(stderr, "%s:%d assert failed\n", __FILE__, __LINE__); \ + abort(); \ + } + #endif /* GRPC_RB_H_ */ From 0e23c2259da967a037e839e80cafd62bc6f9f68e Mon Sep 17 00:00:00 2001 From: Tanvi Jagtap Date: Thu, 13 Jun 2024 03:09:29 -0700 Subject: [PATCH 02/10] [Gpr_To_Absl_Logging] Remove GPR_ASSERT macro. This was removed as a part of gpr to absl migration. PiperOrigin-RevId: 642916172 --- include/grpc/support/log.h | 12 ------------ src/cpp/ext/otel/otel_plugin.cc | 5 ++--- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h index 57560029624..e5d81729823 100644 --- a/include/grpc/support/log.h +++ b/include/grpc/support/log.h @@ -88,18 +88,6 @@ GPRAPI void gpr_set_log_function(gpr_log_func func); GPRAPI void gpr_assertion_failed(const char* filename, int line, const char* message) GPR_ATTRIBUTE_NORETURN; -/** abort() the process if x is zero, having written a line to the log. - - Intended for internal invariants. If the error can be recovered from, - without the possibility of corruption, or might best be reflected via - an exception in a higher-level language, consider returning error code. */ -#define GPR_ASSERT(x) \ - do { \ - if (GPR_UNLIKELY(!(x))) { \ - gpr_assertion_failed(__FILE__, __LINE__, #x); \ - } \ - } while (0) - #ifdef __cplusplus } #endif diff --git a/src/cpp/ext/otel/otel_plugin.cc b/src/cpp/ext/otel/otel_plugin.cc index 07bae2c06ca..4b2f313f466 100644 --- a/src/cpp/ext/otel/otel_plugin.cc +++ b/src/cpp/ext/otel/otel_plugin.cc @@ -30,7 +30,6 @@ #include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/nostd/variant.h" -#include #include #include #include @@ -611,14 +610,14 @@ OpenTelemetryPluginImpl::IsEnabledForServer( std::shared_ptr OpenTelemetryPluginImpl::GetChannelScopeConfig( const OpenTelemetryPluginBuilder::ChannelScope& scope) const { - GPR_ASSERT(channel_scope_filter_ == nullptr || channel_scope_filter_(scope)); + CHECK(channel_scope_filter_ == nullptr || channel_scope_filter_(scope)); return std::make_shared(this, scope); } std::shared_ptr OpenTelemetryPluginImpl::GetServerScopeConfig( const grpc_core::ChannelArgs& args) const { - GPR_ASSERT(server_selector_ == nullptr || server_selector_(args)); + CHECK(server_selector_ == nullptr || server_selector_(args)); return std::make_shared(this, args); } From f87084d64fdd90c2cb433eaa70cc4598f973c586 Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Thu, 13 Jun 2024 09:37:43 -0700 Subject: [PATCH 03/10] [Release] Bump version to 1.66.0-dev (on master branch) (#36892) Change was created by the release automation script. See go/grpc-release. Closes #36892 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36892 from XuanWang-Amos:bump_dev_version_202406112301 9b2898d716af0d8dcd90aab23e35959cd6c38855 PiperOrigin-RevId: 643027546 --- BUILD | 4 ++-- CMakeLists.txt | 6 +++--- Makefile | 2 +- _metadata.py | 2 +- build_handwritten.yaml | 4 ++-- config.m4 | 2 +- doc/g_stands_for.md | 3 ++- gRPC-C++.podspec | 2 +- gRPC-Core.podspec | 2 +- gRPC-ProtoRPC.podspec | 2 +- gRPC-RxLibrary.podspec | 2 +- gRPC.podspec | 2 +- include/grpcpp/version_info.h | 4 ++-- package.xml | 6 +++--- src/core/lib/surface/version.cc | 2 +- src/csharp/build/dependencies.props | 2 +- src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec | 2 +- src/objective-c/!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/GRPCClient/version.h | 2 +- src/objective-c/tests/version.h | 2 +- src/php/composer.json | 2 +- src/php/ext/grpc/version.h | 2 +- src/python/grpcio/grpc/_grpcio_metadata.py | 2 +- src/python/grpcio/grpc_version.py | 2 +- src/python/grpcio_admin/grpc_version.py | 2 +- src/python/grpcio_channelz/grpc_version.py | 2 +- src/python/grpcio_csds/grpc_version.py | 2 +- src/python/grpcio_csm_observability/grpc_version.py | 2 +- src/python/grpcio_health_checking/grpc_version.py | 2 +- src/python/grpcio_observability/grpc_version.py | 2 +- src/python/grpcio_reflection/grpc_version.py | 2 +- src/python/grpcio_status/grpc_version.py | 2 +- src/python/grpcio_testing/grpc_version.py | 2 +- src/python/grpcio_tests/grpc_version.py | 2 +- src/ruby/lib/grpc/version.rb | 2 +- src/ruby/nativedebug/version.rb | 2 +- src/ruby/tools/version.rb | 2 +- tools/distrib/python/grpc_version.py | 2 +- .../distrib/python/grpcio_tools/grpc_tools/grpc_version.py | 2 +- tools/distrib/python/grpcio_tools/grpc_version.py | 2 +- tools/distrib/python/xds_protos/grpc_version.py | 2 +- tools/doxygen/Doxyfile.c++ | 2 +- tools/doxygen/Doxyfile.c++.internal | 2 +- tools/doxygen/Doxyfile.objc | 2 +- tools/doxygen/Doxyfile.objc.internal | 2 +- tools/doxygen/Doxyfile.php | 2 +- 46 files changed, 54 insertions(+), 53 deletions(-) diff --git a/BUILD b/BUILD index 7892cd46496..f412be759a6 100644 --- a/BUILD +++ b/BUILD @@ -227,11 +227,11 @@ config_setting( python_config_settings() # This should be updated along with build_handwritten.yaml -g_stands_for = "gnarly" # @unused +g_stands_for = "gladiator" # @unused core_version = "42.0.0" # @unused -version = "1.65.0-dev" # @unused +version = "1.66.0-dev" # @unused GPR_PUBLIC_HDRS = [ "include/grpc/support/alloc.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 4708ab40ded..d14de5ef625 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,11 +25,11 @@ cmake_minimum_required(VERSION 3.13) set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.65.0-dev") +set(PACKAGE_VERSION "1.66.0-dev") set(gRPC_CORE_VERSION "42.0.0") set(gRPC_CORE_SOVERSION "42") -set(gRPC_CPP_VERSION "1.65.0-dev") -set(gRPC_CPP_SOVERSION "1.65") +set(gRPC_CPP_VERSION "1.66.0-dev") +set(gRPC_CPP_SOVERSION "1.66") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") diff --git a/Makefile b/Makefile index aa1295bfa64..6d05e7aeeda 100644 --- a/Makefile +++ b/Makefile @@ -368,7 +368,7 @@ Q = @ endif CORE_VERSION = 42.0.0 -CPP_VERSION = 1.65.0-dev +CPP_VERSION = 1.66.0-dev CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) diff --git a/_metadata.py b/_metadata.py index 448129f21db..f7fa656248d 100644 --- a/_metadata.py +++ b/_metadata.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/_metadata.py.template`!!! -__version__ = """1.65.0.dev0""" +__version__ = """1.66.0.dev0""" diff --git a/build_handwritten.yaml b/build_handwritten.yaml index 33d07a997bf..a962dae84f8 100644 --- a/build_handwritten.yaml +++ b/build_handwritten.yaml @@ -14,9 +14,9 @@ settings: '#10': See the expand_version.py for all the quirks here core_version: 42.0.0 csharp_major_version: 2 - g_stands_for: gnarly + g_stands_for: gladiator protobuf_version: 3.26.1 - version: 1.65.0-dev + version: 1.66.0-dev configs: asan: CC: clang diff --git a/config.m4 b/config.m4 index 6b3d155e3fa..1678bbe1fce 100644 --- a/config.m4 +++ b/config.m4 @@ -1380,7 +1380,7 @@ if test "$PHP_GRPC" != "no"; then -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DGRPC_ARES=0 \ -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1 \ -DGRPC_XDS_USER_AGENT_NAME_SUFFIX='"\"PHP\""' \ - -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX='"\"1.65.0dev\""') + -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX='"\"1.66.0dev\""') PHP_ADD_BUILD_DIR($ext_builddir/src/core/channelz) PHP_ADD_BUILD_DIR($ext_builddir/src/core/client_channel) diff --git a/doc/g_stands_for.md b/doc/g_stands_for.md index 2557a2f352e..035601582a7 100644 --- a/doc/g_stands_for.md +++ b/doc/g_stands_for.md @@ -64,4 +64,5 @@ - 1.62 'g' stands for ['guardian'](https://github.com/grpc/grpc/tree/v1.62.x) - 1.63 'g' stands for ['giggle'](https://github.com/grpc/grpc/tree/v1.63.x) - 1.64 'g' stands for ['grateful'](https://github.com/grpc/grpc/tree/v1.64.x) -- 1.65 'g' stands for ['gnarly'](https://github.com/grpc/grpc/tree/master) +- 1.65 'g' stands for ['gnarly'](https://github.com/grpc/grpc/tree/v1.65.x) +- 1.66 'g' stands for ['gladiator'](https://github.com/grpc/grpc/tree/master) diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 842fef4262a..25ded36b344 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -22,7 +22,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-C++' # TODO (mxyan): use version that match gRPC version when pod is stabilized - version = '1.65.0-dev' + version = '1.66.0-dev' s.version = version s.summary = 'gRPC C++ library' s.homepage = 'https://grpc.io' diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index f23ac164ff6..cd72fa90e8c 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.65.0-dev' + version = '1.66.0-dev' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'https://grpc.io' diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 1e9bab7d451..faa604d2288 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.65.0-dev' + version = '1.66.0-dev' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'https://grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index b1dd23fd87b..da292b55b37 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.65.0-dev' + version = '1.66.0-dev' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'https://grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index b016e73b775..9fb3fc6158d 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.65.0-dev' + version = '1.66.0-dev' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'https://grpc.io' diff --git a/include/grpcpp/version_info.h b/include/grpcpp/version_info.h index 0860a237de6..dfab77a3020 100644 --- a/include/grpcpp/version_info.h +++ b/include/grpcpp/version_info.h @@ -19,9 +19,9 @@ #define GRPCPP_VERSION_INFO_H #define GRPC_CPP_VERSION_MAJOR 1 -#define GRPC_CPP_VERSION_MINOR 65 +#define GRPC_CPP_VERSION_MINOR 66 #define GRPC_CPP_VERSION_PATCH 0 #define GRPC_CPP_VERSION_TAG "dev" -#define GRPC_CPP_VERSION_STRING "1.65.0-dev" +#define GRPC_CPP_VERSION_STRING "1.66.0-dev" #endif // GRPCPP_VERSION_INFO_H diff --git a/package.xml b/package.xml index 3d88d93e590..f1aa91cd4c4 100644 --- a/package.xml +++ b/package.xml @@ -13,8 +13,8 @@ 2019-09-24 - 1.65.0dev - 1.65.0dev + 1.66.0dev + 1.66.0dev beta @@ -22,7 +22,7 @@ Apache 2.0 -- gRPC Core 1.65.0 update +- gRPC Core 1.66.0 update diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc index 000fa58b982..a24a26ba4bf 100644 --- a/src/core/lib/surface/version.cc +++ b/src/core/lib/surface/version.cc @@ -24,4 +24,4 @@ const char* grpc_version_string(void) { return "42.0.0"; } -const char* grpc_g_stands_for(void) { return "gnarly"; } +const char* grpc_g_stands_for(void) { return "gladiator"; } diff --git a/src/csharp/build/dependencies.props b/src/csharp/build/dependencies.props index 283650bf0bf..50580b4379d 100644 --- a/src/csharp/build/dependencies.props +++ b/src/csharp/build/dependencies.props @@ -1,7 +1,7 @@ - 2.65.0-dev + 2.66.0-dev 3.26.1 diff --git a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec index e05420911b5..13c4feb9851 100644 --- a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCCppPlugin' - v = '1.65.0-dev' + v = '1.66.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 10255961d05..50393388a65 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.65.0-dev' + v = '1.66.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/GRPCClient/version.h b/src/objective-c/GRPCClient/version.h index c3e2f050573..0eb2c9b5623 100644 --- a/src/objective-c/GRPCClient/version.h +++ b/src/objective-c/GRPCClient/version.h @@ -22,4 +22,4 @@ // instead. This file can be regenerated from the template by running // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.65.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.66.0-dev" diff --git a/src/objective-c/tests/version.h b/src/objective-c/tests/version.h index 8c4b54f4b9b..b79755fb413 100644 --- a/src/objective-c/tests/version.h +++ b/src/objective-c/tests/version.h @@ -22,5 +22,5 @@ // instead. This file can be regenerated from the template by running // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.65.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.66.0-dev" #define GRPC_C_VERSION_STRING @"42.0.0" diff --git a/src/php/composer.json b/src/php/composer.json index fc2d89bacc6..4a2e463446d 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -2,7 +2,7 @@ "name": "grpc/grpc-dev", "description": "gRPC library for PHP - for Development use only", "license": "Apache-2.0", - "version": "1.65.0", + "version": "1.66.0", "require": { "php": ">=7.0.0", "google/protobuf": "^v3.3.0" diff --git a/src/php/ext/grpc/version.h b/src/php/ext/grpc/version.h index 1198590fce8..d6707d14dd9 100644 --- a/src/php/ext/grpc/version.h +++ b/src/php/ext/grpc/version.h @@ -20,6 +20,6 @@ #ifndef VERSION_H #define VERSION_H -#define PHP_GRPC_VERSION "1.65.0dev" +#define PHP_GRPC_VERSION "1.66.0dev" #endif /* VERSION_H */ diff --git a/src/python/grpcio/grpc/_grpcio_metadata.py b/src/python/grpcio/grpc/_grpcio_metadata.py index 76c35c1f7e8..346dc174f61 100644 --- a/src/python/grpcio/grpc/_grpcio_metadata.py +++ b/src/python/grpcio/grpc/_grpcio_metadata.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!! -__version__ = """1.65.0.dev0""" +__version__ = """1.66.0.dev0""" diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index 04a5cfab351..50f7b58af28 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' diff --git a/src/python/grpcio_admin/grpc_version.py b/src/python/grpcio_admin/grpc_version.py index 56ee7509fe3..b0944e4e43f 100644 --- a/src/python/grpcio_admin/grpc_version.py +++ b/src/python/grpcio_admin/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_admin/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' diff --git a/src/python/grpcio_channelz/grpc_version.py b/src/python/grpcio_channelz/grpc_version.py index 86365f4999b..e3293182f32 100644 --- a/src/python/grpcio_channelz/grpc_version.py +++ b/src/python/grpcio_channelz/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' diff --git a/src/python/grpcio_csds/grpc_version.py b/src/python/grpcio_csds/grpc_version.py index 18065fb541f..8f0a7e79124 100644 --- a/src/python/grpcio_csds/grpc_version.py +++ b/src/python/grpcio_csds/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csds/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' diff --git a/src/python/grpcio_csm_observability/grpc_version.py b/src/python/grpcio_csm_observability/grpc_version.py index 930d11a6dcb..cce1b57a924 100644 --- a/src/python/grpcio_csm_observability/grpc_version.py +++ b/src/python/grpcio_csm_observability/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csm_observability/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py index c7ba0bb48c0..6a0fa81e984 100644 --- a/src/python/grpcio_health_checking/grpc_version.py +++ b/src/python/grpcio_health_checking/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' diff --git a/src/python/grpcio_observability/grpc_version.py b/src/python/grpcio_observability/grpc_version.py index fe35dea3396..13cab2cde35 100644 --- a/src/python/grpcio_observability/grpc_version.py +++ b/src/python/grpcio_observability/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_observability/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py index 87faf2e5b6c..d4f5d1d484a 100644 --- a/src/python/grpcio_reflection/grpc_version.py +++ b/src/python/grpcio_reflection/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' diff --git a/src/python/grpcio_status/grpc_version.py b/src/python/grpcio_status/grpc_version.py index 81683b8dcbe..b1e73450284 100644 --- a/src/python/grpcio_status/grpc_version.py +++ b/src/python/grpcio_status/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' diff --git a/src/python/grpcio_testing/grpc_version.py b/src/python/grpcio_testing/grpc_version.py index f8f21a864b2..34303c2934f 100644 --- a/src/python/grpcio_testing/grpc_version.py +++ b/src/python/grpcio_testing/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py index 0e4f3b44a1d..85effbb7a8c 100644 --- a/src/python/grpcio_tests/grpc_version.py +++ b/src/python/grpcio_tests/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 73860d15afb..b44360856f2 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -14,5 +14,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '1.65.0.dev' + VERSION = '1.66.0.dev' end diff --git a/src/ruby/nativedebug/version.rb b/src/ruby/nativedebug/version.rb index a82d2ce2788..73bd2ba09c2 100644 --- a/src/ruby/nativedebug/version.rb +++ b/src/ruby/nativedebug/version.rb @@ -14,6 +14,6 @@ module GRPC module NativeDebug - VERSION = '1.65.0.dev' + VERSION = '1.66.0.dev' end end diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb index 3d5fddb60d1..5768776a546 100644 --- a/src/ruby/tools/version.rb +++ b/src/ruby/tools/version.rb @@ -14,6 +14,6 @@ module GRPC module Tools - VERSION = '1.65.0.dev' + VERSION = '1.66.0.dev' end end diff --git a/tools/distrib/python/grpc_version.py b/tools/distrib/python/grpc_version.py index 867c46e3c86..64b598204bb 100644 --- a/tools/distrib/python/grpc_version.py +++ b/tools/distrib/python/grpc_version.py @@ -14,5 +14,5 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' PROTOBUF_VERSION = '3.26.1' diff --git a/tools/distrib/python/grpcio_tools/grpc_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_tools/grpc_version.py index 7f98c77d05c..faa89ddf837 100644 --- a/tools/distrib/python/grpcio_tools/grpc_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_tools/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_tools/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index e343f013c38..b39fde76487 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -14,5 +14,5 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' PROTOBUF_VERSION = '3.26.1' diff --git a/tools/distrib/python/xds_protos/grpc_version.py b/tools/distrib/python/xds_protos/grpc_version.py index 6c029a2f261..d5fa6b588f6 100644 --- a/tools/distrib/python/xds_protos/grpc_version.py +++ b/tools/distrib/python/xds_protos/grpc_version.py @@ -14,5 +14,5 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION = '1.65.0.dev0' +VERSION = '1.66.0.dev0' PROTOBUF_VERSION = '3.26.1' diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index edf845fb46a..91c0954574a 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.65.0-dev +PROJECT_NUMBER = 1.66.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 3bceffda967..1445b3cd110 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.65.0-dev +PROJECT_NUMBER = 1.66.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.objc b/tools/doxygen/Doxyfile.objc index b6d8167d0b8..02b3f3b6fff 100644 --- a/tools/doxygen/Doxyfile.objc +++ b/tools/doxygen/Doxyfile.objc @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Objective-C" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.65.0-dev +PROJECT_NUMBER = 1.66.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.objc.internal b/tools/doxygen/Doxyfile.objc.internal index 9d397ef0336..5b38b0690f4 100644 --- a/tools/doxygen/Doxyfile.objc.internal +++ b/tools/doxygen/Doxyfile.objc.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Objective-C" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.65.0-dev +PROJECT_NUMBER = 1.66.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.php b/tools/doxygen/Doxyfile.php index ac527bd3115..c71e3d6d640 100644 --- a/tools/doxygen/Doxyfile.php +++ b/tools/doxygen/Doxyfile.php @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC PHP" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.65.0-dev +PROJECT_NUMBER = 1.66.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From d4b5e12f8ecf22b506b2831a4614c62a83458a31 Mon Sep 17 00:00:00 2001 From: apolcyn Date: Thu, 13 Jun 2024 10:33:50 -0700 Subject: [PATCH 04/10] [ruby] improve the way completion queue pluck operations handle signals and process shutdown (#36903) Fixes the CBF of `src/ruby/end2end/killed_client_thread_test.rb` (failure mode is a hang of the child process that receives the SIGTERM) that has been happening since https://github.com/grpc/grpc/pull/36724 So far grpc-ruby CQ pluck operations have so far used a 20ms-interval busy poll to check interrupts in case we've received a signal, handle process shutdown, etc. This means ongoing RPCs will not terminate their CQ operations if we need to terminate the process (the loop simply exits without waiting for the CQ op to finish), causing a leak. Those RPCs can leave refs over their corresponding channels preventing [this](https://github.com/grpc/grpc/blob/8564f72e8e0334c25c480e0aec1df75bdc1fce14/src/ruby/ext/grpc/rb_channel.c#L653) from terminating (the channels don't reach state SHUTDOWN after being destroyed). Fix is to unblock CQ pluck operations by cancelling calls, and thus allowing the CQ pluck to actually complete its operation. For server listening CQ operations, we unblock them by shutting down the server. A side win here is to remove the [20ms-interval busy poll](https://github.com/grpc/grpc/blob/8564f72e8e0334c25c480e0aec1df75bdc1fce14/src/ruby/ext/grpc/rb_completion_queue.c#L44) on CQ operations, which was only needed to handle shutdown. Closes #36903 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36903 from apolcyn:fix_ruby_interrupt bed1ee2feba4f7e2977cc29f921c7b37a84d3407 PiperOrigin-RevId: 643046465 --- src/ruby/ext/grpc/rb_call.c | 9 +++- src/ruby/ext/grpc/rb_completion_queue.c | 47 ++++++------------- src/ruby/ext/grpc/rb_completion_queue.h | 8 +++- src/ruby/ext/grpc/rb_server.c | 61 ++++++++++++++++--------- 4 files changed, 69 insertions(+), 56 deletions(-) diff --git a/src/ruby/ext/grpc/rb_call.c b/src/ruby/ext/grpc/rb_call.c index 9f8ede4defe..4071b35ea95 100644 --- a/src/ruby/ext/grpc/rb_call.c +++ b/src/ruby/ext/grpc/rb_call.c @@ -808,6 +808,12 @@ struct call_run_batch_args { run_batch_stack* st; }; +static void cancel_call_unblock_func(void* arg) { + gpr_log(GPR_INFO, "GRPC_RUBY: cancel_call_unblock_func"); + grpc_call* call = (grpc_call*)arg; + grpc_call_cancel(call, NULL); +} + static VALUE grpc_rb_call_run_batch_try(VALUE value_args) { grpc_rb_fork_unsafe_begin(); struct call_run_batch_args* args = (struct call_run_batch_args*)value_args; @@ -830,7 +836,8 @@ static VALUE grpc_rb_call_run_batch_try(VALUE value_args) { grpc_call_error_detail_of(err), err); } ev = rb_completion_queue_pluck(args->call->queue, tag, - gpr_inf_future(GPR_CLOCK_REALTIME), NULL); + gpr_inf_future(GPR_CLOCK_REALTIME), + cancel_call_unblock_func, args->call->wrapped); if (!ev.success) { rb_raise(grpc_rb_eCallError, "call#run_batch failed somehow"); } diff --git a/src/ruby/ext/grpc/rb_completion_queue.c b/src/ruby/ext/grpc/rb_completion_queue.c index 8c0af2ec0d9..6a4bb9c3072 100644 --- a/src/ruby/ext/grpc/rb_completion_queue.c +++ b/src/ruby/ext/grpc/rb_completion_queue.c @@ -35,23 +35,15 @@ typedef struct next_call_stack { grpc_event event; gpr_timespec timeout; void* tag; - volatile int interrupted; + void (*unblock_func)(void*); + void* unblock_func_arg; } next_call_stack; /* Calls grpc_completion_queue_pluck without holding the ruby GIL */ static void* grpc_rb_completion_queue_pluck_no_gil(void* param) { next_call_stack* const next_call = (next_call_stack*)param; - gpr_timespec increment = gpr_time_from_millis(20, GPR_TIMESPAN); - gpr_timespec deadline; - do { - deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), increment); - next_call->event = grpc_completion_queue_pluck( - next_call->cq, next_call->tag, deadline, NULL); - if (next_call->event.type != GRPC_QUEUE_TIMEOUT || - gpr_time_cmp(deadline, next_call->timeout) > 0) { - break; - } - } while (!next_call->interrupted); + next_call->event = grpc_completion_queue_pluck(next_call->cq, next_call->tag, + next_call->timeout, NULL); return NULL; } @@ -65,37 +57,28 @@ void grpc_rb_completion_queue_destroy(grpc_completion_queue* cq) { grpc_completion_queue_destroy(cq); } -static void unblock_func(void* param) { +static void outer_unblock_func(void* param) { next_call_stack* const next_call = (next_call_stack*)param; - next_call->interrupted = 1; + if (next_call->unblock_func == NULL) return; + next_call->unblock_func(next_call->unblock_func_arg); } /* Does the same thing as grpc_completion_queue_pluck, while properly releasing the GVL and handling interrupts */ grpc_event rb_completion_queue_pluck(grpc_completion_queue* queue, void* tag, - gpr_timespec deadline, void* reserved) { + gpr_timespec deadline, + void (*unblock_func)(void* param), + void* unblock_func_arg) { next_call_stack next_call; MEMZERO(&next_call, next_call_stack, 1); next_call.cq = queue; next_call.timeout = deadline; next_call.tag = tag; next_call.event.type = GRPC_QUEUE_TIMEOUT; - (void)reserved; - /* Loop until we finish a pluck without an interruption. The internal - pluck function runs either until it is interrupted or it gets an - event, or time runs out. - - The basic reason we need this relatively complicated construction is that - we need to re-acquire the GVL when an interrupt comes in, so that the ruby - interpreter can do what it needs to do with the interrupt. But we also need - to get back to plucking when the interrupt has been handled. */ - do { - next_call.interrupted = 0; - rb_thread_call_without_gvl(grpc_rb_completion_queue_pluck_no_gil, - (void*)&next_call, unblock_func, - (void*)&next_call); - /* If an interrupt prevented pluck from returning useful information, then - any plucks that did complete must have timed out */ - } while (next_call.interrupted && next_call.event.type == GRPC_QUEUE_TIMEOUT); + next_call.unblock_func = unblock_func; + next_call.unblock_func_arg = unblock_func_arg; + rb_thread_call_without_gvl(grpc_rb_completion_queue_pluck_no_gil, + (void*)&next_call, outer_unblock_func, + (void*)&next_call); return next_call.event; } diff --git a/src/ruby/ext/grpc/rb_completion_queue.h b/src/ruby/ext/grpc/rb_completion_queue.h index 8c29089b9bc..b9180e8d21a 100644 --- a/src/ruby/ext/grpc/rb_completion_queue.h +++ b/src/ruby/ext/grpc/rb_completion_queue.h @@ -29,8 +29,14 @@ void grpc_rb_completion_queue_destroy(grpc_completion_queue* cq); * Makes the implementation of CompletionQueue#pluck available in other files * * This avoids having code that holds the GIL repeated at multiple sites. + * + * unblock_func is invoked with the provided argument to unblock the CQ + * operation in the event of process termination (e.g. a signal), but + * unblock_func may be NULL in which case it's unused. */ grpc_event rb_completion_queue_pluck(grpc_completion_queue* queue, void* tag, - gpr_timespec deadline, void* reserved); + gpr_timespec deadline, + void (*unblock_func)(void* param), + void* unblock_func_arg); #endif /* GRPC_RB_COMPLETION_QUEUE_H_ */ diff --git a/src/ruby/ext/grpc/rb_server.c b/src/ruby/ext/grpc/rb_server.c index 51ba4a91eb2..7b42a7051fb 100644 --- a/src/ruby/ext/grpc/rb_server.c +++ b/src/ruby/ext/grpc/rb_server.c @@ -49,29 +49,28 @@ typedef struct grpc_rb_server { /* The actual server */ grpc_server* wrapped; grpc_completion_queue* queue; - int shutdown_and_notify_done; int destroy_done; } grpc_rb_server; -static void grpc_rb_server_maybe_shutdown_and_notify(grpc_rb_server* server, - gpr_timespec deadline) { +static void grpc_rb_server_shutdown_and_notify_internal(grpc_rb_server* server, + gpr_timespec deadline) { grpc_event ev; void* tag = &ev; - if (!server->shutdown_and_notify_done) { - server->shutdown_and_notify_done = 1; - if (server->wrapped != NULL) { - grpc_server_shutdown_and_notify(server->wrapped, server->queue, tag); - ev = rb_completion_queue_pluck(server->queue, tag, deadline, NULL); - if (ev.type == GRPC_QUEUE_TIMEOUT) { - grpc_server_cancel_all_calls(server->wrapped); - ev = rb_completion_queue_pluck( - server->queue, tag, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - } - if (ev.type != GRPC_OP_COMPLETE) { - gpr_log(GPR_INFO, - "GRPC_RUBY: bad grpc_server_shutdown_and_notify result:%d", - ev.type); - } + if (server->wrapped != NULL) { + grpc_server_shutdown_and_notify(server->wrapped, server->queue, tag); + // Following pluck calls will release the GIL and block but cannot + // be interrupted. They should terminate quickly enough though b/c + // we will cancel all server calls after the deadline. + ev = rb_completion_queue_pluck(server->queue, tag, deadline, NULL, NULL); + if (ev.type == GRPC_QUEUE_TIMEOUT) { + grpc_server_cancel_all_calls(server->wrapped); + ev = rb_completion_queue_pluck( + server->queue, tag, gpr_inf_future(GPR_CLOCK_REALTIME), NULL, NULL); + } + if (ev.type != GRPC_OP_COMPLETE) { + gpr_log(GPR_INFO, + "GRPC_RUBY: bad grpc_server_shutdown_and_notify result:%d", + ev.type); } } } @@ -100,7 +99,7 @@ static void grpc_rb_server_free_internal(void* p) { deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(2, GPR_TIMESPAN)); - grpc_rb_server_maybe_shutdown_and_notify(svr, deadline); + grpc_rb_server_shutdown_and_notify_internal(svr, deadline); grpc_rb_server_maybe_destroy(svr); xfree(p); @@ -132,7 +131,6 @@ static VALUE grpc_rb_server_alloc(VALUE cls) { grpc_rb_server* wrapper = ALLOC(grpc_rb_server); wrapper->wrapped = NULL; wrapper->destroy_done = 0; - wrapper->shutdown_and_notify_done = 0; return TypedData_Wrap_Struct(cls, &grpc_rb_server_data_type, wrapper); } @@ -192,6 +190,24 @@ struct server_request_call_args { request_call_stack st; }; +static void shutdown_server_unblock_func(void* arg) { + grpc_rb_server* server = (grpc_rb_server*)arg; + gpr_log(GPR_INFO, "GRPC_RUBY: shutdown_server_unblock_func"); + GPR_ASSERT(server->wrapped != NULL); + grpc_event event; + void* tag = &event; + grpc_server_shutdown_and_notify(server->wrapped, server->queue, tag); + grpc_server_cancel_all_calls(server->wrapped); + // Following call is blocking, but should finish quickly since we've + // cancelled all calls. + event = grpc_completion_queue_pluck(server->queue, tag, + gpr_inf_future(GPR_CLOCK_REALTIME), NULL); + gpr_log(GPR_INFO, + "GRPC_RUBY: shutdown_server_unblock_func pluck event.type: %d " + "event.success: %d", + event.type, event.success); +} + static VALUE grpc_rb_server_request_call_try(VALUE value_args) { grpc_rb_fork_unsafe_begin(); struct server_request_call_args* args = @@ -215,7 +231,8 @@ static VALUE grpc_rb_server_request_call_try(VALUE value_args) { } grpc_event ev = rb_completion_queue_pluck( - args->server->queue, tag, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); + args->server->queue, tag, gpr_inf_future(GPR_CLOCK_REALTIME), + shutdown_server_unblock_func, args->server); if (!ev.success) { rb_raise(grpc_rb_eCallError, "request_call completion failed"); } @@ -288,7 +305,7 @@ static VALUE grpc_rb_server_shutdown_and_notify(VALUE self, VALUE timeout) { deadline = grpc_rb_time_timeval(timeout, /* absolute time*/ 0); } - grpc_rb_server_maybe_shutdown_and_notify(s, deadline); + grpc_rb_server_shutdown_and_notify_internal(s, deadline); return Qnil; } From a535a11efc2385e852d368e7025a15f7c6615293 Mon Sep 17 00:00:00 2001 From: Arjan Singh Bal <46515553+arjan-bal@users.noreply.github.com> Date: Thu, 13 Jun 2024 10:39:21 -0700 Subject: [PATCH 05/10] [interop] Avoid installing the same python dependencies twice in Go 1.64 tests (#36864) Avoid installing the same python dependencies twice due to duplication in template from https://github.com/grpc/grpc/pull/36755. Redundant installation in the go1.x Dockerfile presently: ![image](https://github.com/grpc/grpc/assets/46515553/f8dafde9-5442-41b9-a429-dec93eee7c03) Fixes: https://github.com/grpc/grpc/issues/36060 Closes #36864 PiperOrigin-RevId: 643048549 --- templates/tools/dockerfile/run_tests_python_deps_venv.include | 4 +--- tools/bazelify_tests/dockerimage_current_versions.bzl | 2 +- .../dockerfile/interoptest/grpc_interop_go1.x.current_version | 2 +- tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/templates/tools/dockerfile/run_tests_python_deps_venv.include b/templates/tools/dockerfile/run_tests_python_deps_venv.include index 920cc7ca2d6..864c26bf526 100644 --- a/templates/tools/dockerfile/run_tests_python_deps_venv.include +++ b/templates/tools/dockerfile/run_tests_python_deps_venv.include @@ -26,8 +26,6 @@ RUN echo "source $PYTHON_ENV/bin/activate" >> ~/.bashrc # but since our python2 usage is deprecated, we should get rid of it. RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && \ python3 -m pip install --upgrade pip==19.3.1 && \ - python3 -m pip install six==1.16.0 && \ - python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0" - + python3 -m pip install six==1.16.0" <%include file="./gcp_api_libraries_venv.include"/> diff --git a/tools/bazelify_tests/dockerimage_current_versions.bzl b/tools/bazelify_tests/dockerimage_current_versions.bzl index 90306784754..c91b2655ada 100644 --- a/tools/bazelify_tests/dockerimage_current_versions.bzl +++ b/tools/bazelify_tests/dockerimage_current_versions.bzl @@ -78,7 +78,7 @@ DOCKERIMAGE_CURRENT_VERSIONS = { "tools/dockerfile/interoptest/grpc_interop_go1.16.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.16@sha256:3767f47c9d06584c6c07b7ab536e13f3e87550330e6c2652ad288d3a72b0de23", "tools/dockerfile/interoptest/grpc_interop_go1.19.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.19@sha256:889e7ff34399a5e16af87940d1eaa239e56da307f7faca3f8f1d28379c2e3df3", "tools/dockerfile/interoptest/grpc_interop_go1.8.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.8@sha256:7830a301b37539252c592b9cd7fa30a6142d0afc717a05fc8d2b82c74fb45efe", - "tools/dockerfile/interoptest/grpc_interop_go1.x.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.x@sha256:c1d1babd31ea7e635aa68d56803212f9e0091ff628288c18dc86d890f837303a", + "tools/dockerfile/interoptest/grpc_interop_go1.x.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.x@sha256:9d02b61552a93770ebb022f588daf9acd1088d29197fe120e0b082ede73f4584", "tools/dockerfile/interoptest/grpc_interop_http2.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_http2@sha256:e3f247d8038374848fadf7215b841e3575c0b2a4217feb503a79b8004b164c5a", "tools/dockerfile/interoptest/grpc_interop_java.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_java@sha256:6c0319bbbf77d6c198f61adf92d205efd33cbd2cccaf914a1af8f2dcb61b16a1", "tools/dockerfile/interoptest/grpc_interop_node.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_node@sha256:549a7683cc024fb7ffee807eaa8acb6c2d5a5dd0184a2590f91852804eea39a4", diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.x.current_version b/tools/dockerfile/interoptest/grpc_interop_go1.x.current_version index 1437c2993ad..99a32701de6 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go1.x.current_version +++ b/tools/dockerfile/interoptest/grpc_interop_go1.x.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.x:9740f2234d8c996def3f0e09791328c39dac0ab1@sha256:c1d1babd31ea7e635aa68d56803212f9e0091ff628288c18dc86d890f837303a \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.x:9a524415365a73162b7f463bf0409ca04f64a73c@sha256:9d02b61552a93770ebb022f588daf9acd1088d29197fe120e0b082ede73f4584 \ No newline at end of file diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile index d7b5ba18533..8aa291f0173 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile @@ -43,8 +43,7 @@ RUN echo "source $PYTHON_ENV/bin/activate" >> ~/.bashrc # use pinned version of pip to avoid sudden breakages # TODO(#36814): currently six is needed for tools/run_tests scripts # but since our python2 usage is deprecated, we should get rid of it. -RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && python3 -m pip install --upgrade pip==19.3.1 && python3 -m pip install six==1.16.0 && python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0" - +RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && python3 -m pip install --upgrade pip==19.3.1 && python3 -m pip install six==1.16.0" # Install Google Cloud Platform API libraries # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) From 2c9e127ac9bb39156c0509560b162f24fd37fd12 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 13 Jun 2024 10:44:28 -0700 Subject: [PATCH 06/10] [chaotic-good] Fix use-after-free (#36826) Previously AbortWithError could race with destruction Built on #36825 which should be merged first Closes #36826 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36826 from ctiller:csc2 e79c87984536c8e36280cf07c2e771723324b2c8 PiperOrigin-RevId: 643050342 --- .../chaotic_good/client_transport.cc | 19 ++++++++++++++++++- .../transport/chaotic_good/client_transport.h | 5 +---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/core/ext/transport/chaotic_good/client_transport.cc b/src/core/ext/transport/chaotic_good/client_transport.cc index ddcdaa12ead..5d68d93cf64 100644 --- a/src/core/ext/transport/chaotic_good/client_transport.cc +++ b/src/core/ext/transport/chaotic_good/client_transport.cc @@ -56,6 +56,21 @@ namespace grpc_core { namespace chaotic_good { +void ChaoticGoodClientTransport::Orphan() { + LOG(INFO) << "ChaoticGoodClientTransport::Orphan"; + AbortWithError(); + ActivityPtr writer; + ActivityPtr reader; + { + MutexLock lock(&mu_); + writer = std::move(writer_); + reader = std::move(reader_); + } + writer.reset(); + reader.reset(); + Unref(); +} + auto ChaoticGoodClientTransport::TransportWriteLoop( RefCountedPtr transport) { return Loop([this, transport = std::move(transport)] { @@ -176,7 +191,9 @@ auto ChaoticGoodClientTransport::TransportReadLoop( } auto ChaoticGoodClientTransport::OnTransportActivityDone() { - return [this](absl::Status) { AbortWithError(); }; + return [self = RefAsSubclass()](absl::Status) { + self->AbortWithError(); + }; } ChaoticGoodClientTransport::ChaoticGoodClientTransport( diff --git a/src/core/ext/transport/chaotic_good/client_transport.h b/src/core/ext/transport/chaotic_good/client_transport.h index 12a96403d9a..de37b8d7952 100644 --- a/src/core/ext/transport/chaotic_good/client_transport.h +++ b/src/core/ext/transport/chaotic_good/client_transport.h @@ -82,10 +82,7 @@ class ChaoticGoodClientTransport final : public ClientTransport { void SetPollset(grpc_stream*, grpc_pollset*) override {} void SetPollsetSet(grpc_stream*, grpc_pollset_set*) override {} void PerformOp(grpc_transport_op*) override; - void Orphan() override { - AbortWithError(); - Unref(); - } + void Orphan() override; void StartCall(CallHandler call_handler) override; void AbortWithError(); From a71308d938032e867de209f3388c01e665586a1f Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Thu, 13 Jun 2024 13:32:16 -0700 Subject: [PATCH 07/10] [build] Temporarily disable RBE result uploads (#36918) See b/343253646 for context. Closes #36918 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36918 from drfloob:disable-resultstore 01a76f396a470fb1832c746faa3ce0dc94bf4f3e PiperOrigin-RevId: 643105120 --- tools/remote_build/include/rbe_base_config.bazelrc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/remote_build/include/rbe_base_config.bazelrc b/tools/remote_build/include/rbe_base_config.bazelrc index 0f98d28e32a..485eaea5b61 100644 --- a/tools/remote_build/include/rbe_base_config.bazelrc +++ b/tools/remote_build/include/rbe_base_config.bazelrc @@ -37,10 +37,11 @@ build --remote_cache=grpcs://remotebuildexecution.googleapis.com # Set flags for uploading to BES in order to view results in the Bazel Build # Results UI. -build --bes_backend=grpcs://buildeventservice.googleapis.com -build --bes_timeout=600s -build --bes_results_url="https://source.cloud.google.com/results/invocations/" -build --bes_instance_name=grpc-testing +# TODO(b/343253646): Uncomment these when the ResultStore backend is fixed +# build --bes_backend=grpcs://buildeventservice.googleapis.com +# build --bes_timeout=600s +# build --bes_results_url="https://source.cloud.google.com/results/invocations/" +# build --bes_instance_name=grpc-testing # Avoid timeouts for actions that don't write output for long time (See b/143346671 and b/143134296) build --grpc_keepalive_time=10m From b5e2aa76fd214b6eecdd9490a54551d58688e052 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Thu, 13 Jun 2024 14:51:13 -0700 Subject: [PATCH 08/10] Revert "[build] Temporarily disable RBE result uploads (#36918)" (#36919) This reverts commit a71308d938032e867de209f3388c01e665586a1f. Closes #36919 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36919 from drfloob:disable-resultstore 592e7b8138e3989867ec6d5741b374bc45ab551f PiperOrigin-RevId: 643129175 --- tools/remote_build/include/rbe_base_config.bazelrc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/remote_build/include/rbe_base_config.bazelrc b/tools/remote_build/include/rbe_base_config.bazelrc index 485eaea5b61..0f98d28e32a 100644 --- a/tools/remote_build/include/rbe_base_config.bazelrc +++ b/tools/remote_build/include/rbe_base_config.bazelrc @@ -37,11 +37,10 @@ build --remote_cache=grpcs://remotebuildexecution.googleapis.com # Set flags for uploading to BES in order to view results in the Bazel Build # Results UI. -# TODO(b/343253646): Uncomment these when the ResultStore backend is fixed -# build --bes_backend=grpcs://buildeventservice.googleapis.com -# build --bes_timeout=600s -# build --bes_results_url="https://source.cloud.google.com/results/invocations/" -# build --bes_instance_name=grpc-testing +build --bes_backend=grpcs://buildeventservice.googleapis.com +build --bes_timeout=600s +build --bes_results_url="https://source.cloud.google.com/results/invocations/" +build --bes_instance_name=grpc-testing # Avoid timeouts for actions that don't write output for long time (See b/143346671 and b/143134296) build --grpc_keepalive_time=10m From f0bbdeab3660c98c255791bf4cb00504b5d5e3aa Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 13 Jun 2024 16:36:14 -0700 Subject: [PATCH 09/10] [chttp2] don't access endpoint in transport ops if it's already been destroyed (#36921) This fixes a bug introduced in #36195. b/345103652 Closes #36921 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36921 from markdroth:endpoint_chttp2_fix 4f22314f63e89c97e86a768a92107333092a5cb6 PiperOrigin-RevId: 643159747 --- .../ext/transport/chttp2/transport/chttp2_transport.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 56158de1f80..fe00b2e4bdc 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -1938,11 +1938,15 @@ static void perform_transport_op_locked(void* stream_op, } if (op->bind_pollset) { - grpc_endpoint_add_to_pollset(t->ep, op->bind_pollset); + if (t->ep != nullptr) { + grpc_endpoint_add_to_pollset(t->ep, op->bind_pollset); + } } if (op->bind_pollset_set) { - grpc_endpoint_add_to_pollset_set(t->ep, op->bind_pollset_set); + if (t->ep != nullptr) { + grpc_endpoint_add_to_pollset_set(t->ep, op->bind_pollset_set); + } } if (op->send_ping.on_initiate != nullptr || op->send_ping.on_ack != nullptr) { From dee3cf6e3438d3482ff7d7e203ca002001087821 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 13 Jun 2024 17:44:03 -0700 Subject: [PATCH 10/10] [e2e tests] fix connection failure regex (#36922) Closes #36922 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36922 from markdroth:e2e_test_flake_fix 1bcc04aaa73cb883ceb9107a65c0323707254884 PiperOrigin-RevId: 643176629 --- test/cpp/end2end/client_lb_end2end_test.cc | 2 +- test/cpp/end2end/xds/xds_end2end_test_lib.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc index ea6156b545d..136087b8dd0 100644 --- a/test/cpp/end2end/client_lb_end2end_test.cc +++ b/test/cpp/end2end/client_lb_end2end_test.cc @@ -588,7 +588,7 @@ class ClientLbEnd2endTest : public ::testing::Test { "(Failed to connect to remote host: )?" "(Timeout occurred: )?" // Syscall - "((connect|recvmsg|getsockopt\\(SO\\_ERROR\\)): )?" + "((connect|recvmsg|getsockopt\\(SO\\_ERROR\\)): ?)?" // strerror() output or other message "(Connection refused" "|Connection reset by peer" diff --git a/test/cpp/end2end/xds/xds_end2end_test_lib.cc b/test/cpp/end2end/xds/xds_end2end_test_lib.cc index e46a16bdf19..2acf69ff1a0 100644 --- a/test/cpp/end2end/xds/xds_end2end_test_lib.cc +++ b/test/cpp/end2end/xds/xds_end2end_test_lib.cc @@ -844,7 +844,7 @@ std::string XdsEnd2endTest::MakeConnectionFailureRegex( "(Failed to connect to remote host: )?" "(Timeout occurred: )?" // Syscall - "((connect|recvmsg|getsockopt\\(SO\\_ERROR\\)): )?" + "((connect|recvmsg|getsockopt\\(SO\\_ERROR\\)): ?)?" // strerror() output or other message "(Connection refused" "|Connection reset by peer"