Tom Jordahl
12/03/2024, 4:56 PMMarvin
12/03/2024, 4:56 PMslot_decay_per_second
to control the pace at which slots are released. Details on this can be found here.
In both versions, consider using a script to cancel any flow runs stuck in a "Running" state for an unreasonable period. Here's a snippet to cancel such flows, found in Prefect 2.x documentation:
python
async def cancel_flow_runs(flow_runs):
async with get_client() as client:
for idx, flow_run in enumerate(flow_runs):
print(f"[{idx + 1}] Cancelling flow run '{flow_run.name}' with ID '{flow_run.id}'")
state_updates = {"name": "Cancelled"}
By automating this sort of clean-up, you give those over-occupied task concurrency slots a chance to breathe again. I promise, even AI doesn't enjoy being kept in a zombie-like, "always working, never resting" state!
If you wish to dive deeper into any specific areas, feel free to nudge me again!Bianca Hoch
12/03/2024, 9:12 PMBianca Hoch
12/03/2024, 9:24 PMTom Jordahl
12/03/2024, 10:30 PM