-
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
Fix controller-manager race condition issue which cause endpoints flush during restart #23035
Conversation
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
2 similar comments
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
Labelling this PR as size/S |
a0734a2
to
c6588fa
Compare
@@ -305,6 +305,21 @@ func (e *EndpointController) syncService(key string) { | |||
e.queue.Add(key) // Retry | |||
return | |||
} | |||
if len(pods.Items) == 0 { |
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.
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.
+1, that's the correct fix.
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.
@bprashanth Good suggestion. Updated and please review again.
@kubernetes/sig-api-machinery |
This looks like a good thing to fix, just we should fix by waiting for the pod store to sync instead of by listing every pod. I think we should consider this for a cherry-pick. (Problem statement: you restart controller-manager and all of your endpoints briefly go away.) |
(Not urgent to get into 1.2.0, too late anyway. For 1.2.1.) |
…use endpoints flush during restart
8d3c804
to
f5c631e
Compare
Labelling this PR as size/M |
Thanks, LGTM |
GCE e2e build/test passed for commit f5c631e. |
The author of this PR is not in the whitelist for merge, can one of the admins add the 'ok-to-merge' label? |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit f5c631e. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
Thanks for this! I took the liberty of editing your initial comment so it'll be clear to the people evaluating the cherry-pick what this does. :) |
Auto commit by PR queue bot (cherry picked from commit cda4583)
Commit d71c1b9 found in the "release-1.2" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this s an error find help to get your PR picked. |
Auto commit by PR queue bot (cherry picked from commit cda4583)
Auto commit by PR queue bot (cherry picked from commit cda4583)
Auto commit by PR queue bot (cherry picked from commit cda4583)
Auto commit by PR queue bot (cherry picked from commit cda4583)
Fix: Wait for endpoints to become available instead of assuming there are no endpoints. (On kube-controller-manager restart.)