Skip to content

Commit

Permalink
Merge pull request #2152 from hashicorp/b-fix-dev-shutdown-race
Browse files Browse the repository at this point in the history
Fix race when shutting down in dev mode
  • Loading branch information
schmichael authored Jan 4, 2017
2 parents 9fde3e5 + 09d4f07 commit cd04bc5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cd04bc5

Please sign in to comment.