follow up with my issue above, it seems like `on_c...
# ask-community
t
follow up with my issue above, it seems like
on_cancellation
still have trouble firing off, even it's said to have been resolved in this github issue. So far I'm still experiencing it. I've tried both self-hosted and Prefect cloud. My worker is a local process. I've cancelled for over 50 times, and only 1 time it actually able to call the hook.
thank you 1
b
Hi Tri, thanks for opening that issue. I was able to replicate what you're seeing with the process worker as well, although it does seem to work consistently with a served flow. In the meantime, would you mind sharing some details around: • Why you'd prefer to use a process worker as opposed to
.serve()
? • What action would you like to take within your cancellation hook? Is it to send a notification? There may be some suggestions we can throw your way to unblock you.
t
1. Why you'd prefer to use a process worker as opposed to
.serve()
? a. using
.serve()
would hang the terminal, If someone accidentally close that terminal then all our critical flows will also die? b. we will need to schedule a lot of flows, am I going to put them together into 1 single file and serve? c. Or we could split flows up into smaller files, but then will need to serve on many terminals, keeping track of them will be a hassle. d. So I feel like deploy through yaml and forget about it (letting the server handle everything) is the best way e. someone also have the same thought here https://github.com/PrefectHQ/prefect/issues/14690 f. please let me know if my thoughts are correct 2. What action would you like to take within your cancellation hook? Is it to send a notification? 1. yes, I need to send a notification email
on_crash
,
on_failure
,
on_cancellation
. I assume you are alluding to automation? I like automation but it has to be done in UI, but we cannot version control it. 2. we also need to do cleanup work. E.g. a flow could call an executable, so we need to kill that exe if flow is cancelled.