Skip to content

Conversation

@shivaspeaks
Copy link
Member

@shivaspeaks shivaspeaks commented Oct 27, 2025

Copy link
Contributor

@kannanjgithub kannanjgithub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sending what I could review today.

* Called to deliver a transient error that should not affect the watcher's use of any
* previously received resource.
*
* <p>Note that we expect that the implementer to:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment now applies to both methods since both methods take Status argument now.

type, resource);
respTimer = null;
onAbsent(null, activeCpc.getServerInfo());
respTimer = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why swap the order of these statements?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code was setting respTimer = null before calling onAbsent(), which caused the timeout context to be lost, resulting in a generic "does not exist" error.

The original for onAbsent method did not have a check for if (respTimer == null). It only looked at the serverInfo.resourceTimerIsTransientError() flag to decide between calling watcher.onError() or watcher.onResourceDoesNotExist(). It could not distinguish between a timeout and other "not found" conditions.

logger.log(XdsLogLevel.WARNING, "No working fallback XDS Servers found from {0}",
activeCpClient.getServerInfo().target());
activeCpc.getServerInfo().target());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes above here seem unnecessary?

executor.execute(() -> {
try {
notifyWatcher(watcher, data);
watcher.onResourceChanged(update); // Call the new method
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the comment as we are passing StatusOr argument.

continue;
}
if (subscriber.hasResult()) {
subscriber.onError(status, null); // This will become an onAmbientError
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the handling to call either onDataChanged or onAmbientError happens in ResourceSubscriber.onError, why not simply call it? You are only calling if subscriber.hasResult() is true. What if when it is false? Previously the onError was getting called in that case but not now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants