xds: remove the env var GRPC_XDS_EXPERIMENTAL_NEW_SERVER_API (#7914)

This commit is contained in:
sanjaypujare 2021-02-23 11:15:22 -08:00 committed by GitHub
parent 6fb84bc61c
commit bfc67bfcf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 10 deletions

View File

@ -70,11 +70,10 @@ final class ServerXdsClient extends AbstractXdsClient {
ScheduledExecutorService timeService,
BackoffPolicy.Provider backoffPolicyProvider,
Supplier<Stopwatch> stopwatchSupplier,
boolean useNewApiForListenerQuery,
String instanceIp,
String grpcServerResourceId) {
super(channel, useProtocolV3, node, timeService, backoffPolicyProvider, stopwatchSupplier);
this.useNewApiForListenerQuery = useProtocolV3 && useNewApiForListenerQuery;
this.useNewApiForListenerQuery = useProtocolV3;
this.instanceIp = (instanceIp != null ? instanceIp : "0.0.0.0");
this.grpcServerResourceId = grpcServerResourceId;
}

View File

@ -70,10 +70,6 @@ public final class XdsClientWrapperForServerSds {
private static final TimeServiceResource timeServiceResource =
new TimeServiceResource("GrpcServerXdsClient");
@VisibleForTesting
static boolean experimentalNewServerApiEnvVar = Boolean.parseBoolean(
System.getenv("GRPC_XDS_EXPERIMENTAL_NEW_SERVER_API"));
private EnvoyServerProtoData.Listener curListener;
@SuppressWarnings("unused")
@Nullable private XdsClient xdsClient;
@ -115,7 +111,7 @@ public final class XdsClientWrapperForServerSds {
Grpc.newChannelBuilder(serverInfo.getTarget(), serverInfo.getChannelCredentials())
.keepAliveTime(5, TimeUnit.MINUTES).build();
timeService = SharedResourceHolder.get(timeServiceResource);
newServerApi = serverInfo.isUseProtocolV3() && experimentalNewServerApiEnvVar;
newServerApi = serverInfo.isUseProtocolV3();
String grpcServerResourceId = bootstrapInfo.getGrpcServerResourceId();
if (newServerApi && grpcServerResourceId == null) {
throw new IOException("missing grpc_server_resource_name_id value in xds bootstrap");
@ -128,7 +124,6 @@ public final class XdsClientWrapperForServerSds {
timeService,
new ExponentialBackoffPolicy.Provider(),
GrpcUtil.STOPWATCH_SUPPLIER,
experimentalNewServerApiEnvVar,
"0.0.0.0",
grpcServerResourceId);
start(xdsClientImpl);

View File

@ -186,7 +186,7 @@ public class ServerXdsClientNewServerApiTest {
xdsClient =
new ServerXdsClient(channel, true, NODE,
fakeClock.getScheduledExecutorService(), backoffPolicyProvider,
fakeClock.getStopwatchSupplier(), true, INSTANCE_IP, "test/value");
fakeClock.getStopwatchSupplier(), INSTANCE_IP, "test/value");
// Only the connection to management server is established, no RPC request is sent until at
// least one watcher is registered.
assertThat(responseObservers).isEmpty();

View File

@ -189,7 +189,7 @@ public class ServerXdsClientTest {
xdsClient =
new ServerXdsClient(channel, /* useProtocolV3= */ false, NODE,
fakeClock.getScheduledExecutorService(), backoffPolicyProvider,
fakeClock.getStopwatchSupplier(), false, INSTANCE_IP, "grpc/server");
fakeClock.getStopwatchSupplier(), INSTANCE_IP, "grpc/server");
// Only the connection to management server is established, no RPC request is sent until at
// least one watcher is registered.
assertThat(responseObservers).isEmpty();