Repository navigation
fix(supervisor): respawn a crashed consumer once, after its backoff - #1540
Conversation
…ation
Two paused-time tests for ISS-SUPERVISOR-RESPAWN-BACKOFF-NOT-APPLIED. Both
fail on the current RespawnG arm: the first respawn happens before its
200 ms backoff, and a child escalated past 10 crashes is brought back by
the self-rescheduling RespawnG { crash_count: 0 } chain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
The respawn path is now the delayed cast alone. On ActorTerminated the
supervisor checks the escalation threshold, then casts RespawnG with the
crash count after min(100ms * 2^n, 30s). RespawnG spawns the child, carries
the count onto the new slot, does nothing if the slot is already live, and
never reschedules itself. Before, it spawned at once and started a
RespawnG { crash_count: 0 } chain that repeated every 100 ms forever and
respawned children escalated past 10 crashes. The escalation message no
longer names a ResetCrashCount message that does not exist.
The two backoff tests now supervise different G slots: ractor's registry
is process-global and the tests run in parallel.
Closes ISS-SUPERVISOR-RESPAWN-BACKOFF-NOT-APPLIED.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
A disable run shows no test can distinguish it: ractor's registry refuses a duplicate actor name anyway. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c8e1d8ef1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…window Spec §5.3 escalates on more than ten crashes within five minutes; the current count is lifetime-wide (codex P1 on #1540). Fails on the current code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Spec §5.3 escalates on crash_count > 10 within a five-minute window; the count was lifetime-wide, so any eleventh crash removed a child however far apart the crashes were (codex P1). A crash more than CRASH_WINDOW after the previous one now starts the count at 1. last_crash_ts records the crash time, carried through RespawnG (new field crashed_at), taken from tokio's clock so the window follows paused time in tests and the real clock otherwise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Fixes
ISS-SUPERVISOR-RESPAWN-BACKOFF-NOT-APPLIED(filed in #1539).The bug
In
crates/lance-graph-supervisor/src/supervisor.rs, theRespawnGarm:RespawnG { crash_count: 0 }, which ran the same arm again. That started a chain that repeated every 100 ms for the life of the supervisor. Every crash added another chain.A correction to the issue text: the crash count was not reset on every round. While the child is live, those chained respawns fail on the duplicate actor name in ractor's registry. What the chain did break is escalation: once crash 11 removes the slot, the next round of the chain finds the name free and respawns the child with count 0.
The fix
On
ActorTerminated, the supervisor now:min(100ms * 2^n, 30s);RespawnGwith the crash count.RespawnGspawns the child and gives the new slot that crash count. It does nothing if the slot is already live, and it never schedules itself again. The escalation log no longer names aResetCrashCountmessage, which does not exist.Escalation window (codex P1, added after review)
Spec §5.3 escalates on more than ten crashes within five minutes; the count used to be lifetime-wide. A crash more than five minutes after the previous one now restarts the count at 1.
last_crash_tsrecords the crash time, carried throughRespawnG's newcrashed_atfield and taken from tokio's clock. Pinned bythe_count_restarts_after_a_quiet_window(written first, failed before the fix). Disable runs: forcing every crash to count from 1 fails all three tests; never resetting fails the window test.Tests (written first, paused tokio time)
New file:
tests/supervisor_respawn_backoff.rs.each_crash_respawns_once_after_its_backoffa_child_past_the_escalation_threshold_stays_downThe two tests supervise different G slots, because ractor's registry is shared across the process and the tests run in parallel.
Each guard in the fix was removed in turn to confirm a test catches it:
Gates
cargo test -p lance-graph-supervisor --features supervisor: all suites pass. The new file was run three times in a row.cargo clippy -p lance-graph-supervisor --features supervisor --all-targets -- -D warnings: clean.cargo fmt --check: clean.Cargo.tomlchange is adding tokio'stest-utilfeature to dev-dependencies (needed for paused time).Board
The issue entry and the vertical-slice doc row both live on #1539, which has not merged yet. Once #1539 merges, I'll merge main into this branch and update both: the issue to RESOLVED, with the corrected "count reset" detail above, and the slice doc's backoff row to "applied".
Still open
After escalation, Health reports the child's crash count as 0 (
is_live: false), because the slot is removed. That is unchanged by this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Generated by Claude Code
Generated by Claude Code