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

Add new retry policy adjustment method #1824

Merged
merged 5 commits into from
Sep 24, 2024
Merged

Conversation

jguerra
Copy link
Contributor

@jguerra jguerra commented Sep 16, 2024

Adds a more specific adjustRetryPolicyIfNeeded for cases when we have a HttpResponse from the origin (e.g. origin returned 503)

@@ -77,4 +80,8 @@ RequestAttempt newRequestAttempt(
IClientConfig getClientConfig();

Registry getSpectatorRegistry();

default void adjustRetryPolicyIfNeeded(HttpRequestMessage zuulRequest, @Nullable HttpResponse response) {
adjustRetryPolicyIfNeeded(zuulRequest);
Copy link
Collaborator

@argha-c argha-c Sep 17, 2024

Choose a reason for hiding this comment

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

Can we avoid this overload by using an || on the original method and a new one derived from the response?
That feels cleaner imo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a new (awkwardly named) method originRetryPolicyAdjustmentIfNeeded

Copy link
Collaborator

Choose a reason for hiding this comment

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

Naming is hard. It just needs to convey that the adjustment is inferred by the origin response.

@jguerra jguerra merged commit fc74635 into master Sep 24, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants