-
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: make task executor onError
print error's stack.
#56618
disttask: make task executor onError
print error's stack.
#56618
Conversation
Hi @LindaSummer. 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 @LindaSummer. 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. |
Hi @lance6716 , Please take a look. 😊 Thanks very much. Best Regards, |
This comment was marked as resolved.
This comment was marked as resolved.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #56618 +/- ##
=================================================
- Coverage 73.3262% 56.8286% -16.4977%
=================================================
Files 1630 1759 +129
Lines 450312 635618 +185306
=================================================
+ Hits 330197 361213 +31016
- Misses 99833 250289 +150456
- Partials 20282 24116 +3834
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Thanks very much for your suggestions! I will try to add a test case for it. 😊 Best Regards, |
Hi @lance6716 , I have corrected my mistake and add unit tests. 😊 Please take a look. Best Regards, |
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.
Please run make bazel_prepare
to update .bazel
files, or just apply the following git diff (run git apply -
and paste following contents):
diff --git a/pkg/disttask/framework/taskexecutor/BUILD.bazel b/pkg/disttask/framework/taskexecutor/BUILD.bazel
index e65cc685e0..79a2483481 100644
--- a/pkg/disttask/framework/taskexecutor/BUILD.bazel
+++ b/pkg/disttask/framework/taskexecutor/BUILD.bazel
@@ -51,7 +51,7 @@ go_test(
],
embed = [":taskexecutor"],
flaky = True,
- shard_count = 16,
+ shard_count = 17,
deps = [
"//pkg/disttask/framework/mock",
"//pkg/disttask/framework/mock/execute",
@@ -74,5 +74,7 @@ go_test(
"@org_golang_google_grpc//status",
"@org_uber_go_goleak//:goleak",
"@org_uber_go_mock//gomock",
+ "@org_uber_go_zap//:zap",
+ "@org_uber_go_zap//zaptest/observer",
],
)
Or I can help you push that change if you have some problems.
Thanks very much for your warm suggestion and help! I will update this PR later today.😄 Best Regards, |
Hi @lance6716 , Thanks very much for your bazel patch!😊 I have updated related code and added stacktrace explicitly for all Best Regards, |
Hi @lance6716 , Thanks for your patience and warm help! 😊 I have added an Best Regards, |
/retest |
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
Thanks very much for your patience and help! 😊 I'll update it later today. Best Regards, |
/retest |
Hi @GMHDBJD, Sorry to bother you. 😊 Could help take a look? Best Regards, |
onerror
log skip one more level of stack.onError
print error's stack.
/retest |
/retest |
1 similar comment
/retest |
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
[LGTM Timeline notifier]Timeline:
|
/assign |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Benjamin2037, CbcWestwolf, lance6716 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 |
err = errors.Trace(err) | ||
e.logger.Error("onError", zap.Error(err), zap.Stack("stack")) | ||
|
||
if errors.HasStack(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.
why check 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.
we don't need to print the plain error stack. There's already zap.Error(err)
/hold |
/unhold |
What problem does this PR solve?
Issue Number: close #56014
Problem Summary:
What changed and how does it work?
Error log in
onError
function's stack is always in the same function.But the real stack should be the one invoking
onError
.Check List
Tests
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.