From 28477dc0daccd6650f4d71e25809f7be6c56a043 Mon Sep 17 00:00:00 2001 From: Anshul Pundir Date: Tue, 19 Jun 2018 11:25:27 -0700 Subject: [PATCH] [orchestrator/task reaper] Clean up tasks in dirty list for which the service has been deleted. Signed-off-by: Anshul Pundir --- manager/orchestrator/taskreaper/task_reaper.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manager/orchestrator/taskreaper/task_reaper.go b/manager/orchestrator/taskreaper/task_reaper.go index 8ef2b4f7b0..a66a01da70 100644 --- a/manager/orchestrator/taskreaper/task_reaper.go +++ b/manager/orchestrator/taskreaper/task_reaper.go @@ -177,6 +177,9 @@ func (tr *TaskReaper) tick() { for dirty := range tr.dirty { service := store.GetService(tx, dirty.serviceID) if service == nil { + // If the service can't be found, assume that it was deleted + // and remove the slot from the dirty list. + delete(tr.dirty, dirty) continue }