From 5453adb444d20eeca64212ef5ece6018f7e3dcce Mon Sep 17 00:00:00 2001 From: Drew Erny Date: Mon, 30 Dec 2019 12:02:37 -0600 Subject: [PATCH] Revert "YOLO see if this works" This reverts commit 42085d2f8e43a3ed90ed289d3f3ed3de57837100. Turns out it's a bad idea to merge a commit with the word "YOLO" in it. Signed-off-by: Drew Erny --- agent/worker.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/agent/worker.go b/agent/worker.go index 212aa1e12f..efe538afa7 100644 --- a/agent/worker.go +++ b/agent/worker.go @@ -257,11 +257,13 @@ func reconcileTaskState(ctx context.Context, w *worker, assignments []*api.Assig } closeManager := func(tm *taskManager) { - defer w.closers.Done() - // when a task is no longer assigned, we shutdown the task manager - if err := tm.Close(); err != nil { - log.G(ctx).WithError(err).Error("error closing task manager") - } + go func(tm *taskManager) { + defer w.closers.Done() + // when a task is no longer assigned, we shutdown the task manager + if err := tm.Close(); err != nil { + log.G(ctx).WithError(err).Error("error closing task manager") + } + }(tm) // make an attempt at removing. this is best effort. any errors will be // retried by the reaper later.