Merge branch 'master' into test_folder_gpr_log

pull/36879/head
tanvi-jagtap 9 months ago
commit 5e55895914
  1. 4
      BUILD
  2. 6
      CMakeLists.txt
  3. 2
      Makefile
  4. 2
      _metadata.py
  5. 4
      build_handwritten.yaml
  6. 2
      config.m4
  7. 3
      doc/g_stands_for.md
  8. 2
      gRPC-C++.podspec
  9. 2
      gRPC-Core.podspec
  10. 2
      gRPC-ProtoRPC.podspec
  11. 2
      gRPC-RxLibrary.podspec
  12. 2
      gRPC.podspec
  13. 12
      include/grpc/support/log.h
  14. 4
      include/grpcpp/version_info.h
  15. 6
      package.xml
  16. 19
      src/core/ext/transport/chaotic_good/client_transport.cc
  17. 5
      src/core/ext/transport/chaotic_good/client_transport.h
  18. 4
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  19. 2
      src/core/lib/surface/version.cc
  20. 5
      src/cpp/ext/otel/otel_plugin.cc
  21. 2
      src/csharp/build/dependencies.props
  22. 2
      src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec
  23. 2
      src/objective-c/!ProtoCompiler-gRPCPlugin.podspec
  24. 2
      src/objective-c/GRPCClient/version.h
  25. 2
      src/objective-c/tests/version.h
  26. 2
      src/php/composer.json
  27. 2
      src/php/ext/grpc/version.h
  28. 2
      src/python/grpcio/grpc/_grpcio_metadata.py
  29. 2
      src/python/grpcio/grpc_version.py
  30. 2
      src/python/grpcio_admin/grpc_version.py
  31. 2
      src/python/grpcio_channelz/grpc_version.py
  32. 2
      src/python/grpcio_csds/grpc_version.py
  33. 2
      src/python/grpcio_csm_observability/grpc_version.py
  34. 2
      src/python/grpcio_health_checking/grpc_version.py
  35. 2
      src/python/grpcio_observability/grpc_version.py
  36. 2
      src/python/grpcio_reflection/grpc_version.py
  37. 2
      src/python/grpcio_status/grpc_version.py
  38. 2
      src/python/grpcio_testing/grpc_version.py
  39. 2
      src/python/grpcio_tests/grpc_version.py
  40. 13
      src/ruby/ext/grpc/rb_call.c
  41. 28
      src/ruby/ext/grpc/rb_channel.c
  42. 2
      src/ruby/ext/grpc/rb_channel_args.c
  43. 43
      src/ruby/ext/grpc/rb_completion_queue.c
  44. 8
      src/ruby/ext/grpc/rb_completion_queue.h
  45. 2
      src/ruby/ext/grpc/rb_compression_options.c
  46. 4
      src/ruby/ext/grpc/rb_event_thread.c
  47. 8
      src/ruby/ext/grpc/rb_grpc.c
  48. 8
      src/ruby/ext/grpc/rb_grpc.h
  49. 39
      src/ruby/ext/grpc/rb_server.c
  50. 2
      src/ruby/lib/grpc/version.rb
  51. 2
      src/ruby/nativedebug/version.rb
  52. 2
      src/ruby/tools/version.rb
  53. 4
      templates/tools/dockerfile/run_tests_python_deps_venv.include
  54. 2
      test/cpp/end2end/client_lb_end2end_test.cc
  55. 2
      test/cpp/end2end/xds/xds_end2end_test_lib.cc
  56. 2
      tools/bazelify_tests/dockerimage_current_versions.bzl
  57. 2
      tools/distrib/python/grpc_version.py
  58. 2
      tools/distrib/python/grpcio_tools/grpc_tools/grpc_version.py
  59. 2
      tools/distrib/python/grpcio_tools/grpc_version.py
  60. 2
      tools/distrib/python/xds_protos/grpc_version.py
  61. 2
      tools/dockerfile/interoptest/grpc_interop_go1.x.current_version
  62. 3
      tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile
  63. 2
      tools/doxygen/Doxyfile.c++
  64. 2
      tools/doxygen/Doxyfile.c++.internal
  65. 2
      tools/doxygen/Doxyfile.objc
  66. 2
      tools/doxygen/Doxyfile.objc.internal
  67. 2
      tools/doxygen/Doxyfile.php

