-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
disttask: refine scheduler error handling #47313
Conversation
Hi @ywqzzy. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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/test-infra repository. |
Hi @ywqzzy. 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/test-infra repository. |
/label ok-to-test |
/test all |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #47313 +/- ##
================================================
+ Coverage 71.9864% 72.7562% +0.7698%
================================================
Files 1353 1375 +22
Lines 401002 407418 +6416
================================================
+ Hits 288667 296422 +7755
+ Misses 92965 92204 -761
+ Partials 19370 18792 -578
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/retest |
@@ -168,6 +186,10 @@ func (s *BaseScheduler) run(ctx context.Context, task *proto.Task) error { | |||
proto.TaskStatePending, proto.TaskStateRunning) | |||
if err != nil { | |||
s.onError(err) |
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.
Do we need to record the error if it is retryable?
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.
Do we need to record the error if it is retryable?
No, this will make the dispatcher logic much more complicated, dispatcher need to distinguish the error type from string.
I think we can just check retryable in scheduler.
@@ -67,7 +66,7 @@ type Manager struct { | |||
sync.RWMutex | |||
// taskID -> cancelFunc. | |||
// cancelFunc is used to fast cancel the scheduler.Run. |
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.
Does the comment out of date?
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.
Yes, will fix it
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
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
subtask.State = proto.TaskStateSucceed | ||
metrics.IncDistTaskSubTaskCnt(subtask) | ||
} | ||
|
||
func (s *BaseScheduler) markTaskCancelOrFailed(ctx context.Context, subtask *proto.Subtask) bool { |
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.
func (s *BaseScheduler) markTaskCancelOrFailed(ctx context.Context, subtask *proto.Subtask) bool { | |
func (s *BaseScheduler) markSubtaskCancelOrFailed(ctx context.Context, subtask *proto.Subtask) bool { |
/lgtm |
[LGTM Timeline notifier]Timeline:
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Benjamin2037, D3Hunter 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 |
@ywqzzy: 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/test-infra repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: ref #46258
Problem Summary:
When tidb gracefully shutdown, dist task failed.
When network partition with tikv, dist task failed due to retryable error.
What is changed and how it works?
We use the above function to persist error to subtasks.
Check List
Tests
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.