Skip to content

Commit

Permalink
add motivation for protecting attempt_ok metadata writes
Browse files Browse the repository at this point in the history
  • Loading branch information
saikonen committed Oct 10, 2024
1 parent 9615dd3 commit 03ab83d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions metaflow/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,11 @@ def run_step(
self.flow._task_ok = False
raise ex
finally:
# The attempt_ok metadata is used to determine task status so it is important
# we ensure that it is written even in case of preceding failures.
# f.ex. failing to serialize artifacts leads to a non-zero exit code for the process,
# even if user code finishes successfully. Flow execution will not continue due to the exit,
# so arguably we should mark the task as failed.
attempt_ok = str(bool(self.flow._task_ok))
self.metadata.register_metadata(
run_id,
Expand Down

0 comments on commit 03ab83d

Please sign in to comment.