Skip to content

Commit 4d8ff18

Browse files
knopers8teo
authored andcommitted
[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.
1 parent 8ec6061 commit 4d8ff18

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

core/task/manager.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,19 @@ func (m *Manager) handleMessage(tm *TaskmanMessage) error {
11651165
mesosState := mesosStatus.GetState()
11661166
switch mesosState {
11671167
case mesos.TASK_FINISHED:
1168+
log.WithPrefix("taskman").
1169+
WithFields(logrus.Fields{
1170+
"taskId": mesosStatus.GetTaskID().Value,
1171+
"state": mesosState.String(),
1172+
"reason": mesosStatus.GetReason().String(),
1173+
"source": mesosStatus.GetSource().String(),
1174+
"message": mesosStatus.GetMessage(),
1175+
"level": infologger.IL_Devel,
1176+
}).
1177+
WithField("partition", tm.GetEnvironmentId().String()). // fixme: this is empty!
1178+
Info("task finished")
1179+
taskIDValue := mesosStatus.GetTaskID().Value
1180+
m.updateTaskState(taskIDValue, "DONE")
11681181
m.tasksFinished++
11691182
case mesos.TASK_LOST, mesos.TASK_KILLED, mesos.TASK_FAILED, mesos.TASK_ERROR:
11701183
log.WithPrefix("taskman").

0 commit comments

Comments
 (0)