Skip to content

Commit ecb6b03

Browse files
Merge branch 'master' into a75-fixes2
2 parents e2a7382 + c3ef1ab commit ecb6b03

File tree

143 files changed

+3039
-934
lines changed

Some content is hidden

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

143 files changed

+3039
-934
lines changed

.github/workflows/testing.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ jobs:
102102
- name: Run bazel build
103103
run: bazelisk build //... --enable_bzlmod=${{ matrix.bzlmod }}
104104

105+
- name: Run bazel test
106+
run: bazelisk test //... --enable_bzlmod=${{ matrix.bzlmod }}
107+
105108
- name: Run example bazel build
106109
run: bazelisk build //... --enable_bzlmod=${{ matrix.bzlmod }}
107110
working-directory: ./examples

MAINTAINERS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ for general contribution guidelines.
1111
- [ejona86](https://github.com/ejona86), Google LLC
1212
- [jdcormie](https://github.com/jdcormie), Google LLC
1313
- [kannanjgithub](https://github.com/kannanjgithub), Google LLC
14-
- [larry-safran](https://github.com/larry-safran), Google LLC
15-
- [markb74](https://github.com/markb74), Google LLC
1614
- [ran-su](https://github.com/ran-su), Google LLC
1715
- [sergiitk](https://github.com/sergiitk), Google LLC
1816
- [temawi](https://github.com/temawi), Google LLC
@@ -26,7 +24,9 @@ for general contribution guidelines.
2624
- [ericgribkoff](https://github.com/ericgribkoff)
2725
- [jiangtaoli2016](https://github.com/jiangtaoli2016)
2826
- [jtattermusch](https://github.com/jtattermusch)
27+
- [larry-safran](https://github.com/larry-safran)
2928
- [louiscryan](https://github.com/louiscryan)
29+
- [markb74](https://github.com/markb74)
3030
- [nicolasnoble](https://github.com/nicolasnoble)
3131
- [nmittler](https://github.com/nmittler)
3232
- [sanjaypujare](https://github.com/sanjaypujare)

MODULE.bazel

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module(
22
name = "grpc-java",
33
compatibility_level = 0,
44
repo_name = "io_grpc_grpc_java",
5-
version = "1.74.0-SNAPSHOT", # CURRENT_GRPC_VERSION
5+
version = "1.75.0-SNAPSHOT", # CURRENT_GRPC_VERSION
66
)
77

88
# GRPC_DEPS_START
@@ -46,36 +46,16 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
4646
]
4747
# GRPC_DEPS_END
4848

49+
bazel_dep(name = "bazel_jar_jar", version = "0.1.7")
4950
bazel_dep(name = "bazel_skylib", version = "1.7.1")
5051
bazel_dep(name = "googleapis", repo_name = "com_google_googleapis", version = "0.0.0-20240326-1c8d509c5")
51-
52-
# CEL Spec may be removed when cncf/xds MODULE is no longer using protobuf 27.x
53-
bazel_dep(name = "cel-spec", repo_name = "dev_cel", version = "0.15.0")
54-
bazel_dep(name = "grpc", repo_name = "com_github_grpc_grpc", version = "1.56.3.bcr.1")
5552
bazel_dep(name = "grpc-proto", repo_name = "io_grpc_grpc_proto", version = "0.0.0-20240627-ec30f58")
5653
bazel_dep(name = "protobuf", repo_name = "com_google_protobuf", version = "23.1")
5754
bazel_dep(name = "rules_cc", version = "0.0.9")
5855
bazel_dep(name = "rules_java", version = "5.3.5")
59-
bazel_dep(name = "rules_go", repo_name = "io_bazel_rules_go", version = "0.46.0")
6056
bazel_dep(name = "rules_jvm_external", version = "6.0")
6157
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
6258

63-
non_module_deps = use_extension("//:repositories.bzl", "grpc_java_repositories_extension")
64-
65-
use_repo(
66-
non_module_deps,
67-
"com_github_cncf_xds",
68-
"envoy_api",
69-
)
70-
71-
grpc_repo_deps_ext = use_extension("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_repo_deps_ext")
72-
73-
use_repo(
74-
grpc_repo_deps_ext,
75-
"com_envoyproxy_protoc_gen_validate",
76-
"opencensus_proto",
77-
)
78-
7959
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
8060

8161
maven.install(
@@ -202,7 +182,3 @@ maven.override(
202182
coordinates = "io.grpc:grpc-util",
203183
target = "@io_grpc_grpc_java//util",
204184
)
205-
206-
switched_rules = use_extension("@com_google_googleapis//:extensions.bzl", "switched_rules")
207-
208-
switched_rules.use_languages(java = True)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ For [Bazel](https://bazel.build), you can either
102102
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.73.0
103103

104104
Development snapshots are available in [Sonatypes's snapshot
105-
repository](https://oss.sonatype.org/content/repositories/snapshots/).
105+
repository](https://central.sonatype.com/repository/maven-snapshots/).
106106

107107
Generated Code
108108
--------------

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Tagging the Release
160160
repository can then be `released`, which will begin the process of pushing
161161
the new artifacts to Maven Central (the staging repository will be destroyed
162162
in the process). You can see the complete process for releasing to Maven
163-
Central on the [OSSRH site](https://central.sonatype.org/pages/releasing-the-deployment.html).
163+
Central on the [OSSRH site](https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#deploying).
164164

165165
10. We have containers for each release to detect compatibility regressions with
166166
old releases. Generate one for the new release by following the [GCR image

WORKSPACE

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,19 @@ load("//:repositories.bzl", "grpc_java_repositories")
2222

2323
grpc_java_repositories()
2424

25+
load("@bazel_jar_jar//:jar_jar.bzl", "jar_jar_repositories")
26+
27+
jar_jar_repositories()
28+
2529
load("@com_google_protobuf//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS")
2630
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
2731

2832
protobuf_deps()
2933

30-
load("@envoy_api//bazel:repositories.bzl", "api_dependencies")
31-
32-
api_dependencies()
33-
3434
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
3535

3636
switched_rules_by_language(
3737
name = "com_google_googleapis_imports",
38-
java = True,
3938
)
4039

4140
maven_install(

api/src/main/java/io/grpc/LoadBalancer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,10 @@ public void ignoreRefreshNameResolutionCheck() {
11891189
* Returns a {@link SynchronizationContext} that runs tasks in the same Synchronization Context
11901190
* as that the callback methods on the {@link LoadBalancer} interface are run in.
11911191
*
1192+
* <p>Work added to the synchronization context might not run immediately, so LB implementations
1193+
* must be careful to ensure that any assumptions still hold when it is executed. In particular,
1194+
* the LB might have been shut down or subchannels might have changed state.
1195+
*
11921196
* <p>Pro-tip: in order to call {@link SynchronizationContext#schedule}, you need to provide a
11931197
* {@link ScheduledExecutorService}. {@link #getScheduledExecutorService} is provided for your
11941198
* convenience.

api/src/main/java/io/grpc/Metadata.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
import com.google.common.annotations.VisibleForTesting;
2424
import com.google.common.base.Preconditions;
25+
import com.google.common.collect.Maps;
26+
import com.google.common.collect.Sets;
2527
import com.google.common.io.BaseEncoding;
2628
import com.google.common.io.ByteStreams;
2729
import java.io.ByteArrayInputStream;
@@ -32,8 +34,6 @@
3234
import java.util.Arrays;
3335
import java.util.BitSet;
3436
import java.util.Collections;
35-
import java.util.HashMap;
36-
import java.util.HashSet;
3737
import java.util.Iterator;
3838
import java.util.List;
3939
import java.util.Locale;
@@ -325,7 +325,7 @@ public Set<String> keys() {
325325
if (isEmpty()) {
326326
return Collections.emptySet();
327327
}
328-
Set<String> ks = new HashSet<>(size);
328+
Set<String> ks = Sets.newHashSetWithExpectedSize(size);
329329
for (int i = 0; i < size; i++) {
330330
ks.add(new String(name(i), 0 /* hibyte */));
331331
}
@@ -526,7 +526,7 @@ public void merge(Metadata other) {
526526
public void merge(Metadata other, Set<Key<?>> keys) {
527527
Preconditions.checkNotNull(other, "other");
528528
// Use ByteBuffer for equals and hashCode.
529-
Map<ByteBuffer, Key<?>> asciiKeys = new HashMap<>(keys.size());
529+
Map<ByteBuffer, Key<?>> asciiKeys = Maps.newHashMapWithExpectedSize(keys.size());
530530
for (Key<?> key : keys) {
531531
asciiKeys.put(ByteBuffer.wrap(key.asciiName()), key);
532532
}

api/src/main/java/io/grpc/NameResolver.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ public final void onAddresses(
239239
* {@link ResolutionResult#getAddressesOrError()} is empty, {@link #onError(Status)} will be
240240
* called.
241241
*
242+
* <p>Newer NameResolver implementations should prefer calling onResult2. This method exists to
243+
* facilitate older {@link Listener} implementations to migrate to {@link Listener2}.
244+
*
242245
* @param resolutionResult the resolved server addresses, attributes, and Service Config.
243246
* @since 1.21.0
244247
*/
@@ -248,16 +251,25 @@ public final void onAddresses(
248251
* Handles a name resolving error from the resolver. The listener is responsible for eventually
249252
* invoking {@link NameResolver#refresh()} to re-attempt resolution.
250253
*
254+
* <p>New NameResolver implementations should prefer calling onResult2 which will have the
255+
* address resolution error in {@link ResolutionResult}'s addressesOrError. This method exists
256+
* to facilitate older implementations using {@link Listener} to migrate to {@link Listener2}.
257+
*
251258
* @param error a non-OK status
252259
* @since 1.21.0
253260
*/
254261
@Override
255262
public abstract void onError(Status error);
256263

257264
/**
258-
* Handles updates on resolved addresses and attributes.
265+
* Handles updates on resolved addresses and attributes. Must be called from the same
266+
* {@link SynchronizationContext} available in {@link NameResolver.Args} that is passed
267+
* from the channel.
259268
*
260-
* @param resolutionResult the resolved server addresses, attributes, and Service Config.
269+
* @param resolutionResult the resolved server addresses or error in address resolution,
270+
* attributes, and Service Config or error
271+
* @return status indicating whether the resolutionResult was accepted by the listener,
272+
* typically the result from a load balancer.
261273
* @since 1.66
262274
*/
263275
public Status onResult2(ResolutionResult resolutionResult) {

binder/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ dependencies {
7272
androidTestImplementation testFixtures(project(':grpc-core'))
7373

7474
testFixturesImplementation libraries.guava.testlib
75+
testFixturesImplementation testFixtures(project(':grpc-core'))
7576
}
7677

7778
import net.ltgt.gradle.errorprone.CheckSeverity

0 commit comments

Comments
 (0)