Skip to content

Commit

Permalink
client/heartbeatstop: we don't need to wait for a sync destroy
Browse files Browse the repository at this point in the history
The server side needs to be aware of `shutdown_delay`, though
  • Loading branch information
langmartin committed Apr 27, 2020
1 parent c9be248 commit 8feac68
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions client/heartbeatstop.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package client

import (
"fmt"
"sync"
"time"

Expand Down Expand Up @@ -151,13 +150,7 @@ func (h *heartbeatStop) stopAlloc(allocID string) error {
}

runner.Destroy()
timeout := time.After(5 * time.Second)
select {
case <-runner.DestroyCh():
return nil
case <-timeout:
return fmt.Errorf("allocation destroy for %s timed out", allocID)
}
return nil
}

func allocTaskGroup(alloc *structs.Allocation) *structs.TaskGroup {
Expand Down

0 comments on commit 8feac68

Please sign in to comment.