Skip to content

Commit 9a4f21f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into lb-policy-delay
# Conflicts: # core/src/main/java/io/grpc/internal/PickFirstLeafLoadBalancer.java
2 parents 6a3572b + 293aa89 commit 9a4f21f

168 files changed

Lines changed: 3675 additions & 909 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
2+
3+
common:skip_android --deleted_packages=android,binder

.github/workflows/branch-testing.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ jobs:
2020
fail-fast: false # Should swap to true if we grow a large matrix
2121

2222
steps:
23-
- uses: actions/checkout@v4
24-
- uses: actions/setup-java@v4
23+
- uses: actions/checkout@v6
24+
- uses: actions/setup-java@v5
2525
with:
2626
java-version: ${{ matrix.jre }}
2727
distribution: 'temurin'
2828

2929
- name: Gradle cache
30-
uses: actions/cache@v4
30+
uses: actions/cache@v5
3131
with:
3232
path: |
3333
~/.gradle/caches

.github/workflows/gradle-wrapper-validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ jobs:
99
name: "Gradle wrapper validation"
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
13-
- uses: gradle/actions/wrapper-validation@v4
12+
- uses: actions/checkout@v6
13+
- uses: gradle/actions/wrapper-validation@v6

.github/workflows/lock.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
lock:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: dessant/lock-threads@v5
16+
- uses: dessant/lock-threads@v6
1717
with:
1818
github-token: ${{ github.token }}
1919
issue-inactive-days: 90

.github/workflows/testing.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ jobs:
2121
fail-fast: false # Should swap to true if we grow a large matrix
2222

2323
steps:
24-
- uses: actions/checkout@v4
25-
- uses: actions/setup-java@v4
24+
- uses: actions/checkout@v6
25+
- uses: actions/setup-java@v5
2626
with:
2727
java-version: ${{ matrix.jre }}
2828
distribution: 'temurin'
2929

3030
- name: Gradle cache
31-
uses: actions/cache@v4
31+
uses: actions/cache@v5
3232
with:
3333
path: |
3434
~/.gradle/caches
@@ -37,7 +37,7 @@ jobs:
3737
restore-keys: |
3838
${{ runner.os }}-gradle-
3939
- name: Maven cache
40-
uses: actions/cache@v4
40+
uses: actions/cache@v5
4141
with:
4242
path: |
4343
~/.m2/repository
@@ -46,7 +46,7 @@ jobs:
4646
restore-keys: |
4747
${{ runner.os }}-maven-
4848
- name: Protobuf cache
49-
uses: actions/cache@v4
49+
uses: actions/cache@v5
5050
with:
5151
path: /tmp/protobuf-cache
5252
key: ${{ runner.os }}-maven-${{ hashFiles('buildscripts/make_dependencies.sh') }}
@@ -55,7 +55,7 @@ jobs:
5555
run: buildscripts/kokoro/unix.sh
5656
- name: Post Failure Upload Test Reports to Artifacts
5757
if: ${{ failure() }}
58-
uses: actions/upload-artifact@v4
58+
uses: actions/upload-artifact@v7
5959
with:
6060
name: Test Reports (JRE ${{ matrix.jre }})
6161
path: |
@@ -71,7 +71,7 @@ jobs:
7171
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
7272
run: ./gradlew :grpc-all:coveralls -PskipAndroid=true -x compileJava
7373
- name: Codecov
74-
uses: codecov/codecov-action@v4
74+
uses: codecov/codecov-action@v6
7575
with:
7676
token: ${{ secrets.CODECOV_TOKEN }}
7777

@@ -80,31 +80,35 @@ jobs:
8080
strategy:
8181
matrix:
8282
bzlmod: [true, false]
83+
bazel_version: [8.7.0, 9.1.0]
84+
exclude:
85+
- bazel_version: 9.1.0
86+
bzlmod: false
8387
env:
84-
USE_BAZEL_VERSION: 7.7.1
88+
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
8589

8690
steps:
87-
- uses: actions/checkout@v4
91+
- uses: actions/checkout@v6
8892

