Skip to content

Commit

Permalink
add subnetstatus lock for handleAddOrUpdateSubnet (#2669)
Browse files Browse the repository at this point in the history
  • Loading branch information
changluyi committed Apr 19, 2023
1 parent f314ab5 commit 5ad2baf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/controller/subnet.go
Expand Up @@ -473,6 +473,8 @@ func (c Controller) patchSubnetStatus(subnet *kubeovnv1.Subnet, reason string, e

func (c *Controller) handleAddOrUpdateSubnet(key string) error {
var err error
c.subnetStatusKeyMutex.Lock(key)
defer c.subnetStatusKeyMutex.Unlock(key)

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

0 comments on commit 5ad2baf

Please sign in to comment.