Merge pull request #5741 from hashicorp/b-alloc-race-20190521
client: synchronize access to `ar.alloc`
This commit is contained in:
commit
d3c52b0bb4
|
@ -45,7 +45,7 @@ func (a *allocHealthSetter) SetHealth(healthy, isDeploy bool, trackerTaskEvents
|
||||||
a.ar.stateLock.Lock()
|
a.ar.stateLock.Lock()
|
||||||
a.ar.state.SetDeploymentStatus(time.Now(), healthy)
|
a.ar.state.SetDeploymentStatus(time.Now(), healthy)
|
||||||
a.ar.persistDeploymentStatus(a.ar.state.DeploymentStatus)
|
a.ar.persistDeploymentStatus(a.ar.state.DeploymentStatus)
|
||||||
terminalDesiredState := a.ar.alloc.ServerTerminalStatus()
|
terminalDesiredState := a.ar.Alloc().ServerTerminalStatus()
|
||||||
a.ar.stateLock.Unlock()
|
a.ar.stateLock.Unlock()
|
||||||
|
|
||||||
// If deployment is unhealthy emit task events explaining why
|
// If deployment is unhealthy emit task events explaining why
|
||||||
|
|
Loading…
Reference in New Issue