https://prefect.io logo
Title
j

Justin Trautmann

12/05/2022, 2:30 PM
Hello community, hello Prefect team, the flow cancellation feature in 2.7 is very useful and exactly what our internal users were requesting. however, our tasks submit long running jobs to external services that would continue to run even if the flow running infrastructure is terminated. in order to save costs, it would be great to have the possibility to handle sigterm appropriately and cancel any external jobs before actually terminating. i played around with python signal handlers and found that the way how prefect executes the flow in a thread doesn't allow setting custom signal handlers the conventional way. are there any best practices available on how to deal with this type of situation? any input on how to react to sigterm from within a flow is very much welcome. thanks
:plus-one: 1
1
j

Jeff Hale

12/05/2022, 4:29 PM
This is great feedback. I don’t believe there is additional input at this time. Would you be able to file a feature enhancement issue on GitHub to that effect?
j

Justin Trautmann

12/05/2022, 5:12 PM
thanks jeff. i opened an issue https://github.com/PrefectHQ/prefect/issues/7766. looking forward to hear about potential solutions.
🙌 1
:thank-you: 1
j

Jarvis Stubblefield

12/07/2022, 12:26 AM
Really odd to me that I can’t run the agent because I don’t have what’s necessary to run the server.