From b475ccbe3e79bd61165c415d71348b2c896f1ff5 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Tue, 21 May 2019 09:55:05 -0400 Subject: [PATCH] client: synchronize access to ar.alloc `allocRunner.alloc` is protected by `allocRunner.allocLock`, so let's use `allocRunner.Alloc()` helper function to access it. --- client/allocrunner/alloc_runner_hooks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/allocrunner/alloc_runner_hooks.go b/client/allocrunner/alloc_runner_hooks.go index e33a53280..0d9b048c0 100644 --- a/client/allocrunner/alloc_runner_hooks.go +++ b/client/allocrunner/alloc_runner_hooks.go @@ -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