﻿# Ray actor restart: a new constructor is not a restored state machine

Design Ray actor recovery around constructor re-execution, explicit checkpoints and method retry outcomes instead of relying on max_restarts alone.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/ray-actor-restart-state-reconstruction/
Language: en

An actor tracks completed evaluation partitions in memory. Its process crashes, Ray restarts it, and health checks pass, yet its completion set is empty. Successful process recreation is only part of recovery. The application still needs a state-machine contract for accepted methods and the state they changed.

## List the state beyond initialization

Separate constructor defaults from mutable counters, completed-input identities, loaded model revision and external publication records. Mark which state is disposable and which determines future decisions. The [Tune checkpoint guide](/journal/fg2-ray-tune-function-checkpoint-state-report/) explains coherent application snapshots for a different lifecycle. Here the actor's ongoing method interface adds a further question: which accepted state transitions must remain visible after process recreation, and which unsaved transitions may be repeated?

## Read what automatic restart recreates

The [actor fault-tolerance guide](https://docs.ray.io/en/latest/ray-core/fault_tolerance/actors.html) says automatic restart reruns the constructor. max_restarts does not serialize the actor's mutable Python state. Implement an explicit restoration path or deliberately declare the state ephemeral. If a checkpoint is stored externally, the guide requires accessibility from another node where the actor may restart. A local path on the former node is not sufficient evidence that a new constructor can load the intended snapshot.

## Separate process and method budgets

Actor restart and actor method retries have different controls. A restarted actor can become available while a particular method has exhausted its retry budget. Conversely, retrying a method does not reconstruct all earlier application state. Record both effective settings with the incident. The guide warns that an error can be returned even when the method executed before the actor died. Classify that result as uncertain until application evidence resolves the state transition or its external effect.

## Restore a coherent transition boundary

Define a checkpoint whose progress identities match its saved state. On restart, load it before accepting ordinary methods, and establish how to resolve a repeated operation identifier. If external effects participate, preserve their independent acceptance records rather than assuming the actor checkpoint rolled them back. The [conditional publication guide](/journal/guide-http-precondition-publish/) explains an adjacent atomic update boundary. Neither a conditional pointer nor an actor restart alone creates a transaction covering every earlier method and external write.

## Exercise loss around persistence

Use disposable partitions and interrupt an actor before persistence, after persistence and before the caller observes its result. Compare restored completion identities and published artifacts with the intended contract. Preserve constructor generations and method identities, not merely a continuous health chart. Check error paths as well as successful calls. This proposed exercise should expose duplicate or missing transitions without claiming any particular recovery duration, availability figure or throughput for an untested deployment.

## Preserve owner and cluster limitations

The [object fault-tolerance guide](https://docs.ray.io/en/latest/ray-core/fault_tolerance/objects.html) separates live-owner reconstruction from owner failure. Non-detached actor owner failure is also a distinct lifecycle from an actor process crash, as the actor guide explains. Do not extrapolate a process-restart test into recovery of a lost creator or an entire cluster. Acceptance means the declared state and method boundary survives the tested failure class, with remaining uncertainty stated. A new responsive actor process is necessary evidence of availability, not sufficient evidence of application continuity.