8993
- name: Check versions match in MODULE.bazel and repositories.bzl
9094
run: |
9195
diff -u <(sed -n '/GRPC_DEPS_START/,/GRPC_DEPS_END/ {/GRPC_DEPS_/! p}' MODULE.bazel) \
9296
<(sed -n '/GRPC_DEPS_START/,/GRPC_DEPS_END/ {/GRPC_DEPS_/! p}' repositories.bzl)
9397
9498
- name: Bazel cache
95-
uses: actions/cache@v4
99+
uses: actions/cache@v5
96100
with:
97101
path: |
98102
~/.cache/bazel/*/cache
99103
~/.cache/bazelisk/downloads
100104
key: ${{ runner.os }}-bazel-${{ env.USE_BAZEL_VERSION }}-${{ hashFiles('WORKSPACE', 'repositories.bzl') }}
101105

102106
- name: Run bazel build
103-
run: bazelisk build //... --enable_bzlmod=${{ matrix.bzlmod }}
107+
run: bazelisk build //... --config=skip_android --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }}
104108

105109
- name: Run bazel test
106-
run: bazelisk test //... --enable_bzlmod=${{ matrix.bzlmod }}
110+
run: bazelisk test //... --config=skip_android --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }}
107111

108112
- name: Run example bazel build
109-
run: bazelisk build //... --enable_bzlmod=${{ matrix.bzlmod }}
113+
run: bazelisk build //... --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }}
110114
working-directory: ./examples

COMPILING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,26 @@ $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
150150

151151
# Add 'export ANDROID_HOME=$HOME/Android/Sdk' to your .bashrc or equivalent
152152
```
153+
154+
Building with Bazel
155+
===================
156+
157+
grpc-java can also be built using [Bazel](https://bazel.build/). We support
158+
the two most recent major versions of Bazel.
159+
[Install bazelisk](https://github.com/bazelbuild/bazelisk#installation)
160+
to ensure you're always building using the latest supported version, then try:
161+
162+
```
163+
$ bazelisk build //...
164+
```
165+
166+
Some parts of grpc-java depend on Android. Bazel can build these parts too but,
167+
for size, licensing and maintenance reasons, it requires a locally installed
168+
Android SDK. If you don't have the SDK and/or don't care about Android, use the
169+
`skip_android` configuration to skip building the Android parts:
170+
171+
```sh
172+
$ bazelisk build //... --config=skip_android
173+
```
174+
175+
You cannot run the tests from Bazel at this time.

MODULE.bazel

Lines changed: 53 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module(
22
name = "grpc-java",
3-
version = "1.82.0-SNAPSHOT", # CURRENT_GRPC_VERSION
4-
compatibility_level = 0,
3+
version = "1.83.0-SNAPSHOT", # CURRENT_GRPC_VERSION
54
repo_name = "io_grpc_grpc_java",
65
)
76

@@ -14,29 +13,32 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
1413
"com.google.auto.value:auto-value-annotations:1.11.0",
1514
"com.google.auto.value:auto-value:1.11.0",
1615
"com.google.code.findbugs:jsr305:3.0.2",
17-
"com.google.code.gson:gson:2.13.2",
18-
"com.google.errorprone:error_prone_annotations:2.48.0",
16+
"com.google.code.gson:gson:2.14.0",
17+
"com.google.errorprone:error_prone_annotations:2.50.0",
1918
"com.google.guava:failureaccess:1.0.1",
20-
"com.google.guava:guava:33.5.0-android",
19+
"com.google.guava:guava:33.6.0-android",
2120
"com.google.re2j:re2j:1.8",
2221
"com.google.s2a.proto.v2:s2a-proto:0.1.3",
2322
"com.google.truth:truth:1.4.5",
23+
"dev.cel:runtime:0.13.0",
24+
"dev.cel:protobuf:0.13.0",
25+
"dev.cel:common:0.13.0",
2426
"com.squareup.okhttp:okhttp:2.7.5",
2527
"com.squareup.okio:okio:2.10.0", # 3.0+ needs swapping to -jvm; need work to avoid flag-day
26-
"io.netty:netty-buffer:4.1.132.Final",
27-
"io.netty:netty-codec-http2:4.1.132.Final",
28-
"io.netty:netty-codec-http:4.1.132.Final",
29-
"io.netty:netty-codec-socks:4.1.132.Final",
30-
"io.netty:netty-codec:4.1.132.Final",
31-
"io.netty:netty-common:4.1.132.Final",
32-
"io.netty:netty-handler-proxy:4.1.132.Final",
33-
"io.netty:netty-handler:4.1.132.Final",
34-
"io.netty:netty-resolver:4.1.132.Final",
28+
"io.netty:netty-buffer:4.2.15.Final",
29+
"io.netty:netty-codec-base:4.2.15.Final",
30+
"io.netty:netty-codec-http2:4.2.15.Final",
31+
"io.netty:netty-codec-http:4.2.15.Final",
32+
"io.netty:netty-codec-socks:4.2.15.Final",
33+
"io.netty:netty-common:4.2.15.Final",
34+
"io.netty:netty-handler-proxy:4.2.15.Final",
35+
"io.netty:netty-handler:4.2.15.Final",
36+
"io.netty:netty-resolver:4.2.15.Final",
3537
"io.netty:netty-tcnative-boringssl-static:2.0.75.Final",
3638
"io.netty:netty-tcnative-classes:2.0.75.Final",
37-
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.132.Final",
38-
"io.netty:netty-transport-native-unix-common:4.1.132.Final",
39-
"io.netty:netty-transport:4.1.132.Final",
39+
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.2.15.Final",
40+
"io.netty:netty-transport-native-unix-common:4.2.15.Final",
41+
"io.netty:netty-transport:4.2.15.Final",
4042
"io.opencensus:opencensus-api:0.31.0",
4143
"io.opencensus:opencensus-contrib-grpc-metrics:0.31.0",
4244
"io.perfmark:perfmark-api:0.27.0",
@@ -50,13 +52,22 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
5052
bazel_dep(name = "abseil-cpp", version = "20250512.1")
5153
bazel_dep(name = "bazel_jar_jar", version = "0.1.11.bcr.1")
5254
bazel_dep(name = "bazel_skylib", version = "1.7.1")
53-
bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5", repo_name = "com_google_googleapis")
55+
bazel_dep(name = "googleapis", version = "0.0.0-20260514-1dbb1a14", repo_name = "com_google_googleapis")
5456
bazel_dep(name = "grpc-proto", version = "0.0.0-20240627-ec30f58.bcr.1", repo_name = "io_grpc_grpc_proto")
5557
bazel_dep(name = "protobuf", version = "33.4", repo_name = "com_google_protobuf")
58+
bazel_dep(name = "rules_android", version = "0.7.2")
5659
bazel_dep(name = "rules_cc", version = "0.0.9")
5760
bazel_dep(name = "rules_java", version = "9.1.0")
5861
bazel_dep(name = "rules_jvm_external", version = "6.0")
5962

63+
android_sdk_repository_extension = use_extension(
64+
"@rules_android//rules/android_sdk_repository:rule.bzl",
65+
"android_sdk_repository_extension",
66+
)
67+
use_repo(android_sdk_repository_extension, "androidsdk")
68+
69+
register_toolchains("@androidsdk//:sdk-toolchain", "@androidsdk//:all")
70+
6071
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
6172
maven.install(
6273
artifacts = IO_GRPC_GRPC_JAVA_ARTIFACTS,
@@ -67,6 +78,30 @@ maven.install(
6778
)
6879
use_repo(maven, "maven")
6980

81+
# Define a separate, dev-only extension import for Android deps.
82+
# This prevents downstream non-Android users from having to resolve
83+
# Google Maven (which is required for androidx.*) or rules_android transitively.
84+
grpc_android_maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven", dev_dependency = True)
85+
grpc_android_maven.install(
86+
name = "grpc_android_maven",
87+
# Set this explicitly since the default guess is incorrect under Bzlmod.
88+
aar_import_bzl_label = "@rules_android//rules:rules.bzl",
89+
artifacts = [
90+
"androidx.annotation:annotation:1.6.0",
91+
"androidx.annotation:annotation-jvm:1.6.0",
92+
"androidx.core:core:1.13.1",
93+
"androidx.lifecycle:lifecycle-common:2.6.2",
94+
],
95+
repositories = [
96+
"https://repo.maven.apache.org/maven2/",
97+
"https://maven.google.com",
98+
],
99+
strict_visibility = True,
100+
# For Bazel 8+ compatibility.
101+
use_starlark_android_rules = True,
102+
)
103+
use_repo(grpc_android_maven, "grpc_android_maven")
104+
70105
maven.override(
71106
coordinates = "com.google.protobuf:protobuf-java",
72107
target = "@com_google_protobuf//:protobuf_java",

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ For a guided tour, take a look at the [quick start
4444
guide](https://grpc.io/docs/languages/java/quickstart) or the more explanatory [gRPC
4545
basics](https://grpc.io/docs/languages/java/basics).
4646

47-
The [examples](https://github.com/grpc/grpc-java/tree/v1.81.0/examples) and the
48-
[Android example](https://github.com/grpc/grpc-java/tree/v1.81.0/examples/android)
47+
The [examples](https://github.com/grpc/grpc-java/tree/v1.82.0/examples) and the
48+
[Android example](https://github.com/grpc/grpc-java/tree/v1.82.0/examples/android)
4949
are standalone projects that showcase the usage of gRPC.
5050

5151
Download
@@ -56,42 +56,42 @@ Download [the JARs][]. Or for Maven with non-Android, add to your `pom.xml`:
5656
<dependency>
5757
<groupId>io.grpc</groupId>
5858
<artifactId>grpc-netty-shaded</artifactId>
59-
<version>1.81.0</version>
59+
<version>1.82.0</version>
6060
<scope>runtime</scope>
6161
</dependency>
6262
<dependency>
6363
<groupId>io.grpc</groupId>
6464
<artifactId>grpc-protobuf</artifactId>
65-
<version>1.81.0</version>
65+
<version>1.82.0</version>
6666
</dependency>
6767
<dependency>
6868
<groupId>io.grpc</groupId>
6969
<artifactId>grpc-stub</artifactId>
70-
<version>1.81.0</version>
70+
<version>1.82.0</version>
7171
</dependency>
7272
```
7373

7474
Or for Gradle with non-Android, add to your dependencies:
7575
```gradle
76-
runtimeOnly 'io.grpc:grpc-netty-shaded:1.81.0'
77-
implementation 'io.grpc:grpc-protobuf:1.81.0'
78-
implementation 'io.grpc:grpc-stub:1.81.0'
76+
runtimeOnly 'io.grpc:grpc-netty-shaded:1.82.0'
77+
implementation 'io.grpc:grpc-protobuf:1.82.0'
78+
implementation 'io.grpc:grpc-stub:1.82.0'
7979
```
8080

8181
For Android client, use `grpc-okhttp` instead of `grpc-netty-shaded` and
8282
`grpc-protobuf-lite` instead of `grpc-protobuf`:
8383
```gradle
84-
implementation 'io.grpc:grpc-okhttp:1.81.0'
85-
implementation 'io.grpc:grpc-protobuf-lite:1.81.0'
86-
implementation 'io.grpc:grpc-stub:1.81.0'
84+
implementation 'io.grpc:grpc-okhttp:1.82.0'
85+
implementation 'io.grpc:grpc-protobuf-lite:1.82.0'
86+
implementation 'io.grpc:grpc-stub:1.82.0'
8787
```
8888

8989
For [Bazel](https://bazel.build), you can either
9090
[use Maven](https://github.com/bazelbuild/rules_jvm_external)
9191
(with the GAVs from above), or use `@io_grpc_grpc_java//api` et al (see below).
9292

9393
[the JARs]:
94-
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.81.0
94+
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.82.0
9595

9696
Development snapshots are available in [Sonatypes's snapshot
9797
repository](https://central.sonatype.com/repository/maven-snapshots/).
@@ -123,7 +123,7 @@ For protobuf-based codegen integrated with the Maven build system, you can use
123123
<configuration>
124124
<protocArtifact>com.google.protobuf:protoc:3.25.8:exe:${os.detected.classifier}</protocArtifact>
125125
<pluginId>grpc-java</pluginId>
126-
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.81.0:exe:${os.detected.classifier}</pluginArtifact>
126+
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.82.0:exe:${os.detected.classifier}</pluginArtifact>
127127
</configuration>
128128
<executions>
129129
<execution>
@@ -153,7 +153,7 @@ protobuf {
153153
}
154154
plugins {
155155
grpc {
156-
artifact = 'io.grpc:protoc-gen-grpc-java:1.81.0'
156+
artifact = 'io.grpc:protoc-gen-grpc-java:1.82.0'
157157
}
158158
}
159159
generateProtoTasks {
@@ -186,7 +186,7 @@ protobuf {
186186
}
187187
plugins {
188188
grpc {
189-
artifact = 'io.grpc:protoc-gen-grpc-java:1.81.0'
189+
artifact = 'io.grpc:protoc-gen-grpc-java:1.82.0'
190190
}
191191
}
192192
generateProtoTasks {

RELEASING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,7 @@ gRPC for things that will need a migration effort.
250250
When happy with the dependency upgrades, update the versions in `MODULE.bazel`,
251251
`repositories.bzl`, and the various `pom.xml` and `build.gradle` files in
252252
`examples/`.
253+
254+
Upgrade the `uses:` for actions in `.github/workflows` to newer versions. Make
255+
sure to see what changed in each new major version, but it is most often just
256+
requiring a newer Node.js version.

alts/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ java_library(
2222
artifact("com.google.errorprone:error_prone_annotations"),
2323
artifact("com.google.guava:guava"),
2424
artifact("io.netty:netty-buffer"),
25-
artifact("io.netty:netty-codec"),
25+
artifact("io.netty:netty-codec-base"),
2626
artifact("io.netty:netty-common"),
2727
artifact("io.netty:netty-handler"),
2828
artifact("io.netty:netty-transport"),

0 commit comments

Comments
 (0)