mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-11 09:06:14 +00:00
Prevent deadlock on azure zone fetch in presence of failure
This commit is contained in:
@@ -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
|
// 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) {
|
func (az *Cloud) GetZone() (cloudprovider.Zone, error) {
|
||||||
faultMutex.Lock()
|
faultMutex.Lock()
|
||||||
|
defer faultMutex.Unlock()
|
||||||
if faultDomain == nil {
|
if faultDomain == nil {
|
||||||
var err error
|
var err error
|
||||||
faultDomain, err = fetchFaultDomain()
|
faultDomain, err = fetchFaultDomain()
|
||||||
@@ -51,7 +52,6 @@ func (az *Cloud) GetZone() (cloudprovider.Zone, error) {
|
|||||||
FailureDomain: *faultDomain,
|
FailureDomain: *faultDomain,
|
||||||
Region: az.Location,
|
Region: az.Location,
|
||||||
}
|
}
|
||||||
faultMutex.Unlock()
|
|
||||||
return zone, nil
|
return zone, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user