Skip to content

feat: SIGKILL when SIGTERM don't to the job#14

Merged
JonasKs merged 1 commit into
mainfrom
sigkill
Apr 1, 2026
Merged

feat: SIGKILL when SIGTERM don't to the job#14
JonasKs merged 1 commit into
mainfrom
sigkill

Conversation

@JonasKs

@JonasKs JonasKs commented Apr 1, 2026

Copy link
Copy Markdown
Member

SIGTERM not always sufficient, so implement SIGKILL to fix stuff like this: https://x.com/samuelcolvin/status/2039112941316796582

…ations

process.rs:
- Shared kill_port() used by both CLI and API
- SIGTERM → poll every 100ms with ps -p (EPERM-safe) → SIGKILL after 2s
- Tracks original PIDs to avoid killing replacement processes
- find_listeners returns Result (surfaces lsof failures)
- pid_exists uses ps -p (ownership-independent, not kill -0)
- KillResult: Killed, ForceKilled, NotFound, Error
- ForceKilled only when kill -9 actually succeeds
- Error when process is still alive but unkillable (EPERM)
- 6 tests covering find_listeners, pid_exists, kill flow

ports.rs:
- merge_alive() for combining TCP scan + container ports
- Replaces 4 duplicated merge loops across scanner, handlers, and CLI

template.rs:
- Toast notifications for kill and unregister actions
- Success/error toasts with auto-dismiss after 3s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JonasKs JonasKs merged commit 52f3111 into main Apr 1, 2026
2 checks passed
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