Skip to content

Commit b769f96

Browse files
committed
alts: Remove dep on grpclb
There are no longer any users of grpclb on directpath, so remove the special-casing logic to choose between TLS and ALTS for grpclb-provided backends. Removing the grpclb dep can speed channel startup, as grpclb's DNS resolver does SRV lookups which are no longer needed.
1 parent ea74446 commit b769f96

File tree

5 files changed

+1
-16
lines changed

5 files changed

+1
-16
lines changed

alts/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ java_library(
1313
":handshaker_java_proto",
1414
"//api",
1515
"//core:internal",
16-
"//grpclb",
1716
"//netty",
1817
"//stub",
1918
"@com_google_protobuf//:protobuf_java",

alts/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ dependencies {
1414
implementation project(':grpc-auth'),
1515
project(':grpc-core'),
1616
project(":grpc-context"), // Override google-auth dependency with our newer version
17-
project(':grpc-grpclb'),
1817
project(':grpc-protobuf'),
1918
project(':grpc-stub'),
2019
libraries.protobuf.java,
2120
libraries.conscrypt,
22-
libraries.guava.jre, // JRE required by protobuf-java-util from grpclb
2321
libraries.google.auth.oauth2Http
2422
def nettyDependency = implementation project(':grpc-netty')
2523

alts/src/main/java/io/grpc/alts/internal/AltsProtocolNegotiator.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import io.grpc.SecurityLevel;
3131
import io.grpc.Status;
3232
import io.grpc.alts.internal.RpcProtocolVersionsUtil.RpcVersionsCheckResult;
33-
import io.grpc.grpclb.GrpclbConstants;
3433
import io.grpc.internal.ObjectPool;
3534
import io.grpc.netty.GrpcHttp2ConnectionHandler;
3635
import io.grpc.netty.InternalProtocolNegotiator;
@@ -299,9 +298,7 @@ public ChannelHandler newHandler(GrpcHttp2ConnectionHandler grpcHandler) {
299298
isXdsDirectPath = isDirectPathCluster(
300299
grpcHandler.getEagAttributes().get(clusterNameAttrKey));
301300
}
302-
if (grpcHandler.getEagAttributes().get(GrpclbConstants.ATTR_LB_ADDR_AUTHORITY) != null
303-
|| grpcHandler.getEagAttributes().get(GrpclbConstants.ATTR_LB_PROVIDED_BACKEND) != null
304-
|| isXdsDirectPath) {
301+
if (isXdsDirectPath) {
305302
TsiHandshaker handshaker =
306303
handshakerFactory.newHandshaker(grpcHandler.getAuthority(), negotiationLogger);
307304
NettyTsiHandshaker nettyHandshaker = new NettyTsiHandshaker(handshaker);

alts/src/test/java/io/grpc/alts/internal/GoogleDefaultProtocolNegotiatorTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import io.grpc.ChannelLogger;
3030
import io.grpc.ChannelLogger.ChannelLogLevel;
3131
import io.grpc.ManagedChannel;
32-
import io.grpc.grpclb.GrpclbConstants;
3332
import io.grpc.inprocess.InProcessChannelBuilder;
3433
import io.grpc.internal.ObjectPool;
3534
import io.grpc.netty.GrpcHttp2ConnectionHandler;
@@ -95,13 +94,6 @@ public void tearDown() {
9594
@Nullable
9695
abstract Attributes.Key<String> getClusterNameAttrKey();
9796

98-
@Test
99-
public void altsHandler_lbProvidedBackend() {
100-
Attributes attrs =
101-
Attributes.newBuilder().set(GrpclbConstants.ATTR_LB_PROVIDED_BACKEND, true).build();
102-
subtest_altsHandler(attrs);
103-
}
104-
10597
@Test
10698
public void tlsHandler_emptyAttributes() {
10799
subtest_tlsHandler(Attributes.EMPTY);

gcp-observability/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ dependencies {
5959
project(path: ':grpc-alts', configuration: 'shadow'),
6060
project(':grpc-auth'), // Align grpc versions
6161
project(':grpc-core'), // Align grpc versions
62-
project(':grpc-grpclb'), // Align grpc versions
6362
project(':grpc-services'), // Align grpc versions
6463
libraries.animalsniffer.annotations, // Use our newer version
6564
libraries.auto.value.annotations, // Use our newer version

0 commit comments

Comments
 (0)