mirror of
https://github.com/kemko/nomad.git
synced 2026-01-09 11:55:42 +03:00
Merge pull request #2152 from hashicorp/b-fix-dev-shutdown-race
Fix race when shutting down in dev mode
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user