Merge pull request #5741 from hashicorp/b-alloc-race-20190521

client: synchronize access to `ar.alloc`
This commit is contained in:
Mahmood Ali
2019-05-21 11:04:58 -04:00
committed by GitHub

View File

@@ -45,7 +45,7 @@ func (a *allocHealthSetter) SetHealth(healthy, isDeploy bool, trackerTaskEvents
a.ar.stateLock.Lock()
a.ar.state.SetDeploymentStatus(time.Now(), healthy)
a.ar.persistDeploymentStatus(a.ar.state.DeploymentStatus)
terminalDesiredState := a.ar.alloc.ServerTerminalStatus()
terminalDesiredState := a.ar.Alloc().ServerTerminalStatus()
a.ar.stateLock.Unlock()
// If deployment is unhealthy emit task events explaining why