-
Notifications
You must be signed in to change notification settings - Fork 275
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
Retry flanneld if it fails to start #5703
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 flannel we use https://github.com/avast/retry-go/ for retries.
I don't know if it would be worth it here?
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.
Thanks for the suggestion Thomas! For this use case, I think it is fine with a simple loop. No need to carry another dependency
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.
What specifically are we trying to fix by retrying here? All other prerequisites are polled for readiness before attempting to start the component. Other components that are started in a retry loop don't have a limit on them and are just retried indefinitely while RKE2 is up.
I feel like we should figure out what is causing flannel to fail initially, and poll for that to become come available before starting flannel, rather than artificially limiting the number of restarts.
If we do for some reason need to artificially limit the restarts, shouldn't we
logrus.Fatalf
after the for loop, rather than just leaving rke2 running without any further attempt to start the CNI?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.
The first time flanneld runs, it creates the HNS network, which is an overlay flannel network bound with a physical interface. Because of how windows works, that interface then becomes unavailable for some time (according to my measurements from 10s - 25s). If it is closer to the 25s, flanneld dies because it failed to contact kube-api for too long. That's the case that we are trying to fix here. The 2nd time it runs, if the interface is back, as the network is already there, it does not create it, so there is no downtime for the connections
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.
One thing we could is: run flannel once and then, if it fails, check for the interface to come back. Once we are sure the interface is back, run flannel again. If it fails a second time, then do the fatal failure. What do you think?
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.
Does flannel have an option to do a one-shot startup that will just create the HNS network if necessary, and then exit? We could do that, wait for the network to stabilize, and then start the "permanent" flannel that we expect to not crash?
That's pretty similar to what you were suggesting I guess, except that we would expect flannel to always exit the first time.
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.
Unfortunately that option does not exist. I have an idea I could try tomorrow in Flannel, hopefully before code freeze