https://prefect.io logo
Title
a

ale

04/14/2023, 7:25 AM
Hey folks 👋 We are experiencing an interesting behaviour with Prefect 1.4.0 and flows that run with ECSRun config on an ECS Agent. When a flow is cancelled, either from the UI or by calling
client.cancel_flow_run
, it seems the ECS task of the flow run is not stopped and stays in the Running state indefinitely. Has anyone experienced such behaviour? Is this expected or not? Thanks!
cc @grandimk
d

Dylan

05/09/2023, 9:58 AM
Experiencing this as well. Did you manage to get a reply elsewhere or find a solution @ale?
a

ale

05/09/2023, 10:01 AM
Hey @Dylan 👋 We ended up raising an
ENDRUN
signal instead of calling
client.cancel_flow_run
By doing this, Prefect is able to decommission the ECS task of the flow properly
d

Dylan

05/09/2023, 10:16 AM
Hi @ale, thanks for replying. Glad you managed to find a workaround. I'm wondering if I can achieve the same with Prefect 2.8, preferably through the API. I'm unfamiliar with signals, do you have a link to any Prefect documentation? Struggling to find it in here - https://docs.prefect.io/2.10.7/api-ref/prefect/client/base/
a

ale

05/09/2023, 1:32 PM
Hey @Dylan I’m not sure signals exist in Prefect 2.x And I don’t have much experience with Prefect 2.x, so I suggest you to ask in #prefect-community 😊
d

Dylan

05/09/2023, 1:33 PM
Gotcha, thanks Ale
a

ale

05/09/2023, 2:32 PM
You’re welcome 😊