Skip to content

Commit 8f7bc2f

Browse files
scelemeteorcloudy
authored andcommitted
[1/3] Bump grpc to 1.33.1 to fix corruption when downloading CAS blobs
Part 1: add v1.33.1 version to third_party/grpc Note: partly switches to v1.33.1 too as not all bits are versioned and some of unversioned bits are used from other third_party targets grpc-java versions 1.27 through 1.32 had a bug where messages could arrive after the call was reported clsoed. In the case of bazel, this meant that in GrpcCacheClient, onNext could be called after onError. This leads to offset bookkeeping getting out of sync, and corrupts the CAS blob download. #12927
1 parent c903cf9 commit 8f7bc2f

13 files changed

Lines changed: 139 additions & 17 deletions

third_party/grpc/BUILD

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ load("//tools/distributions:distribution_rules.bzl", "distrib_java_import", "dis
1818

1919
licenses(["notice"]) # Apache v2
2020

21-
exports_files(["grpc_1.32.0.patch"])
21+
exports_files(["grpc_1.32.0.patch", "grpc_1.33.1.patch"])
2222

2323
package(default_visibility = ["//visibility:public"])
2424

@@ -32,14 +32,14 @@ filegroup(
3232
distrib_jar_filegroup(
3333
name = "bootstrap-grpc-jars",
3434
srcs = [
35-
"grpc-api-1.32.2.jar",
36-
"grpc-auth-1.32.2.jar",
37-
"grpc-context-1.32.2.jar",
38-
"grpc-core-1.32.2.jar",
39-
"grpc-netty-1.32.2.jar",
40-
"grpc-protobuf-1.32.2.jar",
41-
"grpc-protobuf-lite-1.32.2.jar",
42-
"grpc-stub-1.32.2.jar",
35+
"grpc-api-1.33.1.jar",
36+
"grpc-auth-1.33.1.jar",
37+
"grpc-context-1.33.1.jar",
38+
"grpc-core-1.33.1.jar",
39+
"grpc-netty-1.33.1.jar",
40+
"grpc-protobuf-1.33.1.jar",
41+
"grpc-protobuf-lite-1.33.1.jar",
42+
"grpc-stub-1.33.1.jar",
4343
],
4444
enable_distributions = ["debian"],
4545
)

third_party/grpc/README.bazel.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# How to update the C++ sources of gRPC:
22

33
1. Update the gRPC definitions in WORKSPACE file, currently we use
4-
https://github.com/grpc/grpc/archive/v1.32.2.tar.gz
4+
https://github.com/grpc/grpc/archive/v1.33.1.tar.gz
55
2. Update the gRPC patch file if necessary, it mostly helps avoid unnecessary dependencies.
66
3. Update third_party/grpc/BUILD to redirect targets to @com_github_grpc_grpc if necessary.
77

88
# How to update the BUILD/bzl sources of gRPC:
99

1010
1. `git clone http://github.com/grpc/grpc.git` in a convenient directory
11-
2. `git checkout <tag>` (current is `v1.32.0`, commithash `414bb8322d`)
11+
2. `git checkout <tag>` (current is `v1.33.1`, commithash `054ff69350`)
1212
3. `mkdir -p third_party/grpc/bazel`
1313
4. `cp <gRPC git tree>/bazel/{BUILD,cc_grpc_library.bzl,generate_cc.bzl,protobuf.bzl} third_party/grpc/bazel`
1414
5. In the `third_party/grpc` directory, apply local patches:
15-
`patch -p3 < bazel_1.32.0.patch`
15+
`patch -p3 < bazel_1.33.1.patch`
1616

1717
# How to update the Java plugin:
1818

19-
1. Checkout tag `v1.32.2` from https://github.com/grpc/grpc-java
19+
1. Checkout tag `v1.33.1` from https://github.com/grpc/grpc-java
2020
2. `cp -R <grpc-java git tree>/compiler/src/java_plugin third_party/grpc/compiler/src`
2121

2222
# How to update the Java code:
2323

24-
Download the necessary jars at version `1.32.2` from maven central.
24+
Download the necessary jars at version `1.33.1` from maven central.
2525

2626
# Submitting the change needs 3 pull requests
2727

2828
1. Update third_party/grpc to include files from new version
29-
2. Switch WORKSPACE, scripts/bootstrap/compile.sh and any other references to new version
29+
2. Switch distdir_deps.bzl, scripts/bootstrap/compile.sh and any other references to new version
3030
3. Remove older version from third_party/grpc

third_party/grpc/compiler/src/java_plugin/cpp/java_generator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ class LogHelper {
3838
}
3939
};
4040

41-
// Abort the program after logging the mesage if the given condition is not
41+
// Abort the program after logging the message if the given condition is not
4242
// true. Otherwise, do nothing.
4343
#define GRPC_CODEGEN_CHECK(x) !(x) && LogHelper(&std::cerr).get_os() \
4444
<< "CHECK FAILED: " << __FILE__ << ":" \
4545
<< __LINE__ << ": "
4646

47-
// Abort the program after logging the mesage.
47+
// Abort the program after logging the message.
4848
#define GRPC_CODEGEN_FAIL GRPC_CODEGEN_CHECK(false)
4949

5050
namespace java_grpc_generator {
225 KB
Binary file not shown.
14.2 KB
Binary file not shown.
29.9 KB
Binary file not shown.
631 KB
Binary file not shown.
240 KB
Binary file not shown.
5.06 KB
Binary file not shown.

0 commit comments

Comments
 (0)