Skip to content

Complete supervised recovery and restart shutdown - #81

Merged
cevr merged 2 commits into
mainfrom
fix/supervisor-self-stop
Sep 6, 2026
Merged

Complete supervised recovery and restart shutdown#81
cevr merged 2 commits into
mainfrom
fix/supervisor-self-stop

Conversation

@cevr

@cevr cevr commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Protected recovery could stop its own supervisor and wait forever. A failed initial spawn in a restarted generation could also end supervision early, leave retry budget unused, and never complete the actor exit.

Treat the supervisor as a self-stop caller. The shutdown owner waits for its cleanup and reports cleanup defects. After a restarted generation fails during startup, read its recorded exit and apply the existing retry policy.

  1. Self-stop and cleanup:
 protected supervisor recovery → actor.stop
-  join shutdown owner → owner waits for supervisor
+  mark supervisor interrupted → finish protected region
+  shutdown owner waits for cleanup → publish terminal result
  1. Restart failure:
 supervisor → newRuntime.start
-  startup defect ends supervisor without completing actor
+  read recorded generation exit
+  apply classifier and remaining budget
+  retry or complete actor exit

Full local gate:383 tests847 assertions,types,lint,format,build,and examples. Real actor tests cover protected self-stop, cleanup waiting and defects, retry exhaustion, and successful recovery on the third startup. A patch changeset records both fixes.

Two Counsel rounds are complete. Neither review found a blocker in the final change.

@cevr
cevr merged commit d4f3dea into main Sep 6, 2026
1 check passed
@github-actions github-actions Bot mentioned this pull request Sep 6, 2026
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.

1 participant