-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
xdsclient: update watcher API as per gRFC A88 #7977
base: master
Are you sure you want to change the base?
Conversation
8d198b7
to
a9b45c0
Compare
4009e3e
to
57dbf23
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7977 +/- ##
==========================================
+ Coverage 82.28% 82.45% +0.17%
==========================================
Files 381 388 +7
Lines 38539 39048 +509
==========================================
+ Hits 31712 32198 +486
+ Misses 5535 5530 -5
- Partials 1292 1320 +28
|
43c9adb
to
89f475a
Compare
89f475a
to
a48b5bb
Compare
385ff44
to
1fdeb0d
Compare
@easwars ptal |
@@ -194,7 +194,7 @@ func (a *authority) handleADSStreamFailure(serverConfig *bootstrap.ServerConfig, | |||
for watcher := range state.watchers { | |||
watcher := watcher | |||
a.watcherCallbackSerializer.TrySchedule(func(context.Context) { | |||
watcher.OnError(xdsresource.NewErrorf(xdsresource.ErrorTypeConnection, "xds: error received from xDS stream: %v", err), func() {}) | |||
watcher.OnAmbientError(xdsresource.NewErrorf(xdsresource.ErrorTypeConnection, "xds: error received from xDS stream: %v", err), func() {}) |
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.
Based on the PR description, for the following two cases:
- xDS channel reports TRANSIENT_FAILURE |
- ADS stream terminates without receiving a response
the old behavior was to callOnError()
, while the new behavior is to callOnResourceChanged(status)
if resource NOT already cached, andOnAmbientError(status)
otherwise.
But, we are only calling the latter here. Am I missing something?
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.
yeah so, since we have already checked for ErrTypeStreamFailedAfterRecv
above, the only case left is un cached which means this should always be OnResourceChanged()
? or we should look up the cache and call accordingly?
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.
ErrTypeStreamFailedAfterRecv
just means that some message was received on the stream before it broke. It does not say anything specific to the resource under question here.
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.
oh i see. I thought ErrTypeStreamFailedAfterRecv
meant to state that stream failure happened but we have received the resource once before.
This came up during some other discussion with @dfawley.
|
I will wait for #8042 before making further changes to this PR since that has the discussion on decision |
This is the first part of implementing gRFC A88 (grpc/proposal#466).
This introduces the new watcher API but does not change any of the existing behavior. This table summarizes the API changes and behavior for each case:
OnResourceDoesNotExist()
OnResourceChanged(NOT_FOUND)
OnResourceDoesNotExist()
OnResourceChanged(NOT_FOUND)
OnError()
OnResourceChanged(status)
if resource NOT already cached;OnAmbientError(status)
otherwiseOnError()
OnResourceChanged(status)
if resource NOT already cached;OnAmbientError(status)
otherwiseOnError()
OnResourceChanged(status)
if resource NOT already cached;OnAmbientError(status)
otherwiseOnUpdate(resource)
OnResourceChanged(resource)
RELEASE NOTES: