-
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: persist business error to subtask table #47334
Conversation
Hi @tangenta. 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. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #47334 +/- ##
================================================
+ Coverage 72.4858% 72.6483% +0.1624%
================================================
Files 1349 1374 +25
Lines 401073 410607 +9534
================================================
+ Hits 290721 298299 +7578
- Misses 91239 93486 +2247
+ Partials 19113 18822 -291
Flags with carried forward coverage won't be shown. Click here to find out more.
|
logutil.Logger(m.logCtx).Error("task manager error", zap.Error(err)) | ||
} | ||
|
||
func (m *Manager) logErrAndPersist(err error, taskID int64) { | ||
m.logErr(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.
Will here get return value of m.logErr(err), then store return packed err into subtask?
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.
It is designed NOT to store errors in subtasks. That's why I change into two methods.
|
||
func (m *Manager) logErrAndPersist(err error, taskID int64) { | ||
m.logErr(err) | ||
err1 := m.taskTable.UpdateErrorToSubtask(m.id, taskID, 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.
When update to subtask failed, what will happen?
We can use backoffer.
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.
It will act like logErr()
and keep 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.
LGTM
/retest |
@tangenta: 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/test-infra repository. |
/retest |
/ok-to-test |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: GMHDBJD, ywqzzy 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: ref #46258
Problem Summary:
WaitGlobalTask
may exit before cleaning up the global task, which can cause unexpected behavior.scheduler.Init()
should persist to subtask table instead of constantly retrying.What is changed and how it works?
As the title said.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.