fix concurreny issue in lb creation

This commit is contained in:
Anish Ramasekar 2020-03-27 16:33:58 -07:00
parent 5317a3160c
commit 43c45edf88
No known key found for this signature in database
GPG Key ID: 57E2FE676FC346A6

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()