@ -227,11 +227,11 @@ config_setting(
python_config_settings() python_config_settings()
# This should be updated along with build_handwritten.yaml # 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 core_version = "42.0.0" # @unused
version = "1.65.0-dev" # @unused version = "1.66.0-dev" # @unused
GPR_PUBLIC_HDRS = [ GPR_PUBLIC_HDRS = [
"include/grpc/support/alloc.h", "include/grpc/support/alloc.h",

6
CMakeLists.txt generated

@ -25,11 +25,11 @@
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
set(PACKAGE_NAME "grpc") 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_VERSION "42.0.0")
set(gRPC_CORE_SOVERSION "42") set(gRPC_CORE_SOVERSION "42")
set(gRPC_CPP_VERSION "1.65.0-dev") set(gRPC_CPP_VERSION "1.66.0-dev")
set(gRPC_CPP_SOVERSION "1.65") set(gRPC_CPP_SOVERSION "1.66")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/")

2
Makefile generated

@ -368,7 +368,7 @@ Q = @
endif endif
CORE_VERSION = 42.0.0 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_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/_metadata.py.template`!!! # AUTO-GENERATED FROM `$REPO_ROOT/templates/_metadata.py.template`!!!
__version__ = """1.65.0.dev0""" __version__ = """1.66.0.dev0"""

@ -14,9 +14,9 @@ settings:
'#10': See the expand_version.py for all the quirks here '#10': See the expand_version.py for all the quirks here
core_version: 42.0.0 core_version: 42.0.0
csharp_major_version: 2 csharp_major_version: 2
g_stands_for: gnarly g_stands_for: gladiator
protobuf_version: 3.26.1 protobuf_version: 3.26.1
version: 1.65.0-dev version: 1.66.0-dev
configs: configs:
asan: asan:
CC: clang CC: clang

2
config.m4 generated

@ -1380,7 +1380,7 @@ if test "$PHP_GRPC" != "no"; then
-D_HAS_EXCEPTIONS=0 -DNOMINMAX -DGRPC_ARES=0 \ -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DGRPC_ARES=0 \
-DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1 \ -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1 \
-DGRPC_XDS_USER_AGENT_NAME_SUFFIX='"\"PHP\""' \ -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/channelz)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/client_channel) PHP_ADD_BUILD_DIR($ext_builddir/src/core/client_channel)

@ -64,4 +64,5 @@
- 1.62 'g' stands for ['guardian'](https://github.com/grpc/grpc/tree/v1.62.x) - 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.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.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)

2
gRPC-C++.podspec generated

@ -22,7 +22,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC-C++' s.name = 'gRPC-C++'
# TODO (mxyan): use version that match gRPC version when pod is stabilized # 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.version = version
s.summary = 'gRPC C++ library' s.summary = 'gRPC C++ library'
s.homepage = 'https://grpc.io' s.homepage = 'https://grpc.io'

2
gRPC-Core.podspec generated

@ -21,7 +21,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC-Core' s.name = 'gRPC-Core'
version = '1.65.0-dev' version = '1.66.0-dev'
s.version = version s.version = version
s.summary = 'Core cross-platform gRPC library, written in C' s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'https://grpc.io' s.homepage = 'https://grpc.io'

@ -21,7 +21,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC' s.name = 'gRPC-ProtoRPC'
version = '1.65.0-dev' version = '1.66.0-dev'
s.version = version s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'https://grpc.io' s.homepage = 'https://grpc.io'

@ -21,7 +21,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary' s.name = 'gRPC-RxLibrary'
version = '1.65.0-dev' version = '1.66.0-dev'
s.version = version s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.' s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'https://grpc.io' s.homepage = 'https://grpc.io'

2
gRPC.podspec generated

@ -20,7 +20,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC' s.name = 'gRPC'
version = '1.65.0-dev' version = '1.66.0-dev'
s.version = version s.version = version
s.summary = 'gRPC client library for iOS/OSX' s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'https://grpc.io' s.homepage = 'https://grpc.io'

@ -88,18 +88,6 @@ GPRAPI void gpr_set_log_function(gpr_log_func func);
GPRAPI void gpr_assertion_failed(const char* filename, int line, GPRAPI void gpr_assertion_failed(const char* filename, int line,
const char* message) GPR_ATTRIBUTE_NORETURN; 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 #ifdef __cplusplus
} }
#endif #endif

@ -19,9 +19,9 @@
#define GRPCPP_VERSION_INFO_H #define GRPCPP_VERSION_INFO_H
#define GRPC_CPP_VERSION_MAJOR 1 #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_PATCH 0
#define GRPC_CPP_VERSION_TAG "dev" #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 #endif // GRPCPP_VERSION_INFO_H

6
package.xml generated

@ -13,8 +13,8 @@
<date>2019-09-24</date> <date>2019-09-24</date>
<time>16:06:07</time> <time>16:06:07</time>
<version> <version>
<release>1.65.0dev</release> <release>1.66.0dev</release>
<api>1.65.0dev</api> <api>1.66.0dev</api>
</version> </version>
<stability> <stability>
<release>beta</release> <release>beta</release>
@ -22,7 +22,7 @@
</stability> </stability>
<license>Apache 2.0</license> <license>Apache 2.0</license>
<notes> <notes>
- gRPC Core 1.65.0 update - gRPC Core 1.66.0 update
</notes> </notes>
<contents> <contents>
<dir baseinstalldir="/" name="/"> <dir baseinstalldir="/" name="/">

@ -56,6 +56,21 @@
namespace grpc_core { namespace grpc_core {
namespace chaotic_good { 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( auto ChaoticGoodClientTransport::TransportWriteLoop(
RefCountedPtr<ChaoticGoodTransport> transport) { RefCountedPtr<ChaoticGoodTransport> transport) {
return Loop([this, transport = std::move(transport)] { return Loop([this, transport = std::move(transport)] {
@ -176,7 +191,9 @@ auto ChaoticGoodClientTransport::TransportReadLoop(
} }
auto ChaoticGoodClientTransport::OnTransportActivityDone() { auto ChaoticGoodClientTransport::OnTransportActivityDone() {
return [this](absl::Status) { AbortWithError(); }; return [self = RefAsSubclass<ChaoticGoodClientTransport>()](absl::Status) {
self->AbortWithError();
};
} }
ChaoticGoodClientTransport::ChaoticGoodClientTransport( ChaoticGoodClientTransport::ChaoticGoodClientTransport(

@ -82,10 +82,7 @@ class ChaoticGoodClientTransport final : public ClientTransport {
void SetPollset(grpc_stream*, grpc_pollset*) override {} void SetPollset(grpc_stream*, grpc_pollset*) override {}
void SetPollsetSet(grpc_stream*, grpc_pollset_set*) override {} void SetPollsetSet(grpc_stream*, grpc_pollset_set*) override {}
void PerformOp(grpc_transport_op*) override; void PerformOp(grpc_transport_op*) override;
void Orphan() override { void Orphan() override;
AbortWithError();
Unref();
}
void StartCall(CallHandler call_handler) override; void StartCall(CallHandler call_handler) override;
void AbortWithError(); void AbortWithError();

@ -1938,12 +1938,16 @@ static void perform_transport_op_locked(void* stream_op,
} }
if (op->bind_pollset) { if (op->bind_pollset) {
if (t->ep != nullptr) {
grpc_endpoint_add_to_pollset(t->ep, op->bind_pollset); grpc_endpoint_add_to_pollset(t->ep, op->bind_pollset);
} }
}
if (op->bind_pollset_set) { if (op->bind_pollset_set) {
if (t->ep != nullptr) {
grpc_endpoint_add_to_pollset_set(t->ep, op->bind_pollset_set); 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) { if (op->send_ping.on_initiate != nullptr || op->send_ping.on_ack != nullptr) {
send_ping_locked(t.get(), op->send_ping.on_initiate, op->send_ping.on_ack); send_ping_locked(t.get(), op->send_ping.on_initiate, op->send_ping.on_ack);

@ -24,4 +24,4 @@
const char* grpc_version_string(void) { return "42.0.0"; } 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"; }

@ -30,7 +30,6 @@
#include "opentelemetry/nostd/unique_ptr.h" #include "opentelemetry/nostd/unique_ptr.h"
#include "opentelemetry/nostd/variant.h" #include "opentelemetry/nostd/variant.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include <grpcpp/ext/otel_plugin.h> #include <grpcpp/ext/otel_plugin.h>
#include <grpcpp/version_info.h> #include <grpcpp/version_info.h>
@ -611,14 +610,14 @@ OpenTelemetryPluginImpl::IsEnabledForServer(
std::shared_ptr<grpc_core::StatsPlugin::ScopeConfig> std::shared_ptr<grpc_core::StatsPlugin::ScopeConfig>
OpenTelemetryPluginImpl::GetChannelScopeConfig( OpenTelemetryPluginImpl::GetChannelScopeConfig(
const OpenTelemetryPluginBuilder::ChannelScope& scope) const { 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<ClientScopeConfig>(this, scope); return std::make_shared<ClientScopeConfig>(this, scope);
} }
std::shared_ptr<grpc_core::StatsPlugin::ScopeConfig> std::shared_ptr<grpc_core::StatsPlugin::ScopeConfig>
OpenTelemetryPluginImpl::GetServerScopeConfig( OpenTelemetryPluginImpl::GetServerScopeConfig(
const grpc_core::ChannelArgs& args) const { 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<ServerScopeConfig>(this, args); return std::make_shared<ServerScopeConfig>(this, args);
} }

@ -1,7 +1,7 @@
<!-- This file is generated --> <!-- This file is generated -->
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<GrpcCsharpVersion>2.65.0-dev</GrpcCsharpVersion> <GrpcCsharpVersion>2.66.0-dev</GrpcCsharpVersion>
<GoogleProtobufVersion>3.26.1</GoogleProtobufVersion> <GoogleProtobufVersion>3.26.1</GoogleProtobufVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

@ -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 # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
# before them. # before them.
s.name = '!ProtoCompiler-gRPCCppPlugin' s.name = '!ProtoCompiler-gRPCCppPlugin'
v = '1.65.0-dev' v = '1.66.0-dev'
s.version = v s.version = v
s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.' s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.'
s.description = <<-DESC s.description = <<-DESC

@ -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 # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
# before them. # before them.
s.name = '!ProtoCompiler-gRPCPlugin' s.name = '!ProtoCompiler-gRPCPlugin'
v = '1.65.0-dev' v = '1.66.0-dev'
s.version = v s.version = v
s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.'
s.description = <<-DESC s.description = <<-DESC

@ -22,4 +22,4 @@
// instead. This file can be regenerated from the template by running // instead. This file can be regenerated from the template by running
// `tools/buildgen/generate_projects.sh`. // `tools/buildgen/generate_projects.sh`.
#define GRPC_OBJC_VERSION_STRING @"1.65.0-dev" #define GRPC_OBJC_VERSION_STRING @"1.66.0-dev"

@ -22,5 +22,5 @@
// instead. This file can be regenerated from the template by running // instead. This file can be regenerated from the template by running
// `tools/buildgen/generate_projects.sh`. // `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" #define GRPC_C_VERSION_STRING @"42.0.0"

@ -2,7 +2,7 @@
"name": "grpc/grpc-dev", "name": "grpc/grpc-dev",
"description": "gRPC library for PHP - for Development use only", "description": "gRPC library for PHP - for Development use only",
"license": "Apache-2.0", "license": "Apache-2.0",
"version": "1.65.0", "version": "1.66.0",
"require": { "require": {
"php": ">=7.0.0", "php": ">=7.0.0",
"google/protobuf": "^v3.3.0" "google/protobuf": "^v3.3.0"

@ -20,6 +20,6 @@
#ifndef VERSION_H #ifndef VERSION_H
#define VERSION_H #define VERSION_H
#define PHP_GRPC_VERSION "1.65.0dev" #define PHP_GRPC_VERSION "1.66.0dev"
#endif /* VERSION_H */ #endif /* VERSION_H */

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!! # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!!
__version__ = """1.65.0.dev0""" __version__ = """1.66.0.dev0"""

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!!
VERSION = '1.65.0.dev0' VERSION = '1.66.0.dev0'

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_admin/grpc_version.py.template`!!! # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_admin/grpc_version.py.template`!!!
VERSION = '1.65.0.dev0' VERSION = '1.66.0.dev0'

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!! # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!!
VERSION = '1.65.0.dev0' VERSION = '1.66.0.dev0'

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csds/grpc_version.py.template`!!! # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csds/grpc_version.py.template`!!!
VERSION = '1.65.0.dev0' VERSION = '1.66.0.dev0'

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csm_observability/grpc_version.py.template`!!! # 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'

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! # 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'

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_observability/grpc_version.py.template`!!! # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_observability/grpc_version.py.template`!!!
VERSION = '1.65.0.dev0' VERSION = '1.66.0.dev0'

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!!
VERSION = '1.65.0.dev0' VERSION = '1.66.0.dev0'

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/grpc_version.py.template`!!! # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/grpc_version.py.template`!!!
VERSION = '1.65.0.dev0' VERSION = '1.66.0.dev0'

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!! # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!!
VERSION = '1.65.0.dev0' VERSION = '1.66.0.dev0'

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!!
VERSION = '1.65.0.dev0' VERSION = '1.66.0.dev0'

@ -437,7 +437,7 @@ static int grpc_rb_md_ary_fill_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) {
tmp_str); tmp_str);
return ST_STOP; 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].key = key_slice;
md_ary->metadata[md_ary->count].value = value_slice; md_ary->metadata[md_ary->count].value = value_slice;
md_ary->count += 1; 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); tmp_str);
return ST_STOP; 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].key = key_slice;
md_ary->metadata[md_ary->count].value = value_slice; md_ary->metadata[md_ary->count].value = value_slice;
md_ary->count += 1; md_ary->count += 1;
@ -808,6 +808,12 @@ struct call_run_batch_args {
run_batch_stack* st; 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) { static VALUE grpc_rb_call_run_batch_try(VALUE value_args) {
grpc_rb_fork_unsafe_begin(); grpc_rb_fork_unsafe_begin();
struct call_run_batch_args* args = (struct call_run_batch_args*)value_args; 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); grpc_call_error_detail_of(err), err);
} }
ev = rb_completion_queue_pluck(args->call->queue, tag, 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) { if (!ev.success) {
rb_raise(grpc_rb_eCallError, "call#run_batch failed somehow"); rb_raise(grpc_rb_eCallError, "call#run_batch failed somehow");
} }

