Skip to content
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

Move retry code into its own filter in the DynamicFilter stack #25820

Merged
merged 10 commits into from
Mar 31, 2021

Conversation

markdroth
Copy link
Member

@markdroth markdroth commented Mar 25, 2021

This is the restructuring of the client channel filter that I mentioned in #25791. The main change is to move the retry code to its own filter in the DynamicFilter stack, but it also moves the definition of the client channel filter's channel data class into the .h file, which makes it easier to interact with it from other places.

Prior to this PR, the final filter in the DynamicFilter stack was always the DynamicTerminationFilter, which would check whether retries were enabled and then create either a LoadBalancedCall or a RetryingCall (which would internally create a LoadBalancedCall for each retry attempt). In other words, the flow was one of these two, depending on whether retries were enabled:

Retries enabled: DynamicFilters -> DynamicTerminationFilter -> RetryingCall -> LoadBalancedCall
Retries disabled: DynamicFilters -> DynamicTerminationFilter -> LoadBalancedCall

This PR moves the RetryingCall code into an alternative version of the DynamicTerminationFilter that performs retries, and the client channel filter decides whether to use the DynamicTerminationFilter or the RetryFilter based on whether retries are enabled. So the flows now look like this:

Retries enabled: DynamicFilters -> RetryFilter -> LoadBalancedCall
Retries disabled: DynamicFilters -> DynamicTerminationFilter -> LoadBalancedCall

Please let me know if you have any questions.

@markdroth markdroth added the release notes: no Indicates if PR should not be in release notes label Mar 25, 2021
@markdroth markdroth requested a review from veblush March 25, 2021 23:25
Copy link
Contributor

@veblush veblush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the refactoring. I mostly focused on the code structure rather than its implementation, assuming this doesn't change retry logic much.

@markdroth
Copy link
Member Author

Known issues: #25856

@markdroth markdroth merged commit 3f19333 into grpc:master Mar 31, 2021
@markdroth markdroth deleted the retry_filter branch March 31, 2021 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: no Indicates if PR should not be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants