#2563 fixed pending state for allocations with terminal status

This commit is contained in:
unknown
2017-07-09 16:18:06 +03:00
parent 4cd2cf1c3c
commit 5f9cd4f329

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