Skip to content

fix(edge): separate attempt-cleanup from terminal finish on fault-escalation (#867)#875

Merged
DeliciousBuding merged 1 commit into
masterfrom
fix/867-executor-escalation-finish
Jul 17, 2026
Merged

fix(edge): separate attempt-cleanup from terminal finish on fault-escalation (#867)#875
DeliciousBuding merged 1 commit into
masterfrom
fix/867-executor-escalation-finish

Conversation

@DeliciousBuding

Copy link
Copy Markdown
Collaborator

Closes #867

Summary

ProcessExecutor fault-escalation auto-retry re-registered e.running[runID] then returned, which fired defer e.finish(runID) and deleted the successor attempt's concurrency slot. Attempt cleanup was conflated with terminal finish.

Additionally, wait failures returned early via publishFailed inside the session-retry loop, so the post-loop fault-escalation path was unreachable.

Fix

  • Gate deferred finish with terminalFinish; set false on escalation handoff so the successor owns terminal teardown
  • On non-session wait failure, break to the escalation check instead of terminalizing immediately
  • Re-queue from started/failed, re-register cancel under lock, then spawn successor run()
  • Preserve attempt-local cleanup (process/output maps) without releasing the slot

Test evidence

cd edge-server && go test ./internal/lifecycle/ -count=1
ok

go test ./internal/lifecycle/ -run 'TestProcessExecutorFaultEscalation' -v
--- PASS: TestProcessExecutorFaultEscalationRetryKeepsRunRegistered
--- PASS: TestProcessExecutorFaultEscalationExhaustedSingleFinish

Regression coverage:

  • fail → escalation retry → run still registered in e.running
  • exhausted / MaxRetries=0 → single terminal finish; second finish is idempotent

Files

  • edge-server/internal/lifecycle/process_executor.go
  • edge-server/internal/lifecycle/process_executor_test.go

…alation (#867)

Fault-escalation auto-retry re-registered the concurrency slot then returned,
which ran deferred finish() and tore down the successor attempt's running entry.
Also make wait failures fall through to the escalation check (path was unreachable
due to early publishFailed return).

- Skip terminal finish on retry handoff (successor owns the slot)
- Re-queue from started/failed and re-register cancel under lock before handoff
- Regression: fail→retry stays registered; exhausted/disabled → single finish
Copilot AI review requested due to automatic review settings July 17, 2026 19:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@DeliciousBuding, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 369eb284-471c-40d9-aef0-f43af31c1e86

📥 Commits

Reviewing files that changed from the base of the PR and between 71e1b40 and f1a68e1.

📒 Files selected for processing (2)
  • edge-server/internal/lifecycle/process_executor.go
  • edge-server/internal/lifecycle/process_executor_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/867-executor-escalation-finish

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DeliciousBuding
DeliciousBuding merged commit c86b74c into master Jul 17, 2026
16 checks passed
@DeliciousBuding
DeliciousBuding deleted the fix/867-executor-escalation-finish branch July 17, 2026 19:08
DeliciousBuding added a commit that referenced this pull request Jul 17, 2026
Close Phase 43 rollup (PRs #871-#875) and open Phase 44 section
(#876-#881 security residual + design system + mobile auth).
Keep MASTER ≤150 lines.
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.

P43: ProcessExecutor separate attempt-cleanup from terminal finish on fault-escalation (stability P0)

2 participants