-
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
Move informer event handlers to scheduler #69504
Conversation
/assign @misterikkit |
8899c84
to
cfa3195
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.
Overall looks good. I haven't done a careful review of the handlers themselves.
I think the only other change I'd hope to see in this PR would be to make sure that the functions in generic_scheduler.go are organized sensibly.
@@ -125,12 +172,12 @@ func (g *genericScheduler) snapshot() error { | |||
// 3. snapshot ecache | |||
// 4. evaludate predicates | |||
// 5. stale result will be written to ecache | |||
if g.equivalenceCache != nil { | |||
g.equivalenceCache.Snapshot() | |||
if g.equivalencePodCache != 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.
This seems like an old variable name. What did you base this commit on?
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.
i rebased on latest upstream master. I decided to rename it that way. Will fix if it doesnt make sense
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.
Do you have a reason for renaming it that way? If not, then I'd prefer to leave it as is.
// Enable equivalence class cache | ||
enableEquivalenceClassCache bool | ||
|
||
nodeInformer coreinformers.NodeInformer |
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 clear to me that all of these informers need to be in the struct. Which ones do we need after NewGenericScheduler()
has finished?
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.
will get back
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.
I am trying to reuse the informers passed from cmd/kube-scheduler via NewConfigFactory. I think they are not used after the NewGenericScheduler finishes. Is it ok to not use the ones passed from cmd/kube-scheduler and just a local copy to add the event handlers ?
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 expectation is that NewGenericScheduler()
takes informer args for each kind that it cares about. If we add event handlers to those informers, then we might not need to keep a reference to the informer itself.
This is going to need a rebase, as a small change just went in. ( #69592 ) Also, can you provide an update on the progress of this PR? It's still marked as WIP and I haven't seen responses to my previous questions. If you're stuck, reach out here or on slack. |
ba830d0
to
383dac7
Compare
46af42b
to
4df2248
Compare
4df2248
to
612e779
Compare
612e779
to
af08644
Compare
/retest |
af08644
to
892ff48
Compare
/test pull-kubernetes-e2e-gce-100-performance |
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.
Please address 1 new comment and squash commits, then we can get this merged. ^_^
test/integration/util/util.go
Outdated
informerFactory.Storage().V1().StorageClasses(), | ||
) | ||
|
||
go func() { |
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.
I think this goroutine is redundant with the one created in factory.NewConfigFactory
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.
Fixed
3495d3f
to
e0a7d96
Compare
This change should not impose any additional burden, and I am more worried about completing the code we need to modify a lot of integration tests. I'm trying... :) |
/test pull-kubernetes-e2e-kops-aws |
1 similar comment
/test pull-kubernetes-e2e-kops-aws |
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.
@wgliang Yeah, I've tried tweaking some of the integration test code in an experimental branch, and it's a lot of work to remove |
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.
/approve
Thanks a lot, @krmayankk!
/assign @timothysc |
/test pull-kubernetes-e2e-kops-aws |
/unassign @timothysc @kubernetes/sig-testing-pr-reviews |
/test pull-kubernetes-e2e-kops-aws |
@krmayankk: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
/skip |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bsalamat, deads2k, krmayankk 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 |
thanks @misterikkit @bsalamat @deads2k |
Clean empty package import by #69504
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #68955
/kind cleanup