flow
Prefect flow that keeps background DAG work off the machine for an update.
The desktop app installs an update by relaunching, and the relaunch kills the
orchestrator, its pods and every run they host. This flow is the quiet period
in front of that. It collects every slot of the machine-wide background DAG
limit (BACKGROUND_DAG_MACHINE_LIMIT_NAME) as running work gives them up, then
pauses holding them all until the desktop app releases it or its time runs out.
While it is live, background runs give way to it (update_hold_requested): a
new run is turned away once it has its slot, and a running one stops at its
next wave boundary. The slots are what make that a guarantee rather than a
request: a run that missed the check still cannot get a slot.
Its Prefect state is what the orchestrator reports back (update_hold.control):
Running while it collects slots, Paused once it holds them all, and a named
Completed once it lets them go. Served only by the desktop orchestrator,
which submits it from its /update/hold endpoint.
Module
Functions
update_hold_runtime
async def update_hold_runtime( max_wait_seconds: float, max_ready_seconds: float,) ‑> prefect.client.schemas.objects.State:Hold every background DAG slot on this machine until released.
Arguments
max_wait_seconds: How long running work may take to give the machine up before the hold lets go of it again.max_ready_seconds: How long the hold holds the machine once it has it, for an install that has not happened.
Returns
A Completed state named for how the hold ended, or Cancelled for a
hold that started too long after it was asked for.