Skip to content

Commit

Permalink
Fix race condition when getting powermax client
Browse files Browse the repository at this point in the history
  • Loading branch information
tdawe committed Feb 13, 2025
1 parent 4819f78 commit 2f3de9d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/symmetrix/powermax.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,12 @@ func GetPowerMax(symID string) (*PowerMax, error) {
return getPowerMax(symID)
}

var getPowerMaxClientMux sync.Mutex

// GetPowerMaxClient ...
func GetPowerMaxClient(primaryArray string, arrays ...string) (pmax.Pmax, error) {
getPowerMaxClientMux.Lock()
defer getPowerMaxClientMux.Unlock()
primaryPowermax, err := getPowerMax(primaryArray)
if err != nil {
return nil, err
Expand Down

0 comments on commit 2f3de9d

Please sign in to comment.