-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 addons map race condition #15706
fix addons map race condition #15706
Conversation
/ok-to-test |
kvm2 driver with docker runtime
Times for minikube start: 54.3s 53.5s 55.0s 56.3s 54.5s Times for minikube ingress: 27.7s 27.8s 27.3s 24.2s 28.7s docker driver with docker runtime
Times for minikube start: 26.3s 25.3s 26.6s 26.5s 26.3s Times for minikube ingress: 22.0s 22.5s 21.5s 82.0s 23.1s docker driver with containerd runtime
Times for minikube start: 21.3s 20.8s 21.6s 23.8s 22.4s Times for minikube ingress: 31.5s 20.5s 32.5s 32.5s 31.5s |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: prezha, spowelljr 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 |
These are the flake rates of all failed tests.
Too many tests failed - See test logs for more details. To see the flake rates of all tests by environment, click here. |
fixes #15705
from the issue's logs, we see that we can hit a race condition over concurrent reading and writing to the addons map - eg, we have addons.Start() called asynchronously, that might try to update the addons map (eg, here and here), while we also have multiple places where we potentially try to read the addons map at the same time (as being a part of the cluster config)
now, because it makes sense to try to enable addons concurrently, this pr tries to guard against that situation by splitting the addons.Start() into addons.Enable() (that is thread-safe and does the actual work of concurrently enabling addons) and addons.ToEnable() and addons.UpdateConfig() that are not thread-safe and therefore should be called synchronously before and after the addons.Enable is started as a goroutine
this way, we do not need to try to cover with locks all the places where we concurrently read the map - currently and in the future
attached are the logs from local test runs for TestAddons and TestMultiNode on ubuntu 20.04, ubuntu 22.04 vms and opensuse with docker & kvm2 driver and containerd container runtime - all passed: