Pierre Vogler-Finck
01/26/2023, 2:16 PMCrash detected! Execution was cancelled by the runtime environment.
and then Crash detected! Execution was interrupted by an unexpected exception: httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'http://[our instance url]/api/task_runs/'
For more information check: <https://httpstatuses.com/500>
)
A minimum running example is (in Python 3.10 with prefect 2.7.9) :
import time
from prefect import unmapped, flow, task
@task(name="Sleeper {id}")
def sleeper(id, seconds_to_wait: int):
print(f"Start Sleeper {id}")
time.sleep(seconds_to_wait)
print(f"End Sleeper {id}")
@flow(
name="Prefect 2 concurrency checker",
)
def flow(n_runs: int = 128, seconds_to_wait: int = 2):
res = sleeper.map(list(range(n_runs)), seconds_to_wait=unmapped(seconds_to_wait))
return res
if __name__ == "__main__":
res = flow()
print("done")
In Prefect 1, we had a way to limit the number of task run creations, but that's apparently not available in Prefect 2 AFAIK (note: we've tried tag-limiting, but that's not helping as it's the creation of the many tasks that kills it, not their actual run ; we've also tried an async approach, which fails in the same way).
My questions to you:
1- Have you ever experienced this too?
2- Did you find a walk-around?
3- If not, do you have an idea of how to manage this?Timo
03/30/2023, 5:55 AMThomas Pedersen
03/30/2023, 6:33 AMTimo
03/30/2023, 6:35 AM