<@ULVA73B9P>, in prefect 2.x, why does a flow hang...
# ask-marvin
p
@Marvin, in prefect 2.x, why does a flow hang when it calls two concurrently running
async
subflows if those subflows use different
DaskTaskRunners
?
m
When running two concurrently executing
async
subflows with different
DaskTaskRunners
, you may experience a hang because of the complexities involved in managing parallelism across different task runners. Prefect 2.x allows for the use of different task runners in subflows, such as
DaskTaskRunner
, but this can introduce issues if not handled correctly. One key point is to ensure that the main function is guarded with
if __name__ == "__main__":
to avoid issues with parallel processing. This is crucial when running flows that involve parallel execution, as it prevents unintended behavior during the execution of subflows. Here's a relevant link to the Prefect 2.x documentation on task runners, which might provide further insights into handling such scenarios. If you continue to face issues, you might want to explore whether there are specific configurations or dependencies between the subflows that could be causing the hang.