Merge pull request #89604 from aramase/fix-lb

azure: fix concurreny issue in lb creation
This commit is contained in:
Kubernetes Prow Robot 2020-03-28 02:44:09 -07:00 committed by GitHub
commit b4c82622ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1101,6 +1101,9 @@ func (ss *scaleSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, bac
// Update VMs with best effort that have already been added to nodeUpdates.
for meta, update := range nodeUpdates {
// create new instance of meta and update for passing to anonymous function
meta := meta
update := update
hostUpdates = append(hostUpdates, func() error {
ctx, cancel := getContextWithCancel()
defer cancel()
@ -1401,6 +1404,9 @@ func (ss *scaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID,
// Update VMs with best effort that have already been added to nodeUpdates.
for meta, update := range nodeUpdates {
// create new instance of meta and update for passing to anonymous function
meta := meta
update := update
hostUpdates = append(hostUpdates, func() error {
ctx, cancel := getContextWithCancel()
defer cancel()