From a28a67d26309eeeefa4f3162aa499b24c1f57d41 Mon Sep 17 00:00:00 2001 From: Nick Ethier Date: Mon, 18 Mar 2019 15:59:43 -0400 Subject: [PATCH] logmon:add static check for logmon exited hook --- client/allocrunner/taskrunner/logmon_hook.go | 2 +- client/allocrunner/taskrunner/logmon_hook_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/allocrunner/taskrunner/logmon_hook.go b/client/allocrunner/taskrunner/logmon_hook.go index 50697c79d..7e8250d06 100644 --- a/client/allocrunner/taskrunner/logmon_hook.go +++ b/client/allocrunner/taskrunner/logmon_hook.go @@ -101,7 +101,7 @@ func (h *logmonHook) Prestart(ctx context.Context, var reattachConfig *plugin.ReattachConfig var err error - // If the task was restarted then the logmon process is still running and just + // If the task was restarted and the logmon process is still running logmon // needs the start RPC called again to open the fifo if !h.exited || h.logmonPluginClient == nil || h.logmonPluginClient.Exited() { reattachConfig, err = reattachConfigFromHookData(req.PreviousState) diff --git a/client/allocrunner/taskrunner/logmon_hook_test.go b/client/allocrunner/taskrunner/logmon_hook_test.go index 426a9ea2f..33bc3221e 100644 --- a/client/allocrunner/taskrunner/logmon_hook_test.go +++ b/client/allocrunner/taskrunner/logmon_hook_test.go @@ -19,6 +19,7 @@ import ( // Statically assert the logmon hook implements the expected interfaces var _ interfaces.TaskPrestartHook = (*logmonHook)(nil) +var _ interfaces.TaskExitedHook = (*logmonHook)(nil) var _ interfaces.TaskStopHook = (*logmonHook)(nil) // TestTaskRunner_LogmonHook_LoadReattach unit tests loading logmon reattach