-
Notifications
You must be signed in to change notification settings - Fork 115
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 panic condition in Pod await logic #998
Conversation
For events received by the Pod awaiter, explicitly check that the event has a non-nil Object to avoid a possible panic.
@@ -197,6 +197,10 @@ func (pia *podInitAwaiter) Read() error { | |||
} | |||
|
|||
func (pia *podInitAwaiter) processPodEvent(event watch.Event) { | |||
if event.Object == nil { | |||
glog.V(3).Infof("received event with nil Object: %#v", event) |
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.
Under what circumstances does this occur?
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 the linked issue, it seemed like it was caused by a network interruption.
From #994 (comment):
Did we look for any unchecked errors? |
@pgavlin That event is coming from a watch channel, so there's no error to check. |
Hm. Is this due to the way we've written it? Seems like we must be dropping an error somewhere... Can you file an issue for followup? |
I could switch on the event type to check for an |
Proposed changes
For events received by the Pod awaiter, explicitly check that
the event has a non-nil Object to avoid a possible panic.
Related issues (optional)
Fixes #994