-
Notifications
You must be signed in to change notification settings - Fork 721
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
retry, client: support to log after execing some times #7895
retry, client: support to log after execing some times #7895
Conversation
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #7895 +/- ##
==========================================
- Coverage 73.81% 73.43% -0.39%
==========================================
Files 436 434 -2
Lines 48554 48078 -476
==========================================
- Hits 35840 35305 -535
- Misses 9675 9722 +47
- Partials 3039 3051 +12
Flags with carried forward coverage won't be shown. Click here to find out more. |
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
client/retry/backoff.go
Outdated
type Option func(*Backoffer) | ||
|
||
// WithLogTimes sets the number of retries required to print a log. | ||
func WithLogTimes(logTimes int) Option { |
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.
I think it should belong to the log component?
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.
But the log component doesn't know how many times the backoffer has done?
How about providing a function param that the caller defines? like func WithActionAfterTimes(times int, fn func()) Option
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.
For the caller, I think it's different to know how to set this value, it's affected by the backoff policy. If we must do it, I prefer something like withMinLogInterval.
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
client/retry/backoff.go
Outdated
// Option is used to customize the backoffer. | ||
type Option func(*Backoffer) | ||
|
||
// withMinLogInterval sets the mininum log interval for retrying. |
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.
// withMinLogInterval sets the mininum log interval for retrying. | |
// withMinLogInterval sets the minimum log interval for retrying. |
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.
maybe can add more comments/change this function name, It seems unrelated to the minimum?
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
/merge |
@HuSharp: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
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 ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 54f79d8
|
What problem does this PR solve?
Issue Number: ref #7894
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tiup
:Release note