https://prefect.io logo
Title
b

Barada Sahu

09/06/2022, 8:59 AM
Hey folks, What’s the expected behaviour when there’s a cleanup task waiting on a set of tasks and one of the upstream task fails? How does the overall state of the flow get resolved? Code below to clarify this.
@flow
def test_flow(nums: list = None):
    test_futures = [square.submit(num) for num in nums]
    return do_cleanup.submit(wait_for=test_futures)
In the above does do_cleanup get invoked or does the flow directly go into a failed state?
1
k

Khuyen Tran

09/06/2022, 2:55 PM
You might find this useful
b

Barada Sahu

09/06/2022, 4:15 PM
The behaviour is not exactly deterministic as per the docs. E.g. •
do_cleanup
is not being invoked if any of the
test_futures
fail Running prefect 2.2.0
k

Khuyen Tran

09/07/2022, 3:02 PM
It is because of your
wait_for
argument. If you remove
wait_for
,
do_cleanup
will run