Skip to content

Commit 5ad2baf

Browse files
authored
add subnetstatus lock for handleAddOrUpdateSubnet (#2669)
1 parent f314ab5 commit 5ad2baf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/controller/subnet.go

+2
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,8 @@ func (c Controller) patchSubnetStatus(subnet *kubeovnv1.Subnet, reason string, e
473473

474474
func (c *Controller) handleAddOrUpdateSubnet(key string) error {
475475
var err error
476+
c.subnetStatusKeyMutex.Lock(key)
477+
defer c.subnetStatusKeyMutex.Unlock(key)
476478

477479
cachedSubnet, err := c.subnetsLister.Get(key)
478480
if err != nil {

0 commit comments

Comments
 (0)