xds: Fix XDS control plane client retry timer backoff duration when connection closes after results are received#11766
Merged
larry-safran merged 2 commits intogrpc:masterfrom Dec 19, 2024
Merged
Conversation
Member
|
It appears this is using the connection-style backoff, which does indeed start the timer at the start of the previous attempt. https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md#proposed-backoff-algorithm |
Member
|
Nit: include |
Member
|
And in this case the title should also say "xds client" in some fashion. The title is not clear as-is. |
…he delay calculation logic.
ejona86
approved these changes
Dec 19, 2024
Member
danielzhaotongliu
approved these changes
Dec 19, 2024
| // Reset the backoff sequence if had received a response, or backoff sequence | ||
| // has never been initialized. | ||
| retryBackoffPolicy = backoffPolicyProvider.get(); | ||
| stopwatch.reset(); |
Collaborator
There was a problem hiding this comment.
Quick question for my understanding, StopWatch itself is not a thread-safe class and requires external synchronization, but in the control plane client it is thread safe because we run it in the synchronization context?
Member
There was a problem hiding this comment.
Yes. We rely heavily on synchronization context.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The backoffPolicy was calculating time since last attempt, but if the stream had been successfully connected and received responses it should delay from the current time (i.e. reset the stopwatch). Changed test so that stopwatch wasn't always 0, which masked the problem.