-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Check nodeInfo before ecache predicate #63459
Conversation
The nodeInfo without node was created when node added into cache after pod bind. |
@k82cn Yeah, but I am not sure why this happen to |
baf2db8
to
a133899
Compare
@@ -86,6 +87,12 @@ func (ec *EquivalenceCache) RunPredicate( | |||
) (bool, []algorithm.PredicateFailureReason, error) { | |||
ec.mu.Lock() | |||
defer ec.mu.Unlock() | |||
|
|||
if nodeInfo == nil || nodeInfo.Node() == 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.
@resouer - do we know why this is nil only sometimes ?
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 have some theory, but would like to verify it somehow tomorrow :/
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.
In some of our tests, nodeInfo.Node() is nil. It is expected.
/milestone v1.11 |
/kind bug |
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.
/lgtm
this change seems perfectly reasonable to me.
|
||
if nodeInfo == nil || nodeInfo.Node() == nil { | ||
// This may happen during tests. | ||
return false, []algorithm.PredicateFailureReason{}, fmt.Errorf("nodeInfo is nil or node is invalid") |
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 should return false, nil, fmt.Errorf(...), but I know that breaks tests today.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bsalamat, misterikkit, resouer 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 |
/test pull-kubernetes-e2e-kops-aws |
[MILESTONENOTIFIER] Milestone Pull Request Needs Approval @bsalamat @misterikkit @resouer @kubernetes/sig-scheduling-misc Action required: This pull request must have the Pull Request Labels
|
Automatic merge from submit-queue (batch tested with PRs 63598, 63913, 63459, 63963, 60464). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
There's chances during test when nodeInfo is nil which may cause ecache predicate fail with nil pointer.
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 #63427
Special notes for your reviewer:
Not sure how to reproduce the original issue yet. i.e. why and when
nodeInfo
will become nil in tests is not clear to me, that's why I label it as WIP.cc @bsalamat who may have more inputs.
Release note: