-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xds: Update error handling for ADS stream close and failure scenarios #11596
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making the PR back to draft, need to update unit tests.
…esponse from server
// close streams for various reasons during normal operation, such as load balancing or | ||
// underlying connection hitting its max connection age limit (see gRFC A9). | ||
if (!status.isOk()) { | ||
newStatus = Status.UNAVAILABLE.withDescription( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why isn't newStatus being set to Status.OK
? If you did that, then the if statement below and in XdsClientImpl could be simply (!newStatus.isOk()). Particularly for XdsClientImpl it would be much clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what I initially had.
After looking at Go's error handling for same, I changed it to return an error instead.
I think we need to differentiate ADS stream being closed with Status.OK
and being considered Status.OK
because it received a response as stated in gRFC A57.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could do Status.OK.withDescription(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. New status is Status.OK
when a ADS stream is closed with an error but a response has been received.
According to gRFC A57:
For
status == OK
, updated the new status toStatus.UNAVAILABLE
with description "ADS stream closed with OK before receiving a response".For
status != OK
, updated new status toStatus.OK
.Updated
handleStreamClosed
to clean up resources and report error to all watchers of resources that were subscribed to on that stream forstatus != OK
.