Merge pull request #2152 from hashicorp/b-fix-dev-shutdown-race

Fix race when shutting down in dev mode
This commit is contained in:
Michael Schurter 2017-01-04 10:34:46 -08:00 committed by GitHub
commit 86d5720e4c

View file

@ -378,12 +378,10 @@ func (c *Client) Shutdown() error {
// Destroy all the running allocations.
if c.config.DevMode {
c.allocLock.Lock()
for _, ar := range c.allocs {
for _, ar := range c.getAllocRunners() {
ar.Destroy()
<-ar.WaitCh()
}
c.allocLock.Unlock()
}
c.shutdown = true