fix: initc panic on pod update after termination#547
Conversation
|
Thanks for the fix @steved. One small nit, otherwise LGTM. |
Thanks for the review! I think the comment might've been lost? I don't see any notes. |
|
@steved I forgot to submit, but I looked at it again and it's not worth the nit. Thanks! |
renormalize
left a comment
There was a problem hiding this comment.
thanks for the fix @steved!
I was clearly mistaken when I assumed that ensuring the right order of canceling the context and then subsequently closing the channel would suffice.
Thanks for also changing the unnecessarily buffered channel to an unbuffered one. The
select {
case c.allReadyCh <- struct{}{}:
default: // already notified
}pattern wouldn't have worked with a buffered channel.
I think my original intent was to make the channel buffered since simultaneous events might cause multiple informers to write to the channel, and I did not want them to be blocked. But that does not matter anyway, as long as one informer routine writes to allReadyCh.
sanjaychatterjee
left a comment
There was a problem hiding this comment.
Thanks for the fix. Merging.
What type of PR is this?
/kind bug
What this PR does / why we need it:
If
WaitForReadyreturns andallReadyChis closed, but, before the process exits, a shared informer event happens that indicates a podclique is ready, it'll attempt to send on a closed channel.I've gone the route of closing the factory, but we could also just not close
allReadyChand the process exit will clean everything up.Which issue(s) this PR fixes:
Fixes: #548.
Special notes for your reviewer:
Does this PR introduce a API change?
Additional documentation e.g., enhancement proposals, usage docs, etc.: