You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
state: an InvokeActor with no onError fires the zero event at the parent instead of escalating #250
When an InvokeActor actor with no WithInvokeOnError can't start, or fails after it ran, the actor system fires the zero event at the parent. state/doc.go's v1 section says a child failure with no onError declared escalates to the parent (the G3 default), and a Spawn with none does. WithInvokeOnError's godoc says the zero event is fired, so the two docs disagree.
Why it matters for durable
Recover retries a spawn that failed with nothing declared to catch it, and leaves alone one whose declared onError was refused, for example by a guard. With the zero event fired, durable can only tell the two apart by whether the parent refused it as having no transition (errors.Is(err, state.ErrNoTransition), added in #234), which is a stopgap. That gets these wrong:
a declared onError the parent's current state has no transition for is retried;
a wildcard (OnAny) or a forbid (ForbidAny) that takes the zero event, or a transition declared on it, counts as caught, so the spawn isn't retried.
A host that consumes SpawnActor effects and reads OnError sees the zero event, not "none declared".
escalate when no onError was declared, with SpawnActor.OnError nil, as for a Spawn; it passed every scenario test, but it changes the routing v1 documents;
an additive flag saying whether an onError was declared.
Tests:#234 adds skipped tests: TestSpawnRule_DeclaredOnErrorWithNoTransitionIsDone, TestRecover_RetriesANoOnErrorSpawnEvenWhenTheZeroEventHasATransition and TestRecover_RetriesANoOnErrorSpawnAWildcardSwallowed.
#268 (27ad55e) fixes the main case here. An invocation now carries explicit flags for what it declared: Invocation.HasOnDone/HasOnError, carried to SpawnActor.HasDone/HasError. So an InvokeActor with no WithInvokeOnError escalates its failure to the parent, as a Spawn does, instead of firing the zero event.
Two of the skipped tests from #234 now pass and are unskipped, in durable/spawn_zero_event_test.go:
One case is still open, so I'm leaving this issue open for it. A declared onError that the parent's current state has no transition for is still retried. Durable tells it apart from a handled onError only by the ErrNoTransition refusal, the stopgap at durable/runner.go:931. TestSpawnRule_DeclaredOnErrorWithNoTransitionIsDone stays skipped, with its reason narrowed to that case. The has-onError flag gives durable what it needs to drop the stopgap in a follow-up.
Activity
revert: keep state's v1 behavior; track compound starts and undeclare…
fix(durable): don't journal a step whose context ended partway (#234)
fix(state,durable): route an invoked actor only through outcomes its …
fix(durable): replay an actor's done data and errors as the live run …
reka18 commentedon Nov 24, 2026
#268 (27ad55e) fixes the main case here. An invocation now carries explicit flags for what it declared:
Invocation.HasOnDone/HasOnError, carried toSpawnActor.HasDone/HasError. So anInvokeActorwith noWithInvokeOnErrorescalates its failure to the parent, as aSpawndoes, instead of firing the zero event.Two of the skipped tests from #234 now pass and are unskipped, in
durable/spawn_zero_event_test.go:TestRecover_RetriesANoOnErrorSpawnEvenWhenTheZeroEventHasATransitionTestRecover_RetriesANoOnErrorSpawnAWildcardSwallowedOne case is still open, so I'm leaving this issue open for it. A declared onError that the parent's current state has no transition for is still retried. Durable tells it apart from a handled onError only by the
ErrNoTransitionrefusal, the stopgap atdurable/runner.go:931.TestSpawnRule_DeclaredOnErrorWithNoTransitionIsDonestays skipped, with its reason narrowed to that case. The has-onError flag gives durable what it needs to drop the stopgap in a follow-up.