In this article
A worker holding a Dask actor cannot be retired through the documented retirement paths; recreating a stateful service needs an application handoff.
An adaptive Dask cluster removes ordinary workers but retains one apparently idle process hosting an actor. The actor’s mutable state changes the retirement contract. Treating it like an ordinary recomputable task can turn a planned scale-down into an unplanned loss of service state.
Identify the stateful resident
Record the actor’s worker, application identity, callers and mutable state. An idle CPU does not make this state disposable. The actor guide describes creating actors through normal submission facilities but gives them different execution and fault-tolerance characteristics. The process ownership guide explains why a resource’s usable lifetime belongs to a process boundary, rather than to a convenient reference in the submitting program.
Read the retirement limitation
The actor guide states that actors cannot migrate and that a worker holding an actor cannot be retired through retire_workers or Adaptive. Verify this limit before increasing scale-down aggressiveness or interpreting the retained worker as a scheduler defect. The Client API exposes retirement controls, but an available administrative operation does not promise application-state migration. Separate the retirement request from actual worker removal and the state that prevents the intended operation.
Define an application evacuation contract
If maintenance requires replacement, define a quiescence point, exportable state, restoration validation and caller redirection. These are proposed application responsibilities, not a built-in Dask actor migration feature. Preserve accepted operation identities and external effects when choosing the handoff boundary. The checkpoint guide explains coherent saved state in an adjacent lifecycle. A serialized actor snapshot still needs a receiving application path and a clear decision about calls arriving during transfer.
Keep failure distinct from planned handoff
The actor documentation explicitly says no effort is made to preserve actors after worker failure; the actor is lost with that worker. A planned export does not imply automatic crash recovery. Define what state loss is acceptable between snapshots, and make callers distinguish a known replacement from an unavailable old instance. Avoid calling forceful worker loss a migration. It may free capacity while discarding the very state that made controlled retirement refuse to proceed.
Verify caller and state continuity
In a disposable service, populate recognizable actor state and attempt the documented retirement path. Then exercise the separately implemented handoff, if one exists. Record worker residence, accepted calls, exported state, replacement identity and routing changes. Verify that callers do not continue updating the old instance after the chosen boundary. Acceptance concerns the declared state continuity, not merely a lower worker count. No migration latency or successful production evacuation is asserted without actual evidence.
Decide whether an actor fits the lifecycle
If the workload needs transparent recomputation or frequent elastic worker removal, consider whether ordinary tasks with durable external state better match its requirements. This is a design comparison, not a claim that every actor should be replaced. Keep actor execution benefits separate from operational limits. A clear plan names who can stop calls, save state and authorize replacement; it does not promise that adaptive scaling can infer those obligations or preserve arbitrary mutable Python objects after an unexpected worker failure.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.