-
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
the scheduling queue logs the error and treats it as QueueAfterBackoff #119290
Conversation
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.
Thanks for a prompt action!
pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go
Outdated
Show resolved
Hide resolved
/assign |
@sanposhiho updated. |
fcfad44
to
080dfa0
Compare
@sanposhiho I pushed some changes. please review again. |
// | ||
// - `pod`: the Pod to be enqueued, which is rejected by this plugin in the past. | ||
// - `oldObj` `newObj`: the object involved in that event. | ||
// - For example, the given event is "Node deleted", the `oldObj` will be that deleted Node. | ||
// - `oldObj` is nil if the event is add event. | ||
// - `newObj` is nil if the event is delete event. | ||
type QueueingHintFn func(logger klog.Logger, pod *v1.Pod, oldObj, newObj interface{}) QueueingHint | ||
type QueueingHintFn func(logger klog.Logger, pod *v1.Pod, oldObj, newObj interface{}) (QueueingHint, 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.
since breaking api anyway, we can add ctx as a parameter, since almost everything in the framework accepts one (except this and one other place I noticed)
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.
cc @sanposhiho what do you think?
There's some discuss about logger and ctx. #119155 (comment)
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, maybe Aldo missed my followup question on ctx in the original thread. Let me follow up again in the original PR.
I'd like to make this PR's scope only change for error. We can easily have another change for ctx if we conclude we have.
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.
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.
tiny nits only. will /lgtm after them
/approve
pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go
Outdated
Show resolved
Hide resolved
pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go
Outdated
Show resolved
Hide resolved
b9dd8b7
to
7fd4897
Compare
/test pull-kubernetes-e2e-gce |
pkg/scheduler/scheduler_test.go
Outdated
@@ -813,6 +813,54 @@ func Test_buildQueueingHintMap(t *testing.T) { | |||
}, | |||
}, | |||
}, | |||
{ | |||
name: "node and pod plugin (QueueingHintFn returns 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.
Why is this test case needed?
Test_buildQueueingHintMap
is literary to test buildQueueingHintMap function, and the returning value from QueueingHintFn is completely not related to this test.
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.
The reason we're comparing the result like this is Golang cannot compare the function is the same.
So, we change the result coming from QueueingHintFn in every fake plugin and check registered functions are expected ones by checking the result from QueueingHint
if fn.QueueingHintFn(logger, nil, nil, nil) != wantfns[i].QueueingHintFn(logger, nil, nil, nil) {
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 no need to compare QueueingHintFn
also, because pluginName
tells everything.
func As[T runtime.Object](oldObj, newobj interface{}) (T, T, error) { | ||
func As[T any](oldObj, newobj interface{}) (T, T, 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.
Let's add one unit test case to confirm we can convert objects to klog.KMetadata
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.
@sanposhiho added.
3b88220
to
6eefacb
Compare
…nd treats it as QueueAfterBackoff. Co-authored-by: Kensei Nakada <[email protected]> Co-authored-by: Kante Yin <[email protected]> Co-authored-by: XsWack <[email protected]>
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.
Perfect, thanks for a long journey here!
/lgtm
/hold
Please add the release note. (someone may already be using the queueing hint in out-of-tree plugins) Once done, I'll /approve
.
LGTM label has been added. Git tree hash: 38fb9f9ee3a9accb042704f26130e4207475ed32
|
/release-note-edit |
/release-note-edit
|
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 works.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: carlory, sanposhiho 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 |
/unhold |
What type of PR is this?
/kind feature
What this PR does / why we need it:
See #119155 (comment)
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: