!39 update grpc to 1.41.1

From: @haochenstar 
Reviewed-by: @wangxp006 
Signed-off-by: @wangxp006
This commit is contained in:
openeuler-ci-bot 2022-03-29 09:17:33 +00:00 committed by Gitee
commit c8f401e881
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
12 changed files with 65 additions and 776 deletions

View File

@ -1,91 +0,0 @@
From bf87ec9e442d554bf1bc5874c1db9607e59899e3 Mon Sep 17 00:00:00 2001
From: Esun Kim <veblush@google.com>
Date: Wed, 19 Aug 2020 18:17:39 -0700
Subject: [PATCH] Add ABSL_RANDOM_HWAES_FLAGS
diff --git a/Makefile b/Makefile
index 9fc06b0edf..d22d4bab72 100644
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,13 @@ ifeq ($(SYSTEM),MINGW64)
SYSTEM = MINGW32
endif
+# Basic machine detection
+HOST_MACHINE = $(shell uname -m)
+ifeq ($(HOST_MACHINE),x86_64)
+HOST_IS_X86_64 = true
+else
+HOST_IS_X86_64 = false
+endif
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
ifndef BUILDDIR
@@ -696,6 +703,11 @@ CPPFLAGS := -Ithird_party/address_sorting/include $(CPPFLAGS)
GRPC_ABSEIL_DEP = $(LIBDIR)/$(CONFIG)/libgrpc_abseil.a
GRPC_ABSEIL_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libgrpc_abseil.a
+ifeq ($(HOST_IS_X86_64),true)
+ABSL_RANDOM_HWAES_FLAGS = -maes -msse4
+else
+ABSL_RANDOM_HWAES_FLAGS =
+endif
RE2_DEP = $(LIBDIR)/$(CONFIG)/libre2.a
RE2_MERGE_OBJS = $(LIBRE2_OBJS)
@@ -4508,7 +4520,7 @@ LIBGRPC_ABSEIL_SRC = \
LIBGRPC_ABSEIL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC_ABSEIL_SRC))))
-$(LIBGRPC_ABSEIL_OBJS): CPPFLAGS += -g -maes -msse4 -Ithird_party/abseil-cpp
+$(LIBGRPC_ABSEIL_OBJS): CPPFLAGS += -g $(ABSL_RANDOM_HWAES_FLAGS) -Ithird_party/abseil-cpp
$(LIBDIR)/$(CONFIG)/libgrpc_abseil.a: $(LIBGRPC_ABSEIL_OBJS)
$(E) "[AR] Creating $@"
diff --git a/build_handwritten.yaml b/build_handwritten.yaml
index 26e1af3360..63451d14c3 100644
--- a/build_handwritten.yaml
+++ b/build_handwritten.yaml
@@ -196,7 +196,7 @@ configs:
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt
defaults:
abseil:
- CPPFLAGS: -g -maes -msse4 -Ithird_party/abseil-cpp
+ CPPFLAGS: -g $(ABSL_RANDOM_HWAES_FLAGS) -Ithird_party/abseil-cpp
ares:
CFLAGS: -g
CPPFLAGS: -Ithird_party/cares -Ithird_party/cares/cares -fvisibility=hidden -D_GNU_SOURCE
diff --git a/templates/Makefile.template b/templates/Makefile.template
index 897291ba14..581367e0a6 100644
--- a/templates/Makefile.template
+++ b/templates/Makefile.template
@@ -82,6 +82,13 @@
SYSTEM = MINGW32
endif
+ # Basic machine detection
+ HOST_MACHINE = $(shell uname -m)
+ ifeq ($(HOST_MACHINE),x86_64)
+ HOST_IS_X86_64 = true
+ else
+ HOST_IS_X86_64 = false
+ endif
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
ifndef BUILDDIR
@@ -567,6 +574,11 @@
GRPC_ABSEIL_DEP = $(LIBDIR)/$(CONFIG)/libgrpc_abseil.a
GRPC_ABSEIL_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libgrpc_abseil.a
+ ifeq ($(HOST_IS_X86_64),true)
+ ABSL_RANDOM_HWAES_FLAGS = -maes -msse4
+ else
+ ABSL_RANDOM_HWAES_FLAGS =
+ endif
RE2_DEP = $(LIBDIR)/$(CONFIG)/libre2.a
RE2_MERGE_OBJS = $(LIBRE2_OBJS)
--
2.23.0

View File

