-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fix potential SEGV in updateReadinessStats #2096
Fix potential SEGV in updateReadinessStats #2096
Conversation
@@ -573,6 +573,10 @@ func (csr *ClusterStateRegistry) updateReadinessStats(currentTime time.Time) { | |||
klog.Warningf("Failed to get nodegroup for %s: %v", unregistered.Node.Name, errNg) | |||
continue | |||
} | |||
if nodeGroup == 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.
or may be extend the check at L572, if errNg != nil || nodeGroup == 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.
I think it is simpler as two cases; if the check is extended you need an additional check when logging for the case when ngErr
is nil
. And semantically they are different. One path is an error, the second is the node simply doesn't exist.
I can confirm this PR fixes the following panic case:
|
@@ -573,6 +573,10 @@ func (csr *ClusterStateRegistry) updateReadinessStats(currentTime time.Time) { | |||
klog.Warningf("Failed to get nodegroup for %s: %v", unregistered.Node.Name, errNg) | |||
continue | |||
} | |||
if nodeGroup == nil { | |||
klog.Warningf("nodegroup is nil for %s", unregistered.Node.Name) |
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 make it uppercase :)
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 make it uppercase :)
Done in 91016a6
Calling cloudprovider.NodeGroupForNode(unregistered.Node) can result in a nil result for the nodegroup - handle that case.
6b45a62
to
91016a6
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: losipiuk 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 |
can this get cherry picked back into 1.15.x? |
Sure. Can you prepare a cherry-pick? |
Hi guys. I've seen that this has been cherry-picked but still waiting for a release. Do you have any ETA here when the 1.15.4 will land with this fix? Thank you |
I will be cutting patch releases today |
@losipiuk thanks a lot for the fast reaction here and the transparency |
Cherry-pick #2096: Fix potential SEGV in updateReadinessStat
Calling cloudprovider.NodeGroupForNode(unregistered.Node) can result
in a nil result for the nodegroup - handle that case.