https://dagster.io/ logo
Title
k

Kirk Stennett

09/28/2022, 12:25 PM
Hey all, curious about some functionality related to the
@failure_hook
. I had an instance where a job was invoked but resource creation failed and an error was thrown. I'd expect the failure_alert to be triggered there but nothing happened. Is that the expected functionality? Or is there a way to have that be under the umbrella of the job's failure hook?
c

claire

09/28/2022, 10:09 PM
Hi Kirk. Thanks for bringing this up. The reason why this error is occurring is because a resource is initialized once per-process before the step execution begins, and within the failure hook we only monitor step failure events. I can file a issue for this:
@Dagster Bot issue failure hook does not catch resource init failure events
d

Dagster Bot

09/28/2022, 10:09 PM
c

claire

09/28/2022, 10:15 PM
In the meantime, one workaround you could use is have a run failure sensor that detects when your job failed and kicks off a second job that does the same thing as your hook
k

Kirk Stennett

09/29/2022, 1:16 PM
Thanks! I figured that might be the case, I saw that solution elsewhere