Skip to content
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

Merged

Conversation

draveness
Copy link
Contributor

/kind cleanup
/priority backlog

What this PR does / why we need it:

move klog from AddUnschedulableIfNotPresent and to the call site.

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 6, 2019
@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 6, 2019
@draveness draveness force-pushed the feature/remove-log-in-scheduler branch from 80aee64 to a050691 Compare May 6, 2019 03:55
@draveness
Copy link
Contributor Author

/retest

/assign @ravisantoshgudimetla

@draveness
Copy link
Contributor Author

/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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just return fmt.Errorf.....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. PTAL :)

@k82cn
Copy link
Member

k82cn commented May 6, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2019
@draveness draveness force-pushed the feature/remove-log-in-scheduler branch from a050691 to ab69f25 Compare May 6, 2019 09:02
@draveness
Copy link
Contributor Author

/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)
Copy link
Member

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.

Copy link
Contributor Author

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.

@draveness draveness force-pushed the feature/remove-log-in-scheduler branch from ab69f25 to f0367d0 Compare May 6, 2019 16:36
@draveness draveness force-pushed the feature/remove-log-in-scheduler branch from f0367d0 to 6382595 Compare May 6, 2019 16:40
@Huang-Wei
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 6, 2019
@k8s-ci-robot k8s-ci-robot merged commit a1588cf into kubernetes:master May 7, 2019
@draveness draveness deleted the feature/remove-log-in-scheduler branch May 7, 2019 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants