Skip to content

Commit

Permalink
Manually check if state of the world to handle resources replaced
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiitk committed Jul 8, 2022
1 parent 3e79062 commit 0f9fdd9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xds/src/main/java/io/grpc/xds/ClientXdsClient.java
Expand Up @@ -2587,8 +2587,12 @@ void onAbsent() {
return;
}

// Ignore deletion when the server instructs to, and the resource is reusable.
if (data != null && serverInfo != null && serverInfo.ignoreResourceDeletion()) {
// Ignore deletion of State of the World resources when this feature is on,
// and the resource is reusable.
boolean ignoreResourceDeletionEnabled =
serverInfo != null && serverInfo.ignoreResourceDeletion();
boolean isStateOfTheWorld = (type == ResourceType.LDS || type == ResourceType.CDS);
if (ignoreResourceDeletionEnabled && isStateOfTheWorld && data != null) {
if (!resourceDeletionIgnored) {
logger.log(XdsLogLevel.WARNING,
"xds server {0}: ignoring deletion for resource type {1} name {2}}",
Expand Down

0 comments on commit 0f9fdd9

Please sign in to comment.