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
scheduler: update the scheduler interface and cache methods to use contextual logging #116849
scheduler: update the scheduler interface and cache methods to use contextual logging #116849
Conversation
Skipping CI for Draft Pull Request. |
/test all |
1a31ccc
to
0b0dbf7
Compare
/test all |
0b0dbf7
to
e40b5ac
Compare
/test all |
1 similar comment
/test all |
/sig instrumentation |
7ebeb2a
to
234db6b
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.
Several comments, I haven't review the whole codebase yet, one point I want to highlight is if not necessary to use contextual logging, we can use klog directly, like cache and eventhandler. Agree? cc @pohly @alculquicondor
e1c3cd8
to
4b88562
Compare
Pass context parameter in the interface instead of logger parameter. |
/hold |
d781ace
to
a11edd3
Compare
/hold cancel |
a11edd3
to
0afa1b2
Compare
pkg/scheduler/schedule_one.go
Outdated
@@ -320,6 +324,7 @@ func (sched *Scheduler) skipPodSchedule(fwk framework.Framework, pod *v1.Pod) bo | |||
// during its previous scheduling cycle but before getting assumed. | |||
isAssumed, err := sched.Cache.IsAssumedPod(pod) | |||
if err != nil { | |||
// TODO: pass ctx into a revised HandleError |
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.
Is there an issue for this? If so, please reference TODO(#1234)
Also, does it need to be a context or can it be a logger?
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.
Is there an issue for this? If so, please reference TODO(#1234)
Yes. I have added the issue number.
Also, does it need to be a context or can it be a logger?
As far as I know, the function utilruntime.HandleError
is used in many components.
Do we have plans to decide whether to pass context or logger in the future? @pohly
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.
Can you open an issue to add a logger of Ctx to HandleError
?
0afa1b2
to
efdfbbf
Compare
efdfbbf
to
074900e
Compare
/lgtm |
LGTM label has been added. Git tree hash: 956343a34a0d3646965709843da16a12419b9165
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, mengjiao-liu 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 type of PR is this?
/kind feature
What this PR does / why we need it:
Update the scheduler interface and cache methods to use contextual logging.
Which issue(s) this PR fixes:
Part of #91633 (comment)
Special notes for your reviewer:
Update the interface, cache, and some of the files that call these methods.
Because these methods are called from many places and cannot be subdivided, this PR may be large.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: