Skip to content

Commit 1233254

Browse files
committed
Passing tests
Yes, that was a bug discovered in OutlierDetection (EnvoyServerProtoData). And yes, now XdsDepManager combines EAGs into a single endpoint.
1 parent f694711 commit 1233254

File tree

3 files changed

+236
-399
lines changed

3 files changed

+236
-399
lines changed

xds/src/main/java/io/grpc/xds/EnvoyServerProtoData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ static OutlierDetection fromEnvoyOutlierDetection(
328328
Integer minimumHosts = envoyOutlierDetection.hasSuccessRateMinimumHosts()
329329
? envoyOutlierDetection.getSuccessRateMinimumHosts().getValue() : null;
330330
Integer requestVolume = envoyOutlierDetection.hasSuccessRateRequestVolume()
331-
? envoyOutlierDetection.getSuccessRateMinimumHosts().getValue() : null;
331+
? envoyOutlierDetection.getSuccessRateRequestVolume().getValue() : null;
332332

333333
successRateEjection = SuccessRateEjection.create(stdevFactor, enforcementPercentage,
334334
minimumHosts, requestVolume);

xds/src/main/java/io/grpc/xds/XdsDependencyManager.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import io.grpc.xds.client.XdsClient;
4242
import io.grpc.xds.client.XdsClient.ResourceWatcher;
4343
import io.grpc.xds.client.XdsResourceType;
44+
import java.net.SocketAddress;
4445
import java.net.URI;
4546
import java.net.URISyntaxException;
4647
import java.util.ArrayList;
@@ -83,7 +84,7 @@ private enum TrackedWatcherTypeEnum {
8384

8485
private static final int MAX_CLUSTER_RECURSION_DEPTH = 16; // Specified by gRFC A37
8586

86-
static boolean enableLogicalDns = false;
87+
static boolean enableLogicalDns = true;
8788

8889
private final String listenerName;
8990
private final XdsClient xdsClient;
@@ -394,10 +395,13 @@ private static StatusOr<XdsEndpointResource.EdsUpdate> dnsToEdsUpdate(
394395
return StatusOr.fromStatus(dnsData.getStatus());
395396
}
396397

397-
List<Endpoints.LbEndpoint> endpoints = new ArrayList<>();
398+
List<SocketAddress> addresses = new ArrayList<>();
398399
for (EquivalentAddressGroup eag : dnsData.getValue()) {
399-
endpoints.add(Endpoints.LbEndpoint.create(eag, 1, true, dnsHostName, ImmutableMap.of()));
400+
addresses.addAll(eag.getAddresses());
400401
}
402+
EquivalentAddressGroup eag = new EquivalentAddressGroup(addresses);
403+
List<Endpoints.LbEndpoint> endpoints = ImmutableList.of(
404+
Endpoints.LbEndpoint.create(eag, 1, true, dnsHostName, ImmutableMap.of()));
401405
LocalityLbEndpoints lbEndpoints =
402406
LocalityLbEndpoints.create(endpoints, 1, 0, ImmutableMap.of());
403407
return StatusOr.fromValue(new XdsEndpointResource.EdsUpdate(

0 commit comments

Comments
 (0)