xds/resolver: fix flaky test TestResolverRemovedWithRPCs with a workaround #7804
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #7799
Once resources are removed from the management server (as part of this test), the xDS client used by the resolver will see discovery responses from the server with no resources. This will trigger a resource-not-found error on the resolver when the listener resource is missing in the response from the server. This will cause the resolver to stop watching the route configuration resource.
The test then re-adds these resources to the management server, and these two events can race and can lead to the management server sending the route configuration too early to the client (which at that point thinks that it has not requested for that resource, and hence drops it on the floor).
And later when the client requests for the same route configuration, the server does not send it because it thinks that it has already sent it to the client. See #7799 (comment) for a sequence of events where this leads to a problem.
The workaround is to continuously push a new version to the server with the same resources so that eventually, the route configuration is pushed to the client when it is in a state where it can accept it.
RELEASE NOTES: none