Yufei Li
12/06/2024, 3:45 PMon_crashed
state change hook? I tested it using my local env (process worker) and it went to crashed status and ran the on_crashed
hook. However, when I run it in the prod env (kubernetes worker), the flow crashed due to EKS pod memory size is too small, but it didn't run the on_crashed
hook at all. Could someone please help🙏?
local env:Yufei Li
12/06/2024, 3:46 PMJake Kaplan
12/06/2024, 3:49 PMon_crashed
hook will execute as part of the python process your flow run is executing in. So if theres a crash in process, it can execute.
However if the entire process dies, like from an out of memory error, it doesn't have an opportunity to run.
I would look at setting up an automation https://docs.prefect.io/v3/automate/index#automate-overview, which should let you take external actions when a crashed state occurs.Yufei Li
12/06/2024, 3:51 PMJake Kaplan
12/06/2024, 4:04 PM2.x
however it's an experimental feature. You'd have to set on your server PREFECT_EXPERIMENTAL_EVENTS=True
Automations are fully supported in Cloud and 3.x
versionsYufei Li
12/06/2024, 4:38 PM