diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 3fb085a6a4..9f5e0a1b99 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.64.0-pre1' + version = '1.64.0-pre2' s.version = version s.summary = 'gRPC C++ library' s.homepage = 'https://grpc.io' diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 26c3ac5a21..e0191c9774 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.64.0-pre1' + version = '1.64.0-pre2' 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 1aa3bcf366..2b12d1bcc7 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.64.0-pre1' + version = '1.64.0-pre2' 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 f7c6b1dc5c..a9183cb795 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.64.0-pre1' + version = '1.64.0-pre2' 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 0e8e3fe3f6..3dbab93388 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.64.0-pre1' + version = '1.64.0-pre2' 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 9e6a9e11c5..1e4f05a76a 100644 --- a/include/grpcpp/version_info.h +++ b/include/grpcpp/version_info.h @@ -21,7 +21,7 @@ #define GRPC_CPP_VERSION_MAJOR 1 #define GRPC_CPP_VERSION_MINOR 64 #define GRPC_CPP_VERSION_PATCH 0 -#define GRPC_CPP_VERSION_TAG "pre1" -#define GRPC_CPP_VERSION_STRING "1.64.0-pre1" +#define GRPC_CPP_VERSION_TAG "pre2" +#define GRPC_CPP_VERSION_STRING "1.64.0-pre2" #endif // GRPCPP_VERSION_INFO_H diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 9a28649dd5..05b15007da 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -143,6 +143,8 @@ static bool g_default_server_keepalive_permit_without_calls = false; #define MAX_CLIENT_STREAM_ID 0x7fffffffu grpc_core::TraceFlag grpc_keepalive_trace(false, "http_keepalive"); +grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount(false, + "chttp2_refcount"); // forward declarations of various callbacks that we'll build closures around static void write_action_begin_locked( @@ -593,7 +595,12 @@ static void init_keepalive_pings_if_enabled_locked( grpc_chttp2_transport::grpc_chttp2_transport( const grpc_core::ChannelArgs& channel_args, grpc_endpoint* ep, bool is_client) - : ep(ep), + : grpc_core::RefCounted( + GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_refcount) + ? "chttp2_refcount" + : nullptr), + ep(ep), peer_string( grpc_core::Slice::FromCopiedString(grpc_endpoint_get_peer(ep))), memory_owner(channel_args.GetObject() diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 058928a596..4714d4c737 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -223,19 +223,17 @@ typedef enum { GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED, } grpc_chttp2_keepalive_state; -struct grpc_chttp2_transport final : public grpc_core::FilterStackTransport, - public grpc_core::KeepsGrpcInitialized { +struct grpc_chttp2_transport final + : public grpc_core::FilterStackTransport, + public grpc_core::RefCounted, + public grpc_core::KeepsGrpcInitialized { grpc_chttp2_transport(const grpc_core::ChannelArgs& channel_args, grpc_endpoint* ep, bool is_client); ~grpc_chttp2_transport() override; void Orphan() override; - grpc_core::RefCountedPtr Ref() { - return grpc_core::FilterStackTransport::RefAsSubclass< - grpc_chttp2_transport>(); - } - size_t SizeOfStream() const override; bool HackyDisableStreamOpBatchCoalescingInConnectedChannel() const override; void PerformStreamOp(grpc_stream* gs, diff --git a/src/core/ext/transport/inproc/inproc_transport.cc b/src/core/ext/transport/inproc/inproc_transport.cc index 7dd316bfca..9a663bde66 100644 --- a/src/core/ext/transport/inproc/inproc_transport.cc +++ b/src/core/ext/transport/inproc/inproc_transport.cc @@ -35,9 +35,8 @@ namespace grpc_core { namespace { -class InprocClientTransport; - -class InprocServerTransport final : public ServerTransport { +class InprocServerTransport final : public RefCounted, + public ServerTransport { public: void SetAcceptor(Acceptor* acceptor) override { acceptor_ = acceptor; @@ -98,8 +97,6 @@ class InprocServerTransport final : public ServerTransport { return acceptor_->CreateCall(std::move(md), acceptor_->CreateArena()); } - OrphanablePtr MakeClientTransport(); - private: enum class ConnectionState : uint8_t { kInitial, kReady, kDisconnected }; @@ -114,10 +111,6 @@ class InprocServerTransport final : public ServerTransport { class InprocClientTransport final : public ClientTransport { public: - explicit InprocClientTransport( - RefCountedPtr server_transport) - : server_transport_(std::move(server_transport)) {} - void StartCall(CallHandler call_handler) override { call_handler.SpawnGuarded( "pull_initial_metadata", @@ -134,6 +127,10 @@ class InprocClientTransport final : public ClientTransport { void Orphan() override { delete this; } + OrphanablePtr GetServerTransport() { + return OrphanablePtr(server_transport_->Ref().release()); + } + FilterStackTransport* filter_stack_transport() override { return nullptr; } ClientTransport* client_transport() override { return this; } ServerTransport* server_transport() override { return nullptr; } @@ -149,7 +146,8 @@ class InprocClientTransport final : public ClientTransport { absl::UnavailableError("Client transport closed")); } - const RefCountedPtr server_transport_; + RefCountedPtr server_transport_ = + MakeRefCounted(); }; bool UsePromiseBasedTransport() { @@ -159,12 +157,6 @@ bool UsePromiseBasedTransport() { return true; } -OrphanablePtr -InprocServerTransport::MakeClientTransport() { - return MakeOrphanable( - RefAsSubclass()); -} - OrphanablePtr MakeLameChannel(absl::string_view why, absl::Status error) { gpr_log(GPR_ERROR, "%s: %s", std::string(why).c_str(), @@ -206,8 +198,8 @@ OrphanablePtr MakeInprocChannel(Server* server, std::pair, OrphanablePtr> MakeInProcessTransportPair() { - auto server_transport = MakeOrphanable(); - auto client_transport = server_transport->MakeClientTransport(); + auto client_transport = MakeOrphanable(); + auto server_transport = client_transport->GetServerTransport(); return std::make_pair(std::move(client_transport), std::move(server_transport)); } diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h index 65f57fdd47..fe7f72ef1e 100644 --- a/src/core/lib/transport/transport.h +++ b/src/core/lib/transport/transport.h @@ -502,7 +502,7 @@ class FilterStackTransport; class ClientTransport; class ServerTransport; -class Transport : public InternallyRefCounted { +class Transport : public Orphanable { public: struct RawPointerChannelArgTag {}; static absl::string_view ChannelArgName() { return GRPC_ARG_TRANSPORT; } diff --git a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec index 39c20ab627..3b653e6ce8 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.64.0-pre1' + v = '1.64.0-pre2' 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 ccf8e188e8..3b74b297b2 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.64.0-pre1' + v = '1.64.0-pre2' 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 8ad8026141..e6d321b8c1 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.64.0-pre1" +#define GRPC_OBJC_VERSION_STRING @"1.64.0-pre2"