Skip to content

fix(hack): let teardown delete crashed actors - #942

Open
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:issue-794-teardown-crashed-actors
Open

fix(hack): let teardown delete crashed actors#942
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
agent-substrate:mainfrom
orangeCatDeveloper:issue-794-teardown-crashed-actors

Conversation

@orangeCatDeveloper

@orangeCatDeveloper NekoPunch (orangeCatDeveloper) commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #794

A crashed actor makes --delete-all abort mid-teardown, leaving the ActorTemplate behind; the next --deploy-demo-counter is then rejected on the immutable spec and the cluster keeps serving the stale golden snapshot.

prepare_actor_for_delete treats STATUS_CRASHED as unexpected and returns 1, which errexit turns into a hard abort — even though DeleteActor accepts CRASHED (workflow_delete.go). Teardown now treats crashed actors as deletable as-is.

The demo flag dispatch had the mirror-image defect: handlers ran from an if condition, which suppresses errexit for their whole call tree, so this same teardown — and failed deploys like the issue's immutable-spec apply — exited 0. Handlers now run as plain commands and report an unclaimed flag through ate_demo_flag_unhandled.

Before (main, actor in STATUS_CRASHED):

[step]:   preparing actor ate-demo-counter/repro-794 for delete
cannot delete actor repro-794: unexpected status STATUS_CRASHED
# exit 1; ActorTemplate "counter" survives, ate-system untouched

After (this branch, same state):

[step]:   preparing actor ate-demo-counter/repro-794 for delete
actor "repro-794" deleted
...
actortemplate.ate.dev "counter" deleted from ate-demo-counter namespace
# full teardown completes, exit 0

Repro: deploy the counter demo, resume an actor, delete its worker pod (~20s later the syncer marks it STATUS_CRASHED), run --delete-all.

--delete-all aborted on the first STATUS_CRASHED actor, leaving the
ActorTemplate behind; the redeploy then failed on the immutable spec and kept
serving the previous golden snapshot. DeleteActor already accepts CRASHED, so
teardown can delete those directly.

Demo handlers also ran from an `if` condition, which suppresses errexit for
their whole call tree and turned any failed deploy into exit 0. They now run as
plain commands and report an unclaimed flag through ate_demo_flag_unhandled.
@orangeCatDeveloper
NekoPunch (orangeCatDeveloper) force-pushed the issue-794-teardown-crashed-actors branch from 40c7936 to e869172 Compare August 14, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install-ate.sh: a crashed golden actor makes --delete-all keep the old golden snapshot

1 participant