@ -1,107 +0,0 @@
From b65daaa52d2e24dadff465a2a84c0e8220282047 Mon Sep 17 00:00:00 2001
From: Alexander Polcyn <apolcyn@google.com>
Date: Thu, 13 Aug 2020 00:12:55 -0700
Subject: [PATCH] Copy channel args hash before appending ruby user agent
---
src/ruby/lib/grpc/generic/client_stub.rb | 2 +-
src/ruby/spec/user_agent_spec.rb | 74 ++++++++++++++++++++++++
2 files changed, 75 insertions(+), 1 deletion(-)
create mode 100644 src/ruby/spec/user_agent_spec.rb
diff --git a/src/ruby/lib/grpc/generic/client_stub.rb b/src/ruby/lib/grpc/generic/client_stub.rb
index b193f5c4e1..1884dcba24 100644
--- a/src/ruby/lib/grpc/generic/client_stub.rb
+++ b/src/ruby/lib/grpc/generic/client_stub.rb
@@ -100,7 +100,7 @@ module GRPC
channel_args: {},
interceptors: [])
@ch = ClientStub.setup_channel(channel_override, host, creds,
- channel_args)
+ channel_args.dup)
alt_host = channel_args[Core::Channel::SSL_TARGET]
@host = alt_host.nil? ? host : alt_host
@propagate_mask = propagate_mask
diff --git a/src/ruby/spec/user_agent_spec.rb b/src/ruby/spec/user_agent_spec.rb
new file mode 100644
index 0000000000..a5aa2066db
--- /dev/null
+++ b/src/ruby/spec/user_agent_spec.rb
@@ -0,0 +1,74 @@
+# Copyright 2020 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+require 'spec_helper'
+
+# a test service that checks the cert of its peer
+class UserAgentEchoService
+ include GRPC::GenericService
+ rpc :an_rpc, EchoMsg, EchoMsg
+
+ def an_rpc(_req, call)
+ EchoMsg.new(msg: call.metadata['user-agent'])
+ end
+end
+
+UserAgentEchoServiceStub = UserAgentEchoService.rpc_stub_class
+
+describe 'user agent' do
+ RpcServer = GRPC::RpcServer
+
+ before(:all) do
+ server_opts = {
+ poll_period: 1
+ }
+ @srv = new_rpc_server_for_testing(**server_opts)
+ @port = @srv.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
+ @srv.handle(UserAgentEchoService)
+ @srv_thd = Thread.new { @srv.run }
+ @srv.wait_till_running
+ end
+
+ after(:all) do
+ expect(@srv.stopped?).to be(false)
+ @srv.stop
+ @srv_thd.join
+ end
+
+ it 'client sends expected user agent' do
+ stub = UserAgentEchoServiceStub.new("localhost:#{@port}",
+ :this_channel_is_insecure,
+ {})
+ response = stub.an_rpc(EchoMsg.new)
+ expected_user_agent_prefix = "grpc-ruby/#{GRPC::VERSION}"
+ expect(response.msg.start_with?(expected_user_agent_prefix)).to be true
+ # check that the expected user agent prefix occurs in the real user agent exactly once
+ expect(response.msg.split(expected_user_agent_prefix).size).to eq 2
+ end
+
+ it 'user agent header does not grow when the same channel args hash is used across multiple stubs' do
+ shared_channel_args_hash = {}
+ 10.times do
+ stub = UserAgentEchoServiceStub.new("localhost:#{@port}",
+ :this_channel_is_insecure,
+ channel_args: shared_channel_args_hash)
+ response = stub.an_rpc(EchoMsg.new)
+ puts "got echo response: #{response.msg}"
+ expected_user_agent_prefix = "grpc-ruby/#{GRPC::VERSION}"
+ expect(response.msg.start_with?(expected_user_agent_prefix)).to be true
+ # check that the expected user agent prefix occurs in the real user agent exactly once
+ expect(response.msg.split(expected_user_agent_prefix).size).to eq 2
+ end
+ end
+end
--
2.23.0

View File

