#2563 fixed pending state for allocations with terminal status

This commit is contained in:
unknown 2017-07-09 16:18:06 +03:00
parent d8733c3f96
commit 26b16fa3ce

View file

@ -495,6 +495,8 @@ func (r *AllocRunner) Run() {
// clean up the allocation.
if alloc.TerminalStatus() {
r.logger.Printf("[DEBUG] client: alloc %q in terminal status, waiting for destroy", r.alloc.ID)
// mark this allocation as completed.
r.setStatus(structs.AllocClientStatusComplete, "cancelled running tasks for allocation in terminal state")
r.handleDestroy()
r.logger.Printf("[DEBUG] client: terminating runner for alloc '%s'", r.alloc.ID)
return