Repository navigation
Simplify the hotfix supervisor lifecycle - #271
Conversation
|
Warning Review limit reachedNext included review available in 35 minutes. View limit detailsLimit details: You’ve used the included review currently available. This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe supervisor script now uses separate functions for process spawning, child monitoring, startup health checks, and request handling. New tests exercise failure recovery, debugger lifecycle paths, safe-mode behavior, stream relaying, and umask preservation. ChangesSupervisor lifecycle
Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~45 minutes Change: Refactor Sequence Diagram(s)sequenceDiagram
participant ControlRequest
participant podbench_supervise
participant ApplicationChild
ControlRequest->>podbench_supervise: submit start, stop, restart, or launch request
podbench_supervise->>ApplicationChild: spawn or terminate process
ApplicationChild-->>podbench_supervise: health result, heartbeat, or exit status
podbench_supervise-->>ControlRequest: write response and updated state
Merge Risk: ⚪ Minimal · up to The lifecycle refactor does not show an actionable current-head failure. It is mergeable after normal validation. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
Summary
The hotfix supervisor mixed request dispatch, startup waiting and debugger completion in one nested loop. Extract those responsibilities into named helpers, centralize state/hold updates, and share child spawning and PID bookkeeping between normal startup and debugger Launch. Keep the existing lifecycle protocol, probe ownership and descendant cleanup.
Sharing startup fixes Launch inheriting the supervisor's private
077umask instead of the application's original mask (for example027). Health checks now have a one-second forced-kill grace after their existing five-second timeout, so a check that ignores TERM cannot block lifecycle requests indefinitely.Validation
The runtime grows from 229 to 243 lines: the simplification removes duplicated responsibilities and nested control flow rather than compressing the shell text.
Summary by CodeRabbit
Bug Fixes
Tests