@ -1,34 +0,0 @@
From 590dfe7db024bea1e39b2c0e367e52b631936f7a Mon Sep 17 00:00:00 2001
From: Vijay Pai <vpai@google.com>
Date: Tue, 18 Aug 2020 00:53:09 -0700
Subject: [PATCH] Fix destruction race between subchannel and client_channel
diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc
index 15a39b2388..1b8f2cb1df 100644
--- a/src/core/ext/filters/client_channel/client_channel.cc
+++ b/src/core/ext/filters/client_channel/client_channel.cc
@@ -2176,13 +2176,14 @@ void CallData::Destroy(grpc_call_element* elem,
const grpc_call_final_info* /*final_info*/,
grpc_closure* then_schedule_closure) {
CallData* calld = static_cast<CallData*>(elem->call_data);
- if (GPR_LIKELY(calld->subchannel_call_ != nullptr)) {
- calld->subchannel_call_->SetAfterCallStackDestroy(then_schedule_closure);
- then_schedule_closure = nullptr;
- }
+ RefCountedPtr<SubchannelCall> subchannel_call = calld->subchannel_call_;
calld->~CallData();
- // TODO(yashkt) : This can potentially be a Closure::Run
- ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
+ if (GPR_LIKELY(subchannel_call != nullptr)) {
+ subchannel_call->SetAfterCallStackDestroy(then_schedule_closure);
+ } else {
+ // TODO(yashkt) : This can potentially be a Closure::Run
+ ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
+ }
}
void CallData::StartTransportStreamOpBatch(
--
2.23.0

View File

@ -1,54 +0,0 @@
From dc9c5ce77feab8ae01e16d7a3c13cd071c46926a Mon Sep 17 00:00:00 2001
From: Vijay Pai <vpai@google.com>
Date: Tue, 18 Aug 2020 00:56:48 -0700
Subject: [PATCH] Fix use-after-free by removing stream from transport list on
destroy_stream
diff --git a/src/core/ext/transport/inproc/inproc_transport.cc b/src/core/ext/transport/inproc/inproc_transport.cc
index 4cf9e900a4..db9a0aff18 100644
--- a/src/core/ext/transport/inproc/inproc_transport.cc
+++ b/src/core/ext/transport/inproc/inproc_transport.cc
@@ -202,11 +202,6 @@ struct inproc_stream {
}
t->unref();
-
- if (closure_at_destroy) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure_at_destroy,
- GRPC_ERROR_NONE);
- }
}
#ifndef NDEBUG
@@ -249,7 +244,6 @@ struct inproc_stream {
bool other_side_closed = false; // won't talk anymore
bool write_buffer_other_side_closed = false; // on hold
grpc_stream_refcount* refs;
- grpc_closure* closure_at_destroy = nullptr;
grpc_core::Arena* arena;
@@ -1183,12 +1177,17 @@ void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
gpr_mu_unlock(&t->mu->mu);
}
-void destroy_stream(grpc_transport* /*gt*/, grpc_stream* gs,
+void destroy_stream(grpc_transport* gt, grpc_stream* gs,
grpc_closure* then_schedule_closure) {
INPROC_LOG(GPR_INFO, "destroy_stream %p %p", gs, then_schedule_closure);
+ inproc_transport* t = reinterpret_cast<inproc_transport*>(gt);
inproc_stream* s = reinterpret_cast<inproc_stream*>(gs);
- s->closure_at_destroy = then_schedule_closure;
+ gpr_mu_lock(&t->mu->mu);
+ close_stream_locked(s);
+ gpr_mu_unlock(&t->mu->mu);
s->~inproc_stream();
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure,
+ GRPC_ERROR_NONE);
}
void destroy_transport(grpc_transport* gt) {
--
2.23.0

View File

@ -1,274 +0,0 @@
From 0894f21c2fa7cc281bc584c0e08cbbbad1d04b28 Mon Sep 17 00:00:00 2001
From: Stanley Cheung <stanleycheung@google.com>
Date: Thu, 13 Aug 2020 23:00:32 -0700
Subject: [PATCH] Ran generate_proto_ruby.sh to update generated files
---
src/ruby/bin/math_services_pb.rb | 8 ++--
.../pb/grpc/health/v1/health_services_pb.rb | 4 +-
.../pb/src/proto/grpc/testing/messages_pb.rb | 5 +++
.../proto/grpc/testing/test_services_pb.rb | 40 +++++++++++++------
.../testing/benchmark_service_services_pb.rb | 10 ++---
.../qps/src/proto/grpc/testing/messages_pb.rb | 5 +++
...report_qps_scenario_service_services_pb.rb | 2 +-
.../testing/worker_service_services_pb.rb | 8 ++--
8 files changed, 54 insertions(+), 28 deletions(-)
diff --git a/src/ruby/bin/math_services_pb.rb b/src/ruby/bin/math_services_pb.rb
index e6f32e3d01..961117ccfa 100644
--- a/src/ruby/bin/math_services_pb.rb
+++ b/src/ruby/bin/math_services_pb.rb
@@ -31,19 +31,19 @@ module Math
# Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient
# and remainder.
- rpc :Div, DivArgs, DivReply
+ rpc :Div, ::Math::DivArgs, ::Math::DivReply
# DivMany accepts an arbitrary number of division args from the client stream
# and sends back the results in the reply stream. The stream continues until
# the client closes its end; the server does the same after sending all the
# replies. The stream ends immediately if either end aborts.
- rpc :DivMany, stream(DivArgs), stream(DivReply)
+ rpc :DivMany, stream(::Math::DivArgs), stream(::Math::DivReply)
# Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib
# generates up to limit numbers; otherwise it continues until the call is
# canceled. Unlike Fib above, Fib has no final FibReply.
- rpc :Fib, FibArgs, stream(Num)
+ rpc :Fib, ::Math::FibArgs, stream(::Math::Num)
# Sum sums a stream of numbers, returning the final result once the stream
# is closed.
- rpc :Sum, stream(Num), Num
+ rpc :Sum, stream(::Math::Num), ::Math::Num
end
Stub = Service.rpc_stub_class
diff --git a/src/ruby/pb/grpc/health/v1/health_services_pb.rb b/src/ruby/pb/grpc/health/v1/health_services_pb.rb
index 5992f1c403..351e7e150a 100644
--- a/src/ruby/pb/grpc/health/v1/health_services_pb.rb
+++ b/src/ruby/pb/grpc/health/v1/health_services_pb.rb
@@ -36,7 +36,7 @@ module Grpc
# If the requested service is unknown, the call will fail with status
# NOT_FOUND.
- rpc :Check, HealthCheckRequest, HealthCheckResponse
+ rpc :Check, ::Grpc::Health::V1::HealthCheckRequest, ::Grpc::Health::V1::HealthCheckResponse
# Performs a watch for the serving status of the requested service.
# The server will immediately send back a message indicating the current
# serving status. It will then subsequently send a new message whenever
@@ -52,7 +52,7 @@ module Grpc
# should assume this method is not supported and should not retry the
# call. If the call terminates with any other status (including OK),
# clients should retry the call with appropriate exponential backoff.
- rpc :Watch, HealthCheckRequest, stream(HealthCheckResponse)
+ rpc :Watch, ::Grpc::Health::V1::HealthCheckRequest, stream(::Grpc::Health::V1::HealthCheckResponse)
end
Stub = Service.rpc_stub_class
diff --git a/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb b/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb
index f492ccfa67..d902ae0e73 100644
--- a/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb
+++ b/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb
@@ -71,6 +71,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "grpc.testing.LoadBalancerStatsResponse" do
map :rpcs_by_peer, :string, :int32, 1
optional :num_failures, :int32, 2
+ map :rpcs_by_method, :string, :message, 3, "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer"
+ end
+ add_message "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer" do
+ map :rpcs_by_peer, :string, :int32, 1
end
add_enum "grpc.testing.PayloadType" do
value :COMPRESSABLE, 0
@@ -99,6 +103,7 @@ module Grpc
ReconnectInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass
LoadBalancerStatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsRequest").msgclass
LoadBalancerStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse").msgclass
+ LoadBalancerStatsResponse::RpcsByPeer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse.RpcsByPeer").msgclass
PayloadType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule
GrpclbRouteType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GrpclbRouteType").enummodule
end
diff --git a/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb b/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb
index 8138bd0114..115acd0dca 100644
--- a/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb
+++ b/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb
@@ -36,31 +36,31 @@ module Grpc
self.service_name = 'grpc.testing.TestService'
# One empty request followed by one empty response.
- rpc :EmptyCall, Empty, Empty
+ rpc :EmptyCall, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
# One request followed by one response.
- rpc :UnaryCall, SimpleRequest, SimpleResponse
+ rpc :UnaryCall, ::Grpc::Testing::SimpleRequest, ::Grpc::Testing::SimpleResponse
# One request followed by one response. Response has cache control
# headers set such that a caching HTTP proxy (such as GFE) can
# satisfy subsequent requests.
- rpc :CacheableUnaryCall, SimpleRequest, SimpleResponse
+ rpc :CacheableUnaryCall, ::Grpc::Testing::SimpleRequest, ::Grpc::Testing::SimpleResponse
# One request followed by a sequence of responses (streamed download).
# The server returns the payload with client desired type and sizes.
- rpc :StreamingOutputCall, StreamingOutputCallRequest, stream(StreamingOutputCallResponse)
+ rpc :StreamingOutputCall, ::Grpc::Testing::StreamingOutputCallRequest, stream(::Grpc::Testing::StreamingOutputCallResponse)
# A sequence of requests followed by one response (streamed upload).
# The server returns the aggregated size of client payload as the result.
- rpc :StreamingInputCall, stream(StreamingInputCallRequest), StreamingInputCallResponse
+ rpc :StreamingInputCall, stream(::Grpc::Testing::StreamingInputCallRequest), ::Grpc::Testing::StreamingInputCallResponse
# A sequence of requests with each request served by the server immediately.
# As one request could lead to multiple responses, this interface
# demonstrates the idea of full duplexing.
- rpc :FullDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse)
+ rpc :FullDuplexCall, stream(::Grpc::Testing::StreamingOutputCallRequest), stream(::Grpc::Testing::StreamingOutputCallResponse)
# A sequence of requests followed by a sequence of responses.
# The server buffers all the client requests and then serves them in order. A
# stream of responses are returned to the client when the server starts with
# first request.
- rpc :HalfDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse)
+ rpc :HalfDuplexCall, stream(::Grpc::Testing::StreamingOutputCallRequest), stream(::Grpc::Testing::StreamingOutputCallResponse)
# The test server will not implement this method. It will be used
# to test the behavior when clients call unimplemented methods.
- rpc :UnimplementedCall, Empty, Empty
+ rpc :UnimplementedCall, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
end
Stub = Service.rpc_stub_class
@@ -77,7 +77,7 @@ module Grpc
self.service_name = 'grpc.testing.UnimplementedService'
# A call that no server should implement
- rpc :UnimplementedCall, Empty, Empty
+ rpc :UnimplementedCall, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
end
Stub = Service.rpc_stub_class
@@ -92,8 +92,8 @@ module Grpc
self.unmarshal_class_method = :decode
self.service_name = 'grpc.testing.ReconnectService'
- rpc :Start, ReconnectParams, Empty
- rpc :Stop, Empty, ReconnectInfo
+ rpc :Start, ::Grpc::Testing::ReconnectParams, ::Grpc::Testing::Empty
+ rpc :Stop, ::Grpc::Testing::Empty, ::Grpc::Testing::ReconnectInfo
end
Stub = Service.rpc_stub_class
@@ -109,7 +109,23 @@ module Grpc
self.service_name = 'grpc.testing.LoadBalancerStatsService'
# Gets the backend distribution for RPCs sent by a test client.
- rpc :GetClientStats, LoadBalancerStatsRequest, LoadBalancerStatsResponse
+ rpc :GetClientStats, ::Grpc::Testing::LoadBalancerStatsRequest, ::Grpc::Testing::LoadBalancerStatsResponse
+ end
+
+ Stub = Service.rpc_stub_class
+ end
+ module XdsUpdateHealthService
+ # A service to remotely control health status of an xDS test server.
+ class Service
+
+ include GRPC::GenericService
+
+ self.marshal_class_method = :encode
+ self.unmarshal_class_method = :decode
+ self.service_name = 'grpc.testing.XdsUpdateHealthService'
+
+ rpc :SetServing, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
+ rpc :SetNotServing, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
end
Stub = Service.rpc_stub_class
diff --git a/src/ruby/qps/src/proto/grpc/testing/benchmark_service_services_pb.rb b/src/ruby/qps/src/proto/grpc/testing/benchmark_service_services_pb.rb
index 65e5a75c4d..63e2d5d20f 100644
--- a/src/ruby/qps/src/proto/grpc/testing/benchmark_service_services_pb.rb
+++ b/src/ruby/qps/src/proto/grpc/testing/benchmark_service_services_pb.rb
@@ -34,20 +34,20 @@ module Grpc
# One request followed by one response.
# The server returns the client payload as-is.
- rpc :UnaryCall, SimpleRequest, SimpleResponse
+ rpc :UnaryCall, ::Grpc::Testing::SimpleRequest, ::Grpc::Testing::SimpleResponse
# Repeated sequence of one request followed by one response.
# Should be called streaming ping-pong
# The server returns the client payload as-is on each response
- rpc :StreamingCall, stream(SimpleRequest), stream(SimpleResponse)
+ rpc :StreamingCall, stream(::Grpc::Testing::SimpleRequest), stream(::Grpc::Testing::SimpleResponse)
# Single-sided unbounded streaming from client to server
# The server returns the client payload as-is once the client does WritesDone
- rpc :StreamingFromClient, stream(SimpleRequest), SimpleResponse
+ rpc :StreamingFromClient, stream(::Grpc::Testing::SimpleRequest), ::Grpc::Testing::SimpleResponse
# Single-sided unbounded streaming from server to client
# The server repeatedly returns the client payload as-is
- rpc :StreamingFromServer, SimpleRequest, stream(SimpleResponse)
+ rpc :StreamingFromServer, ::Grpc::Testing::SimpleRequest, stream(::Grpc::Testing::SimpleResponse)
# Two-sided unbounded streaming between server to client
# Both sides send the content of their own choice to the other
- rpc :StreamingBothWays, stream(SimpleRequest), stream(SimpleResponse)
+ rpc :StreamingBothWays, stream(::Grpc::Testing::SimpleRequest), stream(::Grpc::Testing::SimpleResponse)
end
Stub = Service.rpc_stub_class
diff --git a/src/ruby/qps/src/proto/grpc/testing/messages_pb.rb b/src/ruby/qps/src/proto/grpc/testing/messages_pb.rb
index f492ccfa67..d902ae0e73 100644
--- a/src/ruby/qps/src/proto/grpc/testing/messages_pb.rb
+++ b/src/ruby/qps/src/proto/grpc/testing/messages_pb.rb
@@ -71,6 +71,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "grpc.testing.LoadBalancerStatsResponse" do
map :rpcs_by_peer, :string, :int32, 1
optional :num_failures, :int32, 2
+ map :rpcs_by_method, :string, :message, 3, "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer"
+ end
+ add_message "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer" do
+ map :rpcs_by_peer, :string, :int32, 1
end
add_enum "grpc.testing.PayloadType" do
value :COMPRESSABLE, 0
@@ -99,6 +103,7 @@ module Grpc
ReconnectInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass
LoadBalancerStatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsRequest").msgclass
LoadBalancerStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse").msgclass
+ LoadBalancerStatsResponse::RpcsByPeer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse.RpcsByPeer").msgclass
PayloadType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule
GrpclbRouteType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GrpclbRouteType").enummodule
end
diff --git a/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_services_pb.rb b/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_services_pb.rb
index ddc81bed3d..5e41cfeead 100644
--- a/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_services_pb.rb
+++ b/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_services_pb.rb
@@ -33,7 +33,7 @@ module Grpc
self.service_name = 'grpc.testing.ReportQpsScenarioService'
# Report results of a QPS test benchmark scenario.
- rpc :ReportScenario, ScenarioResult, Void
+ rpc :ReportScenario, ::Grpc::Testing::ScenarioResult, ::Grpc::Testing::Void
end
Stub = Service.rpc_stub_class
diff --git a/src/ruby/qps/src/proto/grpc/testing/worker_service_services_pb.rb b/src/ruby/qps/src/proto/grpc/testing/worker_service_services_pb.rb
index a7ecc95757..049db47778 100644
--- a/src/ruby/qps/src/proto/grpc/testing/worker_service_services_pb.rb
+++ b/src/ruby/qps/src/proto/grpc/testing/worker_service_services_pb.rb
@@ -38,18 +38,18 @@ module Grpc
# stats. Closing the stream will initiate shutdown of the test server
# and once the shutdown has finished, the OK status is sent to terminate
# this RPC.
- rpc :RunServer, stream(ServerArgs), stream(ServerStatus)
+ rpc :RunServer, stream(::Grpc::Testing::ServerArgs), stream(::Grpc::Testing::ServerStatus)
# Start client with specified workload.
# First request sent specifies the ClientConfig followed by ClientStatus
# response. After that, a "Mark" can be sent anytime to request the latest
# stats. Closing the stream will initiate shutdown of the test client
# and once the shutdown has finished, the OK status is sent to terminate
# this RPC.
- rpc :RunClient, stream(ClientArgs), stream(ClientStatus)
+ rpc :RunClient, stream(::Grpc::Testing::ClientArgs), stream(::Grpc::Testing::ClientStatus)
# Just return the core count - unary call
- rpc :CoreCount, CoreRequest, CoreResponse
+ rpc :CoreCount, ::Grpc::Testing::CoreRequest, ::Grpc::Testing::CoreResponse
# Quit this worker
- rpc :QuitWorker, Void, Void
+ rpc :QuitWorker, ::Grpc::Testing::Void, ::Grpc::Testing::Void
end
Stub = Service.rpc_stub_class
--
2.23.0

