From a2f45927047ed786d7151707d4c64d2c2bf2b5de Mon Sep 17 00:00:00 2001 From: Piotr Konopka Date: Fri, 22 Mar 2024 12:02:56 +0100 Subject: [PATCH] [core] OCTRL-846 report done roles to parent roles This makes DONE roles (e.g. killed with SIGTERM) correctly report through mesos that they are DONE. This commit does _not_ make the environment state go to ERROR if the task off-the-rails is critical, it will be done as a part of the same ticket, but different commit. --- core/task/manager.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/task/manager.go b/core/task/manager.go index bf43bfab..88121478 100644 --- a/core/task/manager.go +++ b/core/task/manager.go @@ -1165,6 +1165,19 @@ func (m *Manager) handleMessage(tm *TaskmanMessage) error { mesosState := mesosStatus.GetState() switch mesosState { case mesos.TASK_FINISHED: + log.WithPrefix("taskman"). + WithFields(logrus.Fields{ + "taskId": mesosStatus.GetTaskID().Value, + "state": mesosState.String(), + "reason": mesosStatus.GetReason().String(), + "source": mesosStatus.GetSource().String(), + "message": mesosStatus.GetMessage(), + "level": infologger.IL_Devel, + }). + WithField("partition", tm.GetEnvironmentId().String()). // fixme: this is empty! + Info("task finished") + taskIDValue := mesosStatus.GetTaskID().Value + m.updateTaskState(taskIDValue, "DONE") m.tasksFinished++ case mesos.TASK_LOST, mesos.TASK_KILLED, mesos.TASK_FAILED, mesos.TASK_ERROR: log.WithPrefix("taskman").