-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
br: refactor br cli backoff logic #54644
Conversation
Skipping CI for Draft Pull Request. |
Hi @Tristan1900. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
tests to be fixed |
bc730cc
to
eeb8f5a
Compare
eeb8f5a
to
81234e3
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #54644 +/- ##
================================================
+ Coverage 72.8314% 74.8428% +2.0114%
================================================
Files 1677 1722 +45
Lines 463934 472924 +8990
================================================
+ Hits 337890 353950 +16060
+ Misses 105166 96868 -8298
- Partials 20878 22106 +1228
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest lgtm
br/pkg/utils/backoff.go
Outdated
isRetryErrFunc := buildIsRetryErrFunc(retryErrs, grpcRetryCodes) | ||
isNonRetryErrFunc := buildIsNonRetryErrFunc(nonRetryErrs) | ||
|
||
return newBackoffStrategy(maxRetry, delayTime, maxDelayTime, errContext, isRetryErrFunc, isNonRetryErrFunc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you replace this constructor with functional options or builder pattern?
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
33fa670
to
1cc3695
Compare
@@ -251,10 +240,6 @@ func (r *RPCResult) StrategyForRetryStoreError() RetryStrategy { | |||
} | |||
|
|||
func (r *RPCResult) StrategyForRetryGoError() RetryStrategy { | |||
if r.Err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only get called when error is not nil
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
Signed-off-by: Wenqi Mou <wenqimou@gmail.com>
ab6cb2d
to
77b4f63
Compare
@Tristan1900: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/retest |
@Tristan1900: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/assign @GMHDBJD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for dumpling
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: GMHDBJD, Leavrth, YuJuncen The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: close #54643
Problem Summary:
Refactor the BR CLI backoff retry logic to make is more simplified and extendable in future.
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note