View File

@ -1,47 +0,0 @@
From 88b5952945662bee3d4b250a4d161b36afbf4f44 Mon Sep 17 00:00:00 2001
From: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
Date: Fri, 16 Oct 2020 20:21:31 +0200
Subject: [PATCH] Allow grpcio to be built against system re2
---
setup.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/setup.py b/setup.py
index 184d5457f1a..f7e1fbf7c56 100644
--- a/setup.py
+++ b/setup.py
@@ -133,6 +133,11 @@
BUILD_WITH_SYSTEM_CARES = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_CARES',
False)
+# Export this variable to use the system installation of re2. You need to
+# have the header files installed (in /usr/include/re2) and during
+# runtime, the shared library must be installed
+BUILD_WITH_SYSTEM_RE2 = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_RE2', False)
+
# For local development use only: This skips building gRPC Core and its
# dependencies, including protobuf and boringssl. This allows "incremental"
# compilation by first building gRPC Core using make, then building only the
@@ -258,6 +263,10 @@ def check_linker_need_libatomic():
CORE_C_FILES = filter(lambda x: 'third_party/cares' not in x, CORE_C_FILES)
CARES_INCLUDE = (os.path.join('/usr', 'include'),)
+if BUILD_WITH_SYSTEM_RE2:
+ CORE_C_FILES = filter(lambda x: 'third_party/re2' not in x, CORE_C_FILES)
+ RE2_INCLUDE = (os.path.join('/usr', 'include', 're2'),)
+
EXTENSION_INCLUDE_DIRECTORIES = ((PYTHON_STEM,) + CORE_INCLUDE + ABSL_INCLUDE +
ADDRESS_SORTING_INCLUDE + CARES_INCLUDE +
RE2_INCLUDE + SSL_INCLUDE + UPB_INCLUDE +
@@ -284,6 +293,8 @@ def check_linker_need_libatomic():
EXTENSION_LIBRARIES += ('z',)
if BUILD_WITH_SYSTEM_CARES:
EXTENSION_LIBRARIES += ('cares',)
+if BUILD_WITH_SYSTEM_RE2:
+ EXTENSION_LIBRARIES += ('re2',)
DEFINE_MACROS = (('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600))
if not DISABLE_LIBC_COMPATIBILITY:
---
28.1

View File

@ -1,26 +1,26 @@
diff -Naur grpc-1.37.0-original/setup.py grpc-1.37.0/setup.py
--- grpc-1.37.0-original/setup.py 2021-04-06 18:48:56.000000000 -0400
+++ grpc-1.37.0/setup.py 2021-04-08 15:34:35.182802019 -0400
@@ -28,6 +28,7 @@
diff -Naur grpc-1.40.0-original/setup.py grpc-1.40.0/setup.py
--- grpc-1.40.0-original/setup.py 2021-09-03 19:20:52.000000000 -0400
+++ grpc-1.40.0/setup.py 2021-09-07 14:57:55.247990450 -0400
@@ -29,6 +29,7 @@
from distutils import util
import os
import os.path
+import pathlib
import pkg_resources
import platform
import re
import shlex
@@ -154,6 +155,11 @@
# runtime, the shared library must be installed
BUILD_WITH_SYSTEM_RE2 = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_RE2', False)
BUILD_WITH_SYSTEM_RE2 = _env_bool_value('GRPC_PYTHON_BUILD_SYSTEM_RE2', 'False')
+# Export this variable to use the system installation of abseil. You need to
+# have the header files installed (in /usr/include/absl) and during
+# runtime, the shared library must be installed
+BUILD_WITH_SYSTEM_ABSL = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_ABSL', False)
+
# For local development use only: This skips building gRPC Core and its
# dependencies, including protobuf and boringssl. This allows "incremental"
# compilation by first building gRPC Core using make, then building only the
# Export this variable to force building the python extension with a statically linked libstdc++.
# At least on linux, this is normally not needed as we can build manylinux-compatible wheels on linux just fine
# without statically linking libstdc++ (which leads to a slight increase in the wheel size).
@@ -296,6 +302,10 @@
CORE_C_FILES = filter(lambda x: 'third_party/re2' not in x, CORE_C_FILES)
RE2_INCLUDE = (os.path.join('/usr', 'include', 're2'),)
@ -41,5 +41,6 @@ diff -Naur grpc-1.37.0-original/setup.py grpc-1.37.0/setup.py
+ lib.stem[3:] for lib in pathlib.Path('/usr').glob('lib*/libabsl_*.so')
+ )
DEFINE_MACROS = (('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600))
if not DISABLE_LIBC_COMPATIBILITY:
DEFINE_MACROS = (('_WIN32_WINNT', 0x600),)
asm_files = []

View File

@ -1,122 +0,0 @@
From 45e413d2520795e7281e9a592af81620349bc186 Mon Sep 17 00:00:00 2001
From: Paul Wankadia <junyer@google.com>
Date: Wed, 9 Sep 2020 04:26:36 -0700
Subject: [PATCH] Attempt to find RE2 via CMake and via pkg-config.
---
CMakeLists.txt | 1 +
cmake/modules/Findre2.cmake | 58 +++++++++++++++++++++++++++++++
cmake/re2.cmake | 6 +---
templates/CMakeLists.txt.template | 1 +
4 files changed, 61 insertions(+), 5 deletions(-)
create mode 100644 cmake/modules/Findre2.cmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b04d25ac50..cecb4396c57 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15624,6 +15624,7 @@ install(FILES
)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/Findc-ares.cmake
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/Findre2.cmake
DESTINATION ${gRPC_INSTALL_CMAKEDIR}/modules
)
diff --git a/cmake/modules/Findre2.cmake b/cmake/modules/Findre2.cmake
new file mode 100644
index 00000000000..41df4547138
--- /dev/null
+++ b/cmake/modules/Findre2.cmake
@@ -0,0 +1,58 @@
+# Copyright 2017 gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+find_package(re2 QUIET CONFIG)
+if(re2_FOUND)
+ message(STATUS "Found RE2 via CMake.")
+ return()
+endif()
+
+find_package(PkgConfig REQUIRED)
+# TODO(junyer): Use the IMPORTED_TARGET option whenever CMake 3.6 (or newer)
+# becomes the minimum required: that will take care of the add_library() and
+# set_property() calls; then we can simply alias PkgConfig::RE2 as re2::re2.
+# For now, we can only set INTERFACE_* properties that existed in CMake 3.5.
+pkg_check_modules(RE2 QUIET re2)
+if(RE2_FOUND)
+ set(re2_FOUND "${RE2_FOUND}")
+ add_library(re2::re2 INTERFACE IMPORTED)
+ if(RE2_INCLUDE_DIRS)
+ set_property(TARGET re2::re2 PROPERTY
+ INTERFACE_INCLUDE_DIRECTORIES "${RE2_INCLUDE_DIRS}")
+ endif()
+ if(RE2_CFLAGS_OTHER)
+ # Filter out the -std flag, which is handled by CMAKE_CXX_STANDARD.
+ # TODO(junyer): Use the FILTER option whenever CMake 3.6 (or newer)
+ # becomes the minimum required: that will allow this to be concise.
+ foreach(flag IN LISTS RE2_CFLAGS_OTHER)
+ if("${flag}" MATCHES "^-std=")
+ list(REMOVE_ITEM RE2_CFLAGS_OTHER "${flag}")
+ endif()
+ endforeach()
+ set_property(TARGET re2::re2 PROPERTY
+ INTERFACE_COMPILE_OPTIONS "${RE2_CFLAGS_OTHER}")
+ endif()
+ if(RE2_LDFLAGS)
+ set_property(TARGET re2::re2 PROPERTY
+ INTERFACE_LINK_LIBRARIES "${RE2_LDFLAGS}")
+ endif()
+ message(STATUS "Found RE2 via pkg-config.")
+ return()
+endif()
+
+if(re2_FIND_REQUIRED)
+ message(FATAL_ERROR "Failed to find RE2.")
+elseif(NOT re2_FIND_QUIETLY)
+ message(WARNING "Failed to find RE2.")
+endif()
diff --git a/cmake/re2.cmake b/cmake/re2.cmake
index 3e83aae6910..974b0a436e2 100644
--- a/cmake/re2.cmake
+++ b/cmake/re2.cmake
@@ -45,13 +45,9 @@ if(gRPC_RE2_PROVIDER STREQUAL "module")
set(gRPC_INSTALL FALSE)
endif()
elseif(gRPC_RE2_PROVIDER STREQUAL "package")
- find_package(re2 REQUIRED CONFIG)
-
+ find_package(re2 REQUIRED)
if(TARGET re2::re2)
set(_gRPC_RE2_LIBRARIES re2::re2)
- else()
- set(_gRPC_RE2_LIBRARIES ${RE2_LIBRARIES})
endif()
- set(_gRPC_RE2_INCLUDE_DIR ${RE2_INCLUDE_DIRS})
set(_gRPC_FIND_RE2 "if(NOT re2_FOUND)\n find_package(re2)\nendif()")
endif()
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index c7f2556dc92..f7db0fd2d0c 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -706,6 +706,7 @@
)
install(FILES
<%text>${CMAKE_CURRENT_SOURCE_DIR}</%text>/cmake/modules/Findc-ares.cmake
+ <%text>${CMAKE_CURRENT_SOURCE_DIR}</%text>/cmake/modules/Findre2.cmake
DESTINATION <%text>${gRPC_INSTALL_CMAKEDIR}</%text>/modules
)
--
2.28.0

Binary file not shown.

BIN
grpc-1.41.1.tar.gz Normal file

Binary file not shown.

View File

@ -1,22 +1,17 @@
%global c_so_version 19
%global cpp_so_version 1.41
Name: grpc
Version: 1.31.0
Release: 6
Version: 1.41.1
Release: 1
Summary: A modern, open source high performance RPC framework that can run in any environment
License: ASL 2.0
URL: https://www.grpc.io
Source0: https://github.com/grpc/grpc/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0000: Copy-channel-args-hash-before-appending-ruby-user-ag.patch
Patch0001: Ran-generate_proto_ruby.sh-to-update-generated-files.patch
Patch0002: Add-ABSL_RANDOM_HWAES_FLAGS.patch
Patch0003: Fix-destruction-race-between-subchannel-and-client_c.patch
Patch0004: Fix-use-after-free-by-removing-stream-from-transport.patch
Patch0005: repair-gflags-compile-error-with-cmake.patch
Patch0006: repair-pkgconfig-path.patch
Patch0007: add-secure-compile-option-in-Makefile.patch
Patch0008: fix-re2-build-error.patch
Patch0009: allow-grpcio-to-be-build-against-system-re2.patch
Patch0010: grpc-1.31.0-python-grpcio-use-system-abseil.patch
Patch0010: backport-grpc-1.41.1-python-grpcio-use-system-abseil.patch
BuildRequires: gcc-c++ pkgconfig protobuf-devel protobuf-compiler
BuildRequires: openssl-devel c-ares-devel gflags-devel gtest-devel zlib-devel gperftools-devel
@ -24,10 +19,8 @@ BuildRequires: python3-devel python3-setuptools python3-Cython
BuildRequires: cmake >= 3.13.0
BuildRequires: pkgconfig(re2)
BuildRequires: abseil-cpp-devel
Requires: protobuf-compiler gflags
Provides: %{name}-plugins = %{version}-%{release}
Obsoletes: %{name}-plugins < %{version}-%{release}
BuildRequires: grpc
Requires: protobuf-compiler gflags
%description
gRPC is a modern open source high performance RPC framework that can run in any environment.
@ -44,6 +37,15 @@ Requires: abseil-cpp-devel
%description devel
Development headers and files for gRPC libraries.
%package plugins
Summary: Protocol buffers compiler plugins for gRPC
# License: same as base package
Requires: grpc = %{version}-%{release}
Requires: protobuf-compiler
%description plugins
Plugins to the protocol buffers compiler to generate gRPC sources.
%package -n python3-grpcio
Summary: Python3 language bindings for gRPC
Requires: %{name} = %{version}-%{release}
@ -95,6 +97,13 @@ cd cmake/build
make install/local
rm -rf %{buildroot}%{_prefix}/lib
cp %{_libdir}/libgpr.so* %{buildroot}%{_libdir}/
cp %{_libdir}/libgrpc++.so* %{buildroot}%{_libdir}/
cp %{_libdir}/libgrpc++_reflection.so* %{buildroot}%{_libdir}/
cp %{_libdir}/libgrpc.so* %{buildroot}%{_libdir}/
cp %{_libdir}/libaddress_sorting.so* %{buildroot}%{_libdir}/
cp %{_libdir}/libupb.so* %{buildroot}%{_libdir}/
%delete_la_and_a
cd ../..
%py3_install
@ -106,10 +115,29 @@ cd ../..
%doc README.md
%license LICENSE
%{_bindir}/grpc_*_plugin
%{_libdir}/*.so.1*
%{_datadir}/%{name}
%{_libdir}/libaddress_sorting.so.%{c_so_version}*
%{_libdir}/libgpr.so.%{c_so_version}*
%{_libdir}/libgrpc.so.%{c_so_version}*
%{_libdir}/libgrpc_unsecure.so.%{c_so_version}*
%{_libdir}/libupb.so.%{c_so_version}*
%{_libdir}/libgrpc++.so.%{cpp_so_version}*
%{_libdir}/libgrpc++_alts.so.%{cpp_so_version}*
%{_libdir}/libgrpc++_error_details.so.%{cpp_so_version}*
%{_libdir}/libgrpc++_reflection.so.%{cpp_so_version}*
%{_libdir}/libgrpc++_unsecure.so.%{cpp_so_version}*
%{_libdir}/libgrpc_plugin_support.so.%{cpp_so_version}*
%{_libdir}/libgrpcpp_channelz.so.%{cpp_so_version}*
%{_libdir}/libgpr.so*
%{_libdir}/libgrpc++.so*
%{_libdir}/libgrpc++_reflection.so*
%{_libdir}/libgrpc.so*
%{_libdir}/libaddress_sorting.so*
%{_libdir}/libupb.so*
%files plugins
%{_bindir}/grpc_*_plugin
%files devel
%defattr(-,root,root)
@ -122,9 +150,15 @@ cd ../..
%files -n python3-grpcio
%defattr(-,root,root)
%{python3_sitearch}/grpc
%{python3_sitearch}/grpcio-%{version}-py?.?.egg-info
%{python3_sitearch}/grpcio-%{version}-py*
%changelog
* Tue Mar 29 2022 xihaochen <xihaochen@h-partners.com> - 1.41.1-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:update grpc to 1.41.1
* Mon Jul 19 2021 lijingyuan <lijingyuan3@huawei.com> - 1.31.0-6
- Type:requirement
- ID:NA

View File

@ -1,17 +0,0 @@
From: bitcoffee<854182924@qq.com>
Reason: repair libgrpc++_test_config.so lost dependence on glfags
diff -urN grpc/cmake/gflags.cmake grpc_new/cmake/gflags.cmake
--- grpc/cmake/gflags.cmake 2020-08-25 10:00:46.356802187 +0800
+++ grpc_new/cmake/gflags.cmake 2020-08-25 20:00:19.296009625 +0800
@@ -25,8 +25,8 @@
elseif(gRPC_GFLAGS_PROVIDER STREQUAL "package")
# Use "CONFIG" as there is no built-in cmake module for gflags.
find_package(gflags REQUIRED CONFIG)
- if(TARGET gflags::gflags)
- set(_gRPC_GFLAGS_LIBRARIES gflags::gflags)
+ if(TARGET gflags)
+ set(_gRPC_GFLAGS_LIBRARIES gflags)
endif()
set(_gRPC_FIND_GFLAGS "if(NOT gflags_FOUND)\n find_package(gflags CONFIG)\nendif()")
elseif(gRPC_GFLAGS_PROVIDER STREQUAL "none")