Skip to content

Commit

Permalink
AIP-8098 ExitHandler doesn't notify on Workflow Error
Browse files Browse the repository at this point in the history
  • Loading branch information
talebzeghmi committed Feb 28, 2024
1 parent 1cf1184 commit d902080
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions metaflow/plugins/aip/aip_exit_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ def send_sqs_message(queue_url: str, message_body: str, *, role_arn: str = None)
notify_on_error = get_env("METAFLOW_NOTIFY_ON_ERROR")
notify_on_success = get_env("METAFLOW_NOTIFY_ON_SUCCESS")

if notify_on_error and status == "Failed":
email_notify(notify_on_error)
elif notify_on_success and status == "Succeeded":
# AIP-8098 ExitHandler and Ops notification NOT called on Workflow.status == Error
# available statuses of Succeeded, Failed, Error
if notify_on_success and status == "Succeeded":
email_notify(notify_on_success)
elif notify_on_error:
email_notify(notify_on_error)
else:
print("No notification is necessary!")

Expand Down

0 comments on commit d902080

Please sign in to comment.