@ -123,7 +123,7 @@ static void* run_poll_channels_loop_unblocking_func_wrapper(void* arg);
// Needs to be called under global_connection_polling_mu // Needs to be called under global_connection_polling_mu
static void grpc_rb_channel_watch_connection_state_op_complete( static void grpc_rb_channel_watch_connection_state_op_complete(
watch_state_op* op, int success) { 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.called_back = 1;
op->op.api_callback_args.success = success; op->op.api_callback_args.success = success;
// wake up the watch API call that's waiting on this op // 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. */ /* Avoids destroying a channel twice. */
static void grpc_rb_channel_safe_destroy(bg_watched_channel* bg) { static void grpc_rb_channel_safe_destroy(bg_watched_channel* bg) {
gpr_mu_lock(&global_connection_polling_mu); 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) { if (!bg->channel_destroyed) {
grpc_channel_destroy(bg->channel); grpc_channel_destroy(bg->channel);
bg->channel_destroyed = 1; 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); ch = grpc_channel_create(target_chars, creds, &wrapper->args);
} }
GPR_ASSERT(ch); GRPC_RUBY_ASSERT(ch);
stack.channel = ch; stack.channel = ch;
stack.wrapper = wrapper; stack.wrapper = wrapper;
rb_thread_call_without_gvl( rb_thread_call_without_gvl(
@ -416,7 +416,7 @@ static void grpc_rb_channel_maybe_recreate_channel_after_fork(
if (bg->channel_destroyed) { if (bg->channel_destroyed) {
// There must be one ref at this point, held by the ruby-level channel // There must be one ref at this point, held by the ruby-level channel
// object, drop this one here. // 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, rb_thread_call_without_gvl(channel_safe_destroy_without_gil, bg, NULL,
NULL); NULL);
// re-create C-core channel // 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* target) {
bg_watched_channel* bg = NULL; bg_watched_channel* bg = NULL;
GPR_ASSERT(bg_watched_channel_list_lookup(target)); GRPC_RUBY_ASSERT(bg_watched_channel_list_lookup(target));
GPR_ASSERT(target->channel_destroyed && target->refcount == 0); GRPC_RUBY_ASSERT(target->channel_destroyed && target->refcount == 0);
if (bg_watched_channel_list_head == target) { if (bg_watched_channel_list_head == target) {
bg_watched_channel_list_head = target->next; bg_watched_channel_list_head = target->next;
gpr_free(target); gpr_free(target);
@ -597,7 +597,7 @@ static void bg_watched_channel_list_free_and_remove(
} }
bg = bg->next; bg = bg->next;
} }
GPR_ASSERT(0); GRPC_RUBY_ASSERT(0);
} }
/* Initialize a grpc_rb_channel's "protected grpc_channel" and try to push /* 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; grpc_connectivity_state conn_state;
watch_state_op* op = NULL; watch_state_op* op = NULL;
if (bg->refcount == 0) { if (bg->refcount == 0) {
GPR_ASSERT(bg->channel_destroyed); GRPC_RUBY_ASSERT(bg->channel_destroyed);
bg_watched_channel_list_free_and_remove(bg); bg_watched_channel_list_free_and_remove(bg);
return; return;
} }
GPR_ASSERT(bg->refcount == 1); GRPC_RUBY_ASSERT(bg->refcount == 1);
if (bg->channel_destroyed || g_abort_channel_polling) { if (bg->channel_destroyed || g_abort_channel_polling) {
return; return;
} }
@ -633,7 +633,7 @@ static void grpc_rb_channel_try_register_connection_polling(
if (conn_state == GRPC_CHANNEL_SHUTDOWN) { if (conn_state == GRPC_CHANNEL_SHUTDOWN) {
return; 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 // prevent bg from being free'd by GC while background thread is watching it
bg->refcount++; bg->refcount++;
op = gpr_zalloc(sizeof(watch_state_op)); 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( grpc_rb_channel_watch_connection_state_op_complete(
(watch_state_op*)event.tag, event.success); (watch_state_op*)event.tag, event.success);
} else { } else {
GPR_ASSERT(0); GRPC_RUBY_ASSERT(0);
} }
} }
gpr_mu_unlock(&global_connection_polling_mu); gpr_mu_unlock(&global_connection_polling_mu);
@ -769,9 +769,9 @@ static void do_basic_init() {
*/ */
void grpc_rb_channel_polling_thread_start() { void grpc_rb_channel_polling_thread_start() {
gpr_once_init(&g_once_init, do_basic_init); gpr_once_init(&g_once_init, do_basic_init);
GPR_ASSERT(!RTEST(g_channel_polling_thread)); GRPC_RUBY_ASSERT(!RTEST(g_channel_polling_thread));
GPR_ASSERT(!g_abort_channel_polling); GRPC_RUBY_ASSERT(!g_abort_channel_polling);
GPR_ASSERT(g_channel_polling_cq == NULL); GRPC_RUBY_ASSERT(g_channel_polling_cq == NULL);
g_channel_polling_cq = grpc_completion_queue_create_for_next(NULL); g_channel_polling_cq = grpc_completion_queue_create_for_next(NULL);
g_channel_polling_thread = rb_thread_create(run_poll_channels_loop, NULL); g_channel_polling_thread = rb_thread_create(run_poll_channels_loop, NULL);

@ -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) { void grpc_rb_channel_args_destroy(grpc_channel_args* args) {
GPR_ASSERT(args != NULL); GRPC_RUBY_ASSERT(args != NULL);
if (args->args == NULL) return; if (args->args == NULL) return;
for (int i = 0; i < args->num_args; i++) { for (int i = 0; i < args->num_args; i++) {
// the key was created with gpr_strdup // the key was created with gpr_strdup

@ -35,23 +35,15 @@ typedef struct next_call_stack {
grpc_event event; grpc_event event;
gpr_timespec timeout; gpr_timespec timeout;
void* tag; void* tag;
volatile int interrupted; void (*unblock_func)(void*);
void* unblock_func_arg;
} next_call_stack; } next_call_stack;
/* Calls grpc_completion_queue_pluck without holding the ruby GIL */ /* Calls grpc_completion_queue_pluck without holding the ruby GIL */
static void* grpc_rb_completion_queue_pluck_no_gil(void* param) { static void* grpc_rb_completion_queue_pluck_no_gil(void* param) {
next_call_stack* const next_call = (next_call_stack*)param; next_call_stack* const next_call = (next_call_stack*)param;
gpr_timespec increment = gpr_time_from_millis(20, GPR_TIMESPAN); next_call->event = grpc_completion_queue_pluck(next_call->cq, next_call->tag,
gpr_timespec deadline; next_call->timeout, NULL);
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);
return NULL; return NULL;
} }
@ -65,37 +57,28 @@ void grpc_rb_completion_queue_destroy(grpc_completion_queue* cq) {
grpc_completion_queue_destroy(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_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 /* Does the same thing as grpc_completion_queue_pluck, while properly releasing
the GVL and handling interrupts */ the GVL and handling interrupts */
grpc_event rb_completion_queue_pluck(grpc_completion_queue* queue, void* tag, 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; next_call_stack next_call;
MEMZERO(&next_call, next_call_stack, 1); MEMZERO(&next_call, next_call_stack, 1);
next_call.cq = queue; next_call.cq = queue;
next_call.timeout = deadline; next_call.timeout = deadline;
next_call.tag = tag; next_call.tag = tag;
next_call.event.type = GRPC_QUEUE_TIMEOUT; next_call.event.type = GRPC_QUEUE_TIMEOUT;
(void)reserved; next_call.unblock_func = unblock_func;
/* Loop until we finish a pluck without an interruption. The internal next_call.unblock_func_arg = unblock_func_arg;
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, rb_thread_call_without_gvl(grpc_rb_completion_queue_pluck_no_gil,
(void*)&next_call, unblock_func, (void*)&next_call, outer_unblock_func,
(void*)&next_call); (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);
return next_call.event; return next_call.event;
} }

@ -29,8 +29,14 @@ void grpc_rb_completion_queue_destroy(grpc_completion_queue* cq);
* Makes the implementation of CompletionQueue#pluck available in other files * Makes the implementation of CompletionQueue#pluck available in other files
* *
* This avoids having code that holds the GIL repeated at multiple sites. * 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, 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_ */ #endif /* GRPC_RB_COMPLETION_QUEUE_H_ */

@ -181,7 +181,7 @@ void grpc_rb_compression_options_algorithm_name_to_value_internal(
char* name_slice_str = grpc_slice_to_c_string(name_slice); char* name_slice_str = grpc_slice_to_c_string(name_slice);
char* error_message_str = NULL; char* error_message_str = NULL;
VALUE error_message_ruby_str = Qnil; VALUE error_message_ruby_str = Qnil;
GPR_ASSERT(gpr_asprintf(&error_message_str, GRPC_RUBY_ASSERT(gpr_asprintf(&error_message_str,
"Invalid compression algorithm name: %s", "Invalid compression algorithm name: %s",
name_slice_str) != -1); name_slice_str) != -1);
gpr_free(name_slice_str); gpr_free(name_slice_str);

@ -149,12 +149,12 @@ void grpc_rb_event_queue_thread_start() {
event_queue.head = event_queue.tail = NULL; event_queue.head = event_queue.tail = NULL;
} }
event_queue.abort = false; 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); g_event_thread = rb_thread_create(grpc_rb_event_thread, NULL);
} }
void grpc_rb_event_queue_thread_stop() { 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)) { if (!RTEST(g_event_thread)) {
gpr_log(GPR_ERROR, gpr_log(GPR_ERROR,
"GRPC_RUBY: call credentials thread stop: thread not running"); "GRPC_RUBY: call credentials thread stop: thread not running");

@ -248,12 +248,12 @@ static pid_t g_init_pid;
static long g_init_tid; static long g_init_tid;
static bool grpc_ruby_initial_pid(void) { 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(); return g_init_pid == getpid();
} }
static bool grpc_ruby_initial_thread(void) { 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; 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) { static void grpc_ruby_basic_init(void) {
GPR_ASSERT(g_init_pid == 0); GRPC_RUBY_ASSERT(g_init_pid == 0);
GPR_ASSERT(g_init_tid == 0); GRPC_RUBY_ASSERT(g_init_tid == 0);
grpc_ruby_reset_init_state(); grpc_ruby_reset_init_state();
// TODO(apolcyn): ideally, we should share logic with C-core // TODO(apolcyn): ideally, we should share logic with C-core
// for determining whether or not fork support is enabled, rather // for determining whether or not fork support is enabled, rather

@ -21,6 +21,8 @@
#include <ruby/ruby.h> #include <ruby/ruby.h>
#include <stdlib.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
/* grpc_rb_mGrpcCore is the module containing the ruby wrapper GRPC classes. */ /* 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(); 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_ */ #endif /* GRPC_RB_H_ */

@ -49,23 +49,23 @@ typedef struct grpc_rb_server {
/* The actual server */ /* The actual server */
grpc_server* wrapped; grpc_server* wrapped;
grpc_completion_queue* queue; grpc_completion_queue* queue;
int shutdown_and_notify_done;
int destroy_done; int destroy_done;
} grpc_rb_server; } grpc_rb_server;
static void grpc_rb_server_maybe_shutdown_and_notify(grpc_rb_server* server, static void grpc_rb_server_shutdown_and_notify_internal(grpc_rb_server* server,
gpr_timespec deadline) { gpr_timespec deadline) {
grpc_event ev; grpc_event ev;
void* tag = &ev; void* tag = &ev;
if (!server->shutdown_and_notify_done) {
server->shutdown_and_notify_done = 1;
if (server->wrapped != NULL) { if (server->wrapped != NULL) {
grpc_server_shutdown_and_notify(server->wrapped, server->queue, tag); grpc_server_shutdown_and_notify(server->wrapped, server->queue, tag);
ev = rb_completion_queue_pluck(server->queue, tag, deadline, NULL); // 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) { if (ev.type == GRPC_QUEUE_TIMEOUT) {
grpc_server_cancel_all_calls(server->wrapped); grpc_server_cancel_all_calls(server->wrapped);
ev = rb_completion_queue_pluck( ev = rb_completion_queue_pluck(
server->queue, tag, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); server->queue, tag, gpr_inf_future(GPR_CLOCK_REALTIME), NULL, NULL);
} }
if (ev.type != GRPC_OP_COMPLETE) { if (ev.type != GRPC_OP_COMPLETE) {
gpr_log(GPR_INFO, gpr_log(GPR_INFO,
@ -74,7 +74,6 @@ static void grpc_rb_server_maybe_shutdown_and_notify(grpc_rb_server* server,
} }
} }
} }
}
static void grpc_rb_server_maybe_destroy(grpc_rb_server* server) { static void grpc_rb_server_maybe_destroy(grpc_rb_server* server) {
// This can be started by app or implicitly by GC. Avoid a race between these. // This can be started by app or implicitly by GC. Avoid a race between these.
@ -100,7 +99,7 @@ static void grpc_rb_server_free_internal(void* p) {
deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_seconds(2, GPR_TIMESPAN)); 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); grpc_rb_server_maybe_destroy(svr);
xfree(p); xfree(p);
@ -132,7 +131,6 @@ static VALUE grpc_rb_server_alloc(VALUE cls) {
grpc_rb_server* wrapper = ALLOC(grpc_rb_server); grpc_rb_server* wrapper = ALLOC(grpc_rb_server);
wrapper->wrapped = NULL; wrapper->wrapped = NULL;
wrapper->destroy_done = 0; wrapper->destroy_done = 0;
wrapper->shutdown_and_notify_done = 0;
return TypedData_Wrap_Struct(cls, &grpc_rb_server_data_type, wrapper); return TypedData_Wrap_Struct(cls, &grpc_rb_server_data_type, wrapper);
} }
@ -192,6 +190,24 @@ struct server_request_call_args {
request_call_stack st; 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) { static VALUE grpc_rb_server_request_call_try(VALUE value_args) {
grpc_rb_fork_unsafe_begin(); grpc_rb_fork_unsafe_begin();
struct server_request_call_args* args = 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( 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) { if (!ev.success) {
rb_raise(grpc_rb_eCallError, "request_call completion failed"); 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); 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; return Qnil;
} }

@ -14,5 +14,5 @@
# GRPC contains the General RPC module. # GRPC contains the General RPC module.
module GRPC module GRPC
VERSION = '1.65.0.dev' VERSION = '1.66.0.dev'
end end

@ -14,6 +14,6 @@
module GRPC module GRPC
module NativeDebug module NativeDebug
VERSION = '1.65.0.dev' VERSION = '1.66.0.dev'
end end
end end

@ -14,6 +14,6 @@
module GRPC module GRPC
module Tools module Tools
VERSION = '1.65.0.dev' VERSION = '1.66.0.dev'
end end
end end

@ -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. # but since our python2 usage is deprecated, we should get rid of it.
RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && \ RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && \
python3 -m pip install --upgrade pip==19.3.1 && \ python3 -m pip install --upgrade pip==19.3.1 && \
python3 -m pip install six==1.16.0 && \ 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"
<%include file="./gcp_api_libraries_venv.include"/> <%include file="./gcp_api_libraries_venv.include"/>

@ -588,7 +588,7 @@ class ClientLbEnd2endTest : public ::testing::Test {
"(Failed to connect to remote host: )?" "(Failed to connect to remote host: )?"
"(Timeout occurred: )?" "(Timeout occurred: )?"
// Syscall // Syscall
"((connect|recvmsg|getsockopt\\(SO\\_ERROR\\)): )?" "((connect|recvmsg|getsockopt\\(SO\\_ERROR\\)): ?)?"
// strerror() output or other message // strerror() output or other message
"(Connection refused" "(Connection refused"
"|Connection reset by peer" "|Connection reset by peer"

@ -844,7 +844,7 @@ std::string XdsEnd2endTest::MakeConnectionFailureRegex(
"(Failed to connect to remote host: )?" "(Failed to connect to remote host: )?"
"(Timeout occurred: )?" "(Timeout occurred: )?"
// Syscall // Syscall
"((connect|recvmsg|getsockopt\\(SO\\_ERROR\\)): )?" "((connect|recvmsg|getsockopt\\(SO\\_ERROR\\)): ?)?"
// strerror() output or other message // strerror() output or other message
"(Connection refused" "(Connection refused"
"|Connection reset by peer" "|Connection reset by peer"

@ -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.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.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.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_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_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", "tools/dockerfile/interoptest/grpc_interop_node.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_node@sha256:549a7683cc024fb7ffee807eaa8acb6c2d5a5dd0184a2590f91852804eea39a4",

@ -14,5 +14,5 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! # 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' PROTOBUF_VERSION = '3.26.1'

@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_tools/grpc_version.py.template`!!! # 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'

@ -14,5 +14,5 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! # 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' PROTOBUF_VERSION = '3.26.1'

@ -14,5 +14,5 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! # 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' PROTOBUF_VERSION = '3.26.1'

@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.x:9740f2234d8c996def3f0e09791328c39dac0ab1@sha256:c1d1babd31ea7e635aa68d56803212f9e0091ff628288c18dc86d890f837303a us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.x:9a524415365a73162b7f463bf0409ca04f64a73c@sha256:9d02b61552a93770ebb022f588daf9acd1088d29197fe120e0b082ede73f4584

@ -43,8 +43,7 @@ RUN echo "source $PYTHON_ENV/bin/activate" >> ~/.bashrc
# use pinned version of pip to avoid sudden breakages # use pinned version of pip to avoid sudden breakages
# TODO(#36814): currently six is needed for tools/run_tests scripts # TODO(#36814): currently six is needed for tools/run_tests scripts
# but since our python2 usage is deprecated, we should get rid of it. # 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 # Install Google Cloud Platform API libraries
# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts)

@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++"
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # 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 # 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 # for a project that appears at the top of each page and should give viewer a

@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++"
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # 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 # 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 # for a project that appears at the top of each page and should give viewer a

@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Objective-C"
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # 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 # 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 # for a project that appears at the top of each page and should give viewer a

@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Objective-C"
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # 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 # 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 # for a project that appears at the top of each page and should give viewer a

@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC PHP"
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # 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 # 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 # for a project that appears at the top of each page and should give viewer a

Loading…
Cancel
Save