Skip to content

durable: an explicit stopActor during a step or a respawn can leave the actor sets out of step #261

Done

Description

@reka18

What happens

#235 makes durable skip spawning a state's actor when that actor's state was already left in the same step (a parent Fire stopped it, or a later timer in the same Tick stops it), and stops a respawned actor whose state is no longer active after Recover. Two gaps remain, both involving an explicit stopActor while the declaring state stays active:

  • A skipped spawn isn't noted as attempted. A Fire enters state Y, which declares actor kitchen; an entry action, or a parent Fire an actor drives, then runs stopActor("kitchen") while Y stays active. The spawn is skipped and never marked attempted, so the actor sets record kitchen as unstarted, and a later Recover spawns it fresh and runs its behavior, where the live Handle has no such actor. On main the spawn ran and stopped, and it was counted as ended.
  • A stop that arrives before its target respawns has no effect. Recover respawns running actors A and C in one batch. A's respawn fails and its onError runs stopActor on C before C is running, so the stop does nothing and C respawns. C's state is still active, so the post-respawn pass keeps it, while the journal holds the stop.

Possible fix

Mark a skipped spawn as attempted and ended when the skip comes from an explicit stop (not from leaving the state), and apply the stops noted during a batch respawn to the actors it respawned.

Relates to: #235, #256, #257, #260

Activity

  1. added a commit that references this issue on Nov 25, 2026
    663de98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions