Skip to content

Commit 7fa6aa5

Browse files
authored
build: update grpc to 1.34.0 (envoyproxy#14147)
Signed-off-by: Asra Ali <[email protected]>
1 parent 172a39b commit 7fa6aa5

File tree

10 files changed

+76
-60
lines changed

10 files changed

+76
-60
lines changed

Diff for: bazel/dependency_imports.bzl

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ load("@envoy_build_tools//toolchains:rbe_toolchains_config.bzl", "rbe_toolchains
44
load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_rbe_exec_properties_dict", "custom_exec_properties")
55
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
66
load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies")
7-
load("@upb//bazel:repository_defs.bzl", upb_bazel_version_repository = "bazel_version_repository")
7+
load("@upb//bazel:workspace_deps.bzl", "upb_deps")
88
load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")
99
load("@config_validation_pip3//:requirements.bzl", config_validation_pip_install = "pip_install")
1010
load("@configs_pip3//:requirements.bzl", configs_pip_install = "pip_install")
@@ -26,7 +26,7 @@ def envoy_dependency_imports(go_version = GO_VERSION):
2626
gazelle_dependencies()
2727
apple_rules_dependencies()
2828
rust_repositories()
29-
upb_bazel_version_repository(name = "upb_bazel_version")
29+
upb_deps()
3030
antlr_dependencies(472)
3131
proxy_wasm_rust_sdk_dependencies()
3232

Diff for: bazel/repositories.bzl

+16-5
Original file line numberDiff line numberDiff line change
@@ -746,13 +746,24 @@ def _com_github_grpc_grpc():
746746
actual = "@com_github_grpc_grpc//test/core/tsi/alts/fake_handshaker:transport_security_common_proto",
747747
)
748748

749-
def _upb():
750-
external_http_archive(
751-
name = "upb",
752-
patches = ["@envoy//bazel:upb.patch"],
753-
patch_args = ["-p1"],
749+
native.bind(
750+
name = "re2",
751+
actual = "@com_googlesource_code_re2//:re2",
752+
)
753+
754+
native.bind(
755+
name = "upb_lib_descriptor",
756+
actual = "@upb//:descriptor_upb_proto",
757+
)
758+
759+
native.bind(
760+
name = "upb_textformat_lib",
761+
actual = "@upb//:textformat",
754762
)
755763

764+
def _upb():
765+
external_http_archive(name = "upb")
766+
756767
native.bind(
757768
name = "upb_lib",
758769
actual = "@upb//:upb",

Diff for: bazel/repository_locations.bzl

+7-9
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,12 @@ REPOSITORY_LOCATIONS_SPEC = dict(
223223
project_name = "gRPC",
224224
project_desc = "gRPC C core library",
225225
project_url = "https://grpc.io",
226-
# TODO(JimmyCYJ): Bump to release 1.27
227-
# This sha on grpc:v1.25.x branch is specifically chosen to fix gRPC STS call credential options.
228-
version = "d8f4928fa779f6005a7fe55a176bdb373b0f910f",
229-
sha256 = "bbc8f020f4e85ec029b047fab939b8c81f3d67254b5c724e1003a2bc49ddd123",
226+
version = "1.34.0",
227+
sha256 = "7372a881122cd85a7224435a1d58bc5e11c88d4fb98a64b83f36f3d1c2f16d39",
230228
strip_prefix = "grpc-{version}",
231-
urls = ["https://github.com/grpc/grpc/archive/{version}.tar.gz"],
229+
urls = ["https://github.com/grpc/grpc/archive/v{version}.tar.gz"],
232230
use_category = ["dataplane_core", "controlplane"],
233-
release_date = "2020-02-11",
231+
release_date = "2020-12-01",
234232
cpe = "cpe:2.3:a:grpc:grpc:*",
235233
),
236234
com_github_luajit_luajit = dict(
@@ -776,12 +774,12 @@ REPOSITORY_LOCATIONS_SPEC = dict(
776774
project_name = "upb",
777775
project_desc = "A small protobuf implementation in C (gRPC dependency)",
778776
project_url = "https://github.com/protocolbuffers/upb",
779-
version = "8a3ae1ef3e3e3f26b45dec735c5776737fc7247f",
780-
sha256 = "e9f281c56ab1eb1f97a80ca8a83bb7ef73d230eabb8591f83876f4e7b85d9b47",
777+
version = "382d5afc60e05470c23e8de19b19fc5ad231e732",
778+
sha256 = "7992217989f3156f8109931c1fc6db3434b7414957cb82371552377beaeb9d6c",
781779
strip_prefix = "upb-{version}",
782780
urls = ["https://github.com/protocolbuffers/upb/archive/{version}.tar.gz"],
783781
use_category = ["controlplane"],
784-
release_date = "2019-11-19",
782+
release_date = "2020-08-03",
785783
cpe = "N/A",
786784
),
787785
kafka_source = dict(

Diff for: bazel/upb.patch

-27
This file was deleted.

Diff for: source/common/grpc/async_client_impl.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,9 @@ void AsyncStreamImpl::onHeaders(Http::ResponseHeaderMapPtr&& headers, bool end_s
117117
onTrailers(Http::createHeaderMap<Http::ResponseTrailerMapImpl>(*headers));
118118
return;
119119
}
120-
// Technically this should be
120+
// Status is translated via Utility::httpToGrpcStatus per
121121
// https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md
122-
// as given by Grpc::Utility::httpToGrpcStatus(), but the Google gRPC client treats
123-
// this as WellKnownGrpcStatus::Canceled.
124-
streamError(Status::WellKnownGrpcStatus::Canceled);
122+
streamError(Utility::httpToGrpcStatus(http_response_status));
125123
return;
126124
}
127125
if (end_stream) {

Diff for: source/extensions/transport_sockets/alts/config.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@ Network::TransportSocketFactoryPtr createTransportSocketFactoryHelper(
123123
tsi_handshaker* handshaker = nullptr;
124124
// Specifying target name as empty since TSI won't take care of validating peer identity
125125
// in this use case. The validation will be performed by TsiSocket with the validator.
126-
tsi_result status =
127-
alts_tsi_handshaker_create(options.get(), target_name, handshaker_service.c_str(),
128-
is_upstream, nullptr /* interested_parties */, &handshaker);
126+
// Leaving the max frame size as 0 (unspecified) sets the default max frame size of 128 KiB.
127+
tsi_result status = alts_tsi_handshaker_create(
128+
options.get(), target_name, handshaker_service.c_str(), is_upstream,
129+
nullptr /* interested_parties */, &handshaker, 0 /* default max frame size */);
129130
CHandshakerPtr handshaker_ptr{handshaker};
130131

131132
if (status != TSI_OK) {

Diff for: test/common/grpc/grpc_client_integration_test.cc

+3-5
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,9 @@ TEST_P(GrpcClientIntegrationTest, HttpNon200Status) {
8080
{":status", std::to_string(http_response_status)}};
8181
stream->expectInitialMetadata(empty_metadata_);
8282
stream->expectTrailingMetadata(empty_metadata_);
83-
// Technically this should be
84-
// https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md
85-
// as given by Grpc::Utility::httpToGrpcStatus(), but the Google gRPC client treats
86-
// this as WellKnownGrpcStatus::Canceled.
87-
stream->expectGrpcStatus(Status::WellKnownGrpcStatus::Canceled);
83+
// Translate status per
84+
// // https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md
85+
stream->expectGrpcStatus(Utility::httpToGrpcStatus(http_response_status));
8886
stream->fake_stream_->encodeHeaders(reply_headers, true);
8987
dispatcher_helper_.runDispatcher();
9088
}

Diff for: test/extensions/transport_sockets/alts/alts_integration_test.cc

+9-3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class CapturingHandshakerService : public grpc::gcp::HandshakerService::Service
7070
}
7171
stream->Write(response);
7272
request.Clear();
73+
if (response.has_status()) {
74+
return grpc::Status::OK;
75+
}
7376
}
7477
return grpc::Status::OK;
7578
}
@@ -79,7 +82,8 @@ class CapturingHandshakerService : public grpc::gcp::HandshakerService::Service
7982
grpc::gcp::RpcProtocolVersions server_versions;
8083
};
8184

82-
class AltsIntegrationTestBase : public testing::TestWithParam<Network::Address::IpVersion>,
85+
class AltsIntegrationTestBase : public Event::TestUsingSimulatedTime,
86+
public testing::TestWithParam<Network::Address::IpVersion>,
8387
public HttpIntegrationTest {
8488
public:
8589
AltsIntegrationTestBase(const std::string& server_peer_identity,
@@ -117,7 +121,9 @@ class AltsIntegrationTestBase : public testing::TestWithParam<Network::Address::
117121
service = std::unique_ptr<grpc::Service>{capturing_handshaker_service_};
118122
} else {
119123
capturing_handshaker_service_ = nullptr;
120-
service = grpc::gcp::CreateFakeHandshakerService();
124+
// If max_expected_concurrent_rpcs is zero, the fake handshaker service will not track
125+
// concurrent RPCs and abort if it exceeds the value.
126+
service = grpc::gcp::CreateFakeHandshakerService(/* max_expected_concurrent_rpcs */ 0);
121127
}
122128

123129
std::string server_address = Network::Test::getLoopbackAddressUrlString(version_) + ":0";
@@ -163,7 +169,7 @@ class AltsIntegrationTestBase : public testing::TestWithParam<Network::Address::
163169
HttpIntegrationTest::cleanupUpstreamAndDownstream();
164170
dispatcher_->clearDeferredDeleteList();
165171
if (fake_handshaker_server_ != nullptr) {
166-
fake_handshaker_server_->Shutdown();
172+
fake_handshaker_server_->Shutdown(timeSystem().systemTime());
167173
}
168174
fake_handshaker_server_thread_->join();
169175
}

Diff for: test/extensions/transport_sockets/alts/tsi_handshaker_test.cc

+10-2
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,27 @@ TEST_F(TsiHandshakerTest, DoHandshake) {
8686

8787
tsi_peer client_peer;
8888
EXPECT_EQ(TSI_OK, tsi_handshaker_result_extract_peer(client_result.get(), &client_peer));
89-
EXPECT_EQ(1, client_peer.property_count);
89+
EXPECT_EQ(2, client_peer.property_count);
9090
EXPECT_STREQ("certificate_type", client_peer.properties[0].name);
9191
absl::string_view client_certificate_type{client_peer.properties[0].value.data,
9292
client_peer.properties[0].value.length};
9393
EXPECT_EQ("FAKE", client_certificate_type);
94+
EXPECT_STREQ("security_level", client_peer.properties[1].name);
95+
absl::string_view client_security_level{client_peer.properties[1].value.data,
96+
client_peer.properties[1].value.length};
97+
EXPECT_EQ("TSI_SECURITY_NONE", client_security_level);
9498

9599
tsi_peer server_peer;
96100
EXPECT_EQ(TSI_OK, tsi_handshaker_result_extract_peer(server_result.get(), &server_peer));
97-
EXPECT_EQ(1, server_peer.property_count);
101+
EXPECT_EQ(2, server_peer.property_count);
98102
EXPECT_STREQ("certificate_type", server_peer.properties[0].name);
99103
absl::string_view server_certificate_type{server_peer.properties[0].value.data,
100104
server_peer.properties[0].value.length};
101105
EXPECT_EQ("FAKE", server_certificate_type);
106+
EXPECT_STREQ("security_level", server_peer.properties[1].name);
107+
absl::string_view server_security_level{server_peer.properties[1].value.data,
108+
server_peer.properties[1].value.length};
109+
EXPECT_EQ("TSI_SECURITY_NONE", server_security_level);
102110

103111
tsi_peer_destruct(&client_peer);
104112
tsi_peer_destruct(&server_peer);

Diff for: test/server/server_corpus/grpc_arg_pointer

+23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)