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 retry policy config #360

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

alex268
Copy link
Member

@alex268 alex268 commented Jan 23, 2025

Fixes #81

@alex268 alex268 requested a review from pnv1 January 23, 2025 18:37
@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 80.17241% with 23 lines in your changes missing coverage. Please review.

Project coverage is 58.40%. Comparing base (b3125bd) to head (be69b0d).

Files with missing lines Patch % Lines
...in/java/tech/ydb/topic/impl/GrpcStreamRetrier.java 58.82% 15 Missing and 6 partials ⚠️
...n/java/tech/ydb/topic/settings/ReaderSettings.java 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #360      +/-   ##
============================================
+ Coverage     57.72%   58.40%   +0.67%     
- Complexity     2055     2111      +56     
============================================
  Files           311      313       +2     
  Lines         12550    12628      +78     
  Branches       1245     1252       +7     
============================================
+ Hits           7245     7375     +130     
+ Misses         4712     4658      -54     
- Partials        593      595       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alex268
Copy link
Member Author

alex268 commented Jan 29, 2025

Fixes #81

@alex268 alex268 requested a review from pnv1 January 29, 2025 10:43
Copy link

@Eistern Eistern left a comment

Choose a reason for hiding this comment

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

LGTM

It would be nice have a test case for non-retryable error appearing after write() call completion to check what would happen with the returned CompletableFuture.

Also, there is one small thing that could be polished.
Currently, there are two ways of disabling retries: one is by returning null from RetryConfig.getStatusRetryPolicy and the other is returning a negative number from RetryPolicy.nextRetryMs. Maybe we should keep only one way (right now I'm in favor of the first approach).

@alex268
Copy link
Member Author

alex268 commented Jan 30, 2025

Maybe we should keep only one way (right now I'm in favor of the first approach).

It was a conscious decision. Two different ways to reject the next retry describe two different situations: first if the unretryable error appears, and second if retry is rejected by policy, such as exceeding the maximum count of retries or the operation timeout. It helps us to debug different problems

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.

Add custom retry policy support to Topic reads & writes
4 participants