Can anyone explain why this never completes? I've also tried it with a dask runner and it also hangs. This is with Prefect 2
Copy code
from prefect import flow, task
@task
def task1(x: int) -> int:
return x + 10
@task
def task2(x: int) -> int:
return -x
@flow()
def run_my_flow(n: int):
task2.map(task1.map(range(n)))
if __name__ == "__main__":
n = 500
print(run_my_flow(n))
✅ 1
👀 1
j
Jeff Hale
10/20/2022, 3:14 PM
Hi Trevor. I tried your code with n=5 and n=100 and it runs fine. With n=500 I observed the same hanging behavior as you. Adding a sleep timeout of .1 in the tasks doesn’t make it stop hanging, and neither does changing the log level to critical. I’ll ask my colleagues if they know why it’s hanging.
🙏 1
t
Trevor Kramer
10/24/2022, 12:36 PM
Hi @Jeff Hale Any update on this? Should I file a github issue on this
j
Jeff Hale
10/24/2022, 12:46 PM
Hi Trevor. I think opening an issue would be good. It’s next up on priorities for one of our engineers to investigate, but it would be nice to have it memorialized in an issue so none of the details of your case get lost.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.