feat(runner): add kill command to terminate running sandboxes#3153
feat(runner): add kill command to terminate running sandboxes#3153
Conversation
fa346c7 to
fd56e0c
Compare
Code Review: PR #3153SummaryThis PR adds a 4 commits reviewed across 3 files (1 new, 2 modified). Key FindingsCritical Issues (P0)None. High Priority (P1)None. Medium Priority (P2)
Low Priority Observations
Bad Smell AnalysisAll 17 bad smell categories checked -- zero violations found:
Positive Highlights
Recommendations
VerdictLGTM -- Clean, well-designed PR with no critical or high priority issues. The medium priority suggestion about logging kill errors is a nice-to-have for operator experience but not a blocker. Ready to merge once live testing is done. Full review details: |
Code Review: PR #3153Reviewer: Claude Code (automated) SummaryThis PR adds a Key FindingsNo Critical Issues (P0)No blocking issues found. Observations and Suggestions (P1/P2)
Positive Observations
VerdictLGTM -- The code is well-structured, follows existing patterns, and the iteration across commits addressed the important issues. The remaining suggestions (comment typo, cleanup UX) are all low-severity polish items that could be addressed in follow-up. |
Code Review: PR #3153 — feat(runner): add kill command to terminate running sandboxesSummaryAdds The initial commit had several issues (hardcoded paths, naive orphan detection, Verdict: LGTMNo critical or high-priority issues remain. All identified problems were resolved within the PR itself. The code is well-structured, appropriately simple, and follows project conventions. Positive Highlights
Issues Resolved Within PRThese were found in the initial commit and fixed in subsequent commits — listed for completeness:
Remaining Observations (Non-blocking)
Test Coverage
Bad Smell Analysis
Full review details: |
824aa55 to
14f63e2
Compare
Code Review: PR #3153 — feat(runner): add kill command to terminate running sandboxesSummaryThis PR adds a Key FindingsP0 — Critical:
|
14f63e2 to
951c707
Compare
Code Review: PR #3153feat(runner): add kill command to terminate running sandboxes SummaryThis is a well-designed, clean addition of a Key FindingsCritical Issues (P0)None. High Priority (P1)
Medium Priority (P2)
Bad Smell Analysis
Positive Highlights
Recommendations
VerdictChanges Requested — Two P1 issues (silent error swallowing, inadequate panic logging) should be addressed before merge. Both are small fixes. The overall design and implementation quality is high. Full review details: |
951c707 to
aa5116c
Compare
Code Review: PR #3153SummaryThis PR adds a Files changed: 4 files, +345 lines Key FindingsCritical Issues (P0)None. High Priority (P1)None. Both P1 issues from the previous review iteration (
Medium Priority (P2) — Non-blocking
Bad Smell Analysis
Positive Aspects
VerdictLGTM — Ready to merge. No critical or high-priority issues remain. The three medium-priority items are optional improvements that can be addressed in follow-up work. The live sandbox testing on dev-2 (per the PR test plan) should be completed before merge. Full review details: |
Add `runner kill <run-id> [--force]` that discovers running Firecracker
sandboxes via /proc scanning, resolves the target by full UUID or unique
prefix, and terminates it with SIGKILL via killpg on the process group.
Cleanup is conditional: if the parent runner daemon is alive, it handles
cleanup via its crash detection path. For orphan processes (parent runner
dead), the kill command also removes workspace and socket directories.
Key design decisions:
- Reads PGID from /proc/{pid}/stat and uses killpg to kill the entire
process group (sudo, ip netns exec, firecracker) in one signal
- Orphan detection walks the ppid chain (up to 16 levels) to account
for the runner -> sudo -> ip netns exec -> sudo -u -> firecracker
spawn chain
- Reuses process::discover_all() and process::is_orphan() shared with
the doctor command
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
aa5116c to
c8bb58d
Compare
Code Review: PR #3153SummaryClean, well-structured implementation of a Files changed: 4 (371 insertions)
Key FindingsCritical Issues (P0)None. High Priority (P1)None. Medium PriorityNone actionable. An initial concern about overlay directory cleanup during orphan cleanup was investigated and found to be a non-issue: Notable Design Decisions
Bad Smell AnalysisAll clear across 17 categories:
Test Coverage11 new tests added:
Remaining Action Item
VerdictLGTM — This is a clean, focused implementation with good design decisions, proper error handling, and solid test coverage. Ready to merge after live testing on dev-2. Full review details: |
Summary
runner kill <run-id> [--force]command to terminate running Firecracker sandboxes/procscan (no--configrequired, likedoctor)--force)Closes #3152
Test plan
cargo clippy -p runnerpassescargo test -p runner— 147 tests pass (9 new)🤖 Generated with Claude Code