mirror of
https://github.com/clearml/clearml-agent
synced 2025-06-26 18:16:15 +00:00
Fix do not set Aborted task if it is already set to Failed
This commit is contained in:
parent
3585786348
commit
4881b9638d
@ -3485,8 +3485,16 @@ class Worker(ServiceCommandSection):
|
||||
session = session or self._session
|
||||
try:
|
||||
if stop_reason == TaskStopReason.stopped:
|
||||
self.log("Stopping - tasks.stop was called for task")
|
||||
# do not change the status to stopped if the Task status is already failed
|
||||
task_status = get_task(
|
||||
session, task_id, only_fields=["status"]
|
||||
).status
|
||||
if str(task_status) == "failed":
|
||||
self.send_logs(task_id, ["Process aborted by user - Task status was Failed"], session=session)
|
||||
self.log("Stopping - task was already marked as failed")
|
||||
else:
|
||||
self.send_logs(task_id, ["Process aborted by user"], session=session)
|
||||
self.log("Stopping - tasks.stop was called for task")
|
||||
session.send_api(
|
||||
tasks_api.StoppedRequest(
|
||||
task=task_id,
|
||||
|
Loading…
Reference in New Issue
Block a user