-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
feat: remove klog in AddUnschedulableIfNotPresent #77478
feat: remove klog in AddUnschedulableIfNotPresent #77478
Conversation
80aee64
to
a050691
Compare
/retest /assign @ravisantoshgudimetla |
/test pull-kubernetes-kubemark-e2e-gce-big |
@@ -313,9 +313,7 @@ func (p *PriorityQueue) AddUnschedulableIfNotPresent(pod *v1.Pod, podSchedulingC | |||
// it to unschedulableQ. | |||
if p.moveRequestCycle >= podSchedulingCycle { | |||
if err := p.podBackoffQ.Add(pInfo); err != nil { | |||
// TODO: Delete this klog call and log returned errors at the call site. | |||
err = fmt.Errorf("error adding pod %v to the backoff queue: %v", pod.Name, 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.
just return fmt.Errorf....
.
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.
done. PTAL :)
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: draveness, k82cn 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 |
a050691
to
ab69f25
Compare
/retest |
err = fmt.Errorf("error adding pod %v to the backoff queue: %v", pod.Name, err) | ||
klog.Error(err) | ||
return err | ||
return fmt.Errorf("error adding pod %v to the backoff queue: %v", pod.Name, 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.
A nit: as you wrap the detailed msg here as an err
, and re-wrap the err msg in caller side, I suppose we'll get a sort of duplicate err msg? Like:
Error add unschedulable pod <pod> to queue: error adding pod <pod> to the backoff queue: <err>.
Maybe it's better wrapping the detailed msg only in one side - (1) either wrap here and in caller side simply log klog.Errorf(err)
, or (2) simply return err here and in caller side log klog.Errorf("Error add unschedulable pod %v to queue: %v", pod, err)
.
(1) is more preferable IMO.
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.
Yeah, that's a good one. Updated the code in caller site with klog.Errorf(err)
. Please take a look at the latest commit.
ab69f25
to
f0367d0
Compare
f0367d0
to
6382595
Compare
/lgtm |
/kind cleanup
/priority backlog
What this PR does / why we need it:
move
klog
fromAddUnschedulableIfNotPresent
and to the call site.Does this PR introduce a user-facing change?: