-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: fix a concurrency issue in CSDS ClientStatus responses #8795
Conversation
Fixes #8642 |
@Override | ||
Map<String, ResourceMetadata> getSubscribedResourcesMetadata(ResourceType type) { | ||
Map<ResourceType, Map<String, ResourceMetadata>> getSubscribedResourcesMetadataSnapshot() { |
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.
Note: this was needed because I discovered this test to be false negative, see PR description:
Fix false negative in fetchClientConfig_unexpectedException,
where expected exception was actually caused by missing
bootstrap data, not by throwing error from the local
class implementation.
Fixes an issue with ClientXdsClient.getSubscribedResourcesMetadata() executed out of shared synchronization context, and leading to: - each individual config dump containing outdated data when an xDS resource is updated during CsdsService preparing the response - config dumps for different services being out-of-sync with each other when any of the related xDS resources is updated during CsdsService preparing the response The fix replaces getSubscribedResourcesMetadata(ResourceType type) with atomic getSubscribedResourcesMetadataSnapshot() returning a snapshot of all resources for each type as they are at the moment of a CSDS request.
e0a40c7
to
b3a3914
Compare
Ready for another review. |
Fixes an issue with ClientXdsClient.getSubscribedResourcesMetadata()
executed out of shared synchronization context, and leading to:
an xDS resource is updated during CsdsService preparing the response
other when any of the related xDS resources is updated during
CsdsService preparing the response
The fix replaces getSubscribedResourcesMetadata(ResourceType type)
with atomic getSubscribedResourcesMetadataSnapshot() returning
a snapshot of all resources for each type as they are
at the moment of a CSDS request.
Fix false negative in fetchClientConfig_unexpectedException,
where expected exception was actually caused by missing
bootstrap data, not by throwing error from the local
class implementation.