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
pass status to handleSchedulingFailure #114082
pass status to handleSchedulingFailure #114082
Conversation
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Wed Nov 23 09:30:47 UTC 2022. |
@kidddddddddddddddddddddd: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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 @kidddddddddddddddddddddd. Thanks for your PR. I'm waiting for a kubernetes 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. |
/cc @kerthcet |
/ok-to-test |
/retest |
4f58d9b
to
2b9af3e
Compare
Sorry @kidddddddddddddddddddddd , really busy these days, will review this tomorrow or the day after tomorrow? |
2b9af3e
to
5fd0509
Compare
74bfb7d
to
6554881
Compare
6554881
to
b893a82
Compare
b893a82
to
14e24b4
Compare
61a9f1a
to
d637e90
Compare
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.
last comment :)
d637e90
to
e410c7a
Compare
pkg/scheduler/schedule_one_test.go
Outdated
|
||
msg := truncateMessage(err.Error()) | ||
msg := truncateMessage(status.Message()) |
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.
Then revert the change for reasons may be empty now. E.g. we no longer append reasons in NewStatus().WithError()
. It should look like:
err := status.AsError()
msg := truncateMessage(err.Error())
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.
ah, we should be calling s.err.Error()
in Status.Message
. Can you do as a follow up?
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 can not call s.err
here. status.AsError
will also return the error, and we're handling failures, so we'll always have an error in status.
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.
Sorry, you mean the status.Message()
? But somethings status may have no error but only reasons.
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.
ah, we should be calling
s.err.Error()
inStatus.Message
. Can you do as a follow up?
We construct s.err
with reasons in AsStatus
and NewStatus
, so if the code of a status is Error
, s.err.Error()
will be contained by s.Message
.
However, if status has a code not Error
and has a error in the same time, s.Message()
will not return the error msg, and in that case, we need to call s.err.Error()
to get the error msg.(like fiterr in scheduling cycle).
I guess you're suggesting in status.Message()
, we check the status's code and concate err.Error()
into the result string, like:
func (s *Status) Message() string {
if s == nil {
return ""
}
if s.err != nil && s.code != Error {
return s.err.Error() + "," + strings.Join(s.reasons, ", ")
}
return strings.Join(s.reasons, ", ")
}
This looks a bit back to the start.
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's not back to the start. The main difference is that we are only serializing when actually needed.
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.
created #114456 , we can have a disscussion/review there.
e410c7a
to
6ca62eb
Compare
may have a flaky test: Test_Run_OneVolumeDetachFailNodeWithReadWriteOnce |
/retest |
/lgtm |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Which issue(s) this PR fixes:
Part of #103853
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: