Skip to content

Commit b8594e8

Browse files
authored
Merge branch 'grpc:master' into bazel-binder-3
2 parents 58f7062 + ec0a9c9 commit b8594e8

42 files changed

Lines changed: 1806 additions & 146 deletions

Some content is hidden

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

MODULE.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
2020
"com.google.re2j:re2j:1.8",
2121
"com.google.s2a.proto.v2:s2a-proto:0.1.3",
2222
"com.google.truth:truth:1.4.5",
23+
"dev.cel:runtime:0.12.0",
24+
"dev.cel:protobuf:0.12.0",
25+
"dev.cel:common:0.12.0",
2326
"com.squareup.okhttp:okhttp:2.7.5",
2427
"com.squareup.okio:okio:2.10.0", # 3.0+ needs swapping to -jvm; need work to avoid flag-day
2528
"io.netty:netty-buffer:4.1.133.Final",
@@ -56,7 +59,7 @@ ANDROID_ARTIFACTS = [
5659
bazel_dep(name = "abseil-cpp", version = "20250512.1")
5760
bazel_dep(name = "bazel_jar_jar", version = "0.1.11.bcr.1")
5861
bazel_dep(name = "bazel_skylib", version = "1.7.1")
59-
bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5", repo_name = "com_google_googleapis")
62+
bazel_dep(name = "googleapis", version = "0.0.0-20260514-1dbb1a14", repo_name = "com_google_googleapis")
6063
bazel_dep(name = "grpc-proto", version = "0.0.0-20240627-ec30f58.bcr.1", repo_name = "io_grpc_grpc_proto")
6164
bazel_dep(name = "protobuf", version = "33.4", repo_name = "com_google_protobuf")
6265
bazel_dep(name = "rules_android", version = "0.7.2")

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package io.grpc;
1818

19-
import javax.annotation.concurrent.ThreadSafe;
2019

2120
/**
2221
* A virtual connection to a conceptual endpoint, to perform RPCs. A channel is free to have zero or
@@ -29,8 +28,9 @@
2928
* implementations using {@link ClientInterceptor}. It is expected that most application
3029
* code will not use this class directly but rather work with stubs that have been bound to a
3130
* Channel that was decorated during application initialization.
31+
*
32+
* <p>This class is thread-safe.
3233
*/
33-
@ThreadSafe
3434
public abstract class Channel {
3535
/**
3636
* Create a {@link ClientCall} to the remote operation specified by the given

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616

1717
package io.grpc;
1818

19-
import javax.annotation.concurrent.ThreadSafe;
2019

2120
/**
2221
* A Channel-specific logger provided by GRPC library to {@link LoadBalancer} implementations.
2322
* Information logged here goes to <strong>Channelz</strong>, and to the Java logger of this class
2423
* as well.
24+
*
25+
* <p>This class is thread-safe.
2526
*/
2627
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/5029")
27-
@ThreadSafe
2828
public abstract class ChannelLogger {
2929
/**
3030
* Log levels. See the table below for the mapping from the ChannelLogger levels to Channelz

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package io.grpc;
1818

19-
import javax.annotation.concurrent.ThreadSafe;
2019

2120
/**
2221
* Interface for intercepting outgoing calls before they are dispatched by a {@link Channel}.
@@ -37,8 +36,10 @@
3736
* without completing the previous ones first. Refer to the
3837
* {@link io.grpc.ClientCall.Listener ClientCall.Listener} docs for more details regarding thread
3938
* safety of the returned listener.
39+
*
40+
* <p>This is thread-safe and should be considered
41+
* for the errorprone ThreadSafe annotation in the future.
4042
*/
41-
@ThreadSafe
4243
public interface ClientInterceptor {
4344
/**
4445
* Intercept {@link ClientCall} creation by the {@code next} {@link Channel}.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

2121
import com.google.common.base.MoreObjects;
22-
import javax.annotation.concurrent.ThreadSafe;
2322

2423
/**
2524
* {@link StreamTracer} for the client-side.
25+
*
26+
* <p>This class is thread-safe.
2627
*/
2728
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/2861")
28-
@ThreadSafe
2929
public abstract class ClientStreamTracer extends StreamTracer {
3030
/**
3131
* Indicates how long the call was delayed, in nanoseconds, due to waiting for name resolution

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
import java.util.Collections;
2020
import java.util.List;
2121
import javax.annotation.Nullable;
22-
import javax.annotation.concurrent.ThreadSafe;
2322

2423
/**
2524
* Registry of services and their methods used by servers to dispatching incoming calls.
25+
*
26+
* <p>This class is thread-safe.
2627
*/
27-
@ThreadSafe
2828
public abstract class HandlerRegistry {
2929

3030
/**

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import javax.annotation.Nullable;
3333
import javax.annotation.concurrent.Immutable;
3434
import javax.annotation.concurrent.NotThreadSafe;
35-
import javax.annotation.concurrent.ThreadSafe;
3635

3736
/**
3837
* A pluggable component that receives resolved addresses from {@link NameResolver} and provides the
@@ -64,7 +63,7 @@
6463
* allows implementations to schedule tasks to be run in the same Synchronization Context, with or
6564
* without a delay, thus those tasks don't need to worry about synchronizing with the balancer
6665
* methods.
67-
*
66+
*
6867
* <p>However, the actual running thread may be the network thread, thus the following rules must be
6968
* followed to prevent blocking or even dead-locking in a network:
7069
*
@@ -417,7 +416,7 @@ public void handleSubchannelState(
417416
*
418417
* <p>This method should always return a constant value. It's not specified when this will be
419418
* called.
420-
*
419+
*
421420
* <p>Note that this method is only called when implementing {@code handleResolvedAddresses()}
422421
* instead of {@code acceptResolvedAddresses()}.
423422
*
@@ -450,7 +449,6 @@ public void requestConnection() {}
450449
*
451450
* @since 1.2.0
452451
*/
453-
@ThreadSafe
454452
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1771")
455453
public abstract static class SubchannelPicker {
456454
/**
@@ -640,7 +638,7 @@ private PickResult(
640638
* stream is created at all in some cases.
641639
* @since 1.3.0
642640
*/
643-
// TODO(shivaspeaks): Need to deprecate old APIs and create new ones,
641+
// TODO(shivaspeaks): Need to deprecate old APIs and create new ones,
644642
// per https://github.com/grpc/grpc-java/issues/12662.
645643
public static PickResult withSubchannel(
646644
Subchannel subchannel, @Nullable ClientStreamTracer.Factory streamTracerFactory) {
@@ -1030,9 +1028,10 @@ public String toString() {
10301028
/**
10311029
* Provides essentials for LoadBalancer implementations.
10321030
*
1031+
* <p>This class is thread-safe.
1032+
*
10331033
* @since 1.2.0
10341034
*/
1035-
@ThreadSafe
10361035
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1771")
10371036
public abstract static class Helper {
10381037
/**
@@ -1332,7 +1331,7 @@ public MetricRecorder getMetricRecorder() {
13321331
}
13331332

13341333
/**
1335-
* A logical connection to a server, or a group of equivalent servers represented by an {@link
1334+
* A logical connection to a server, or a group of equivalent servers represented by an {@link
13361335
* EquivalentAddressGroup}.
13371336
*
13381337
* <p>It maintains at most one physical connection (aka transport) for sending new RPCs, while
@@ -1551,9 +1550,10 @@ public interface SubchannelStateListener {
15511550
/**
15521551
* Factory to create {@link LoadBalancer} instance.
15531552
*
1553+
* <p>This class is thread-safe.
1554+
*
15541555
* @since 1.2.0
15551556
*/
1556-
@ThreadSafe
15571557
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1771")
15581558
public abstract static class Factory {
15591559
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
package io.grpc;
1818

1919
import java.util.concurrent.TimeUnit;
20-
import javax.annotation.concurrent.ThreadSafe;
2120

2221
/**
2322
* A {@link Channel} that provides lifecycle management.
23+
*
24+
* <p>This class is thread-safe.
2425
*/
25-
@ThreadSafe
2626
public abstract class ManagedChannel extends Channel {
2727
/**
2828
* Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import java.util.concurrent.ScheduledExecutorService;
3636
import javax.annotation.Nullable;
3737
import javax.annotation.concurrent.Immutable;
38-
import javax.annotation.concurrent.ThreadSafe;
3938

4039
/**
4140
* A pluggable component that resolves a target {@link URI} and return addresses to the caller.
@@ -78,7 +77,7 @@ public abstract class NameResolver {
7877
* Starts the resolution. The method is not supposed to throw any exceptions. That might cause the
7978
* Channel that the name resolver is serving to crash. Errors should be propagated
8079
* through {@link Listener#onError}.
81-
*
80+
*
8281
* <p>An instance may not be started more than once, by any overload of this method, even after
8382
* an intervening call to {@link #shutdown}.
8483
*
@@ -114,7 +113,7 @@ public void onResult(ResolutionResult resolutionResult) {
114113
* Starts the resolution. The method is not supposed to throw any exceptions. That might cause the
115114
* Channel that the name resolver is serving to crash. Errors should be propagated
116115
* through {@link Listener2#onError}.
117-
*
116+
*
118117
* <p>An instance may not be started more than once, by any overload of this method, even after
119118
* an intervening call to {@link #shutdown}.
120119
*
@@ -215,10 +214,11 @@ public NameResolver newNameResolver(Uri targetUri, final Args args) {
215214
*
216215
* <p>All methods are expected to return quickly.
217216
*
217+
* <p>This interface is thread-safe.
218+
*
218219
* @since 1.0.0
219220
*/
220221
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1770")
221-
@ThreadSafe
222222
public interface Listener {
223223
/**
224224
* Handles updates on resolved addresses and attributes.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
import java.util.Collections;
2222
import java.util.List;
2323
import java.util.concurrent.TimeUnit;
24-
import javax.annotation.concurrent.ThreadSafe;
2524

2625
/**
2726
* Server for listening for and dispatching incoming calls. It is not expected to be implemented by
2827
* application code or interceptors.
28+
*
29+
* <p>This class is thread-safe.
2930
*/
30-
@ThreadSafe
3131
public abstract class Server {
3232

3333
/**

0 commit comments

Comments
 (0)