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

Call retry callback on retry #700

Merged
merged 4 commits into from
Mar 14, 2024
Merged

Call retry callback on retry #700

merged 4 commits into from
Mar 14, 2024

Conversation

fredr
Copy link
Contributor

@fredr fredr commented Mar 12, 2024

Changes

Call the on retry callback on retry rather than on failure.
Fixes #699

This will change so that the callback will only be called when retrying, and never with attempt = 0 (because the first attempt is not a retry). Previously it was called when any attempt failed, even if there where no retries.

Verification

I have tested this patch in our local environment where I've performed a load test to provoke some retries, and it now get triggered as I would expect, only on retries.

@fredr fredr marked this pull request as ready for review March 13, 2024 09:56
Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

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

Thanks for the fix, do you think you could modify the tests to assert this new behavior too? Thanks!

@fredr
Copy link
Contributor Author

fredr commented Mar 14, 2024

NP, Thanks for reviewing! I've added a test for checking that the callback doesn't run for non retriable errors, is there anything else you wound want me to add a case for?

Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

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

LGTM!

@johanbrandhorst johanbrandhorst merged commit 3834477 into grpc-ecosystem:main Mar 14, 2024
5 checks passed
@fredr fredr deleted the fix-retry-callback branch March 15, 2024 07:55
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.

Use retry hooks for adding retry metrics
2 participants