mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-10 17:35:44 -04:00
Prevent deadlock on azure zone fetch in presence of failure
This commit is contained in:
parent
07424af12b
commit
04e2deeb28
1 changed files with 1 additions and 1 deletions
|
|
@ -40,6 +40,7 @@ type instanceInfo struct {
|
|||
// GetZone returns the Zone containing the current failure zone and locality region that the program is running in
|
||||
func (az *Cloud) GetZone() (cloudprovider.Zone, error) {
|
||||
faultMutex.Lock()
|
||||
defer faultMutex.Unlock()
|
||||
if faultDomain == nil {
|
||||
var err error
|
||||
faultDomain, err = fetchFaultDomain()
|
||||
|
|
@ -51,7 +52,6 @@ func (az *Cloud) GetZone() (cloudprovider.Zone, error) {
|
|||
FailureDomain: *faultDomain,
|
||||
Region: az.Location,
|
||||
}
|
||||
faultMutex.Unlock()
|
||||
return zone, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue