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
commit d3c52b0bb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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