Skip to content

Commit

Permalink
Restore logic for identifying resources to request to include authori…
Browse files Browse the repository at this point in the history
…ties for which the currentCpc is a fallback server from the desired one.

Remove added whitespace and unnecessary check for xdsclient being shutdown (won't be called if cpc .
  • Loading branch information
larry-safran committed Nov 20, 2024
1 parent cdc68d9 commit c5d8f2e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion xds/src/main/java/io/grpc/xds/client/XdsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ void handleResourceResponse(
void handleStreamClosed(Status error, boolean shouldTryFallback);

/** Called when the ADS stream has established communication with the xds server.
* Is expected do manage the ControlPlanClients and cache updates associated with
* Is expected to manage the ControlPlanClients and cache updates associated with
* Moving to or from a fallback server.
*
* <p>Must be synchronized.
Expand Down
10 changes: 5 additions & 5 deletions xds/src/main/java/io/grpc/xds/client/XdsClientImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ public Collection<String> getSubscribedResources(
return null;
}

Collection<String> authorities = getActiveAuthorities(targetCpc);
// This should include all of the authorities that targetCpc or a fallback from it is serving
List<String> authorities = activatedCpClients.entrySet().stream()
.filter(entry -> entry.getValue().contains(targetCpc))
.map(Map.Entry::getKey)
.collect(Collectors.toList());

Map<String, ResourceSubscriber<? extends ResourceUpdate>> resources =
resourceSubscribers.getOrDefault(type, Collections.emptyMap());
Expand Down Expand Up @@ -987,10 +991,6 @@ public void handleStreamClosed(Status status, boolean shouldTryFallback) {
public void handleStreamRestarted(ServerInfo serverInfo) {
syncContext.throwIfNotInThisSynchronizationContext();

if (isShutDown()) {
return;
}

ControlPlaneClient controlPlaneClient = serverCpClientMap.get(serverInfo);
if (controlPlaneClient == null) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ <ReqT, RespT> StreamingCall<ReqT, RespT> createStreamingCall(
MethodDescriptor.Marshaller<RespT> respMarshaller);

void shutdown();

}

/**
Expand Down

0 comments on commit c5d8f2e

Please sign in to comment.