From 357a10bcf4bcaf008c28e515a3e0aad5dd523bb2 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Thu, 29 Mar 2018 11:21:50 -0700 Subject: [PATCH] Always capture the finish time --- client/alloc_runner.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/client/alloc_runner.go b/client/alloc_runner.go index 25e879134..5e42f7329 100644 --- a/client/alloc_runner.go +++ b/client/alloc_runner.go @@ -715,11 +715,8 @@ func (r *AllocRunner) setTaskState(taskName, state string, event *structs.TaskEv } } case structs.TaskStateDead: - // Capture the finished time. If it has never started there is no finish - // time - if !taskState.StartedAt.IsZero() { - taskState.FinishedAt = time.Now().UTC() - } + // Capture the finished time. + taskState.FinishedAt = time.Now().UTC() // Find all tasks that are not the one that is dead and check if the one // that is dead is a leader