feat(xcecli): jobs kill --signal and --force

The control API already takes `signal` (kill only: that signal once,
instead of the graceful INT, TERM, KILL sequence) and `force_kill`
(SIGKILL at once); xcecli could not send either. `jobs kill` now has
-s/--signal <name|number> (names in any case, SIG prefix optional, sent
upper case without it) and --force, in both the job-ID and the filter
request; using both at once, or an empty signal, is refused before any
request. stop and resume get neither (the server rejects a signal there).
Kill help and docs/xce.md "Killing and stopping jobs" document the flags.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-10 10:24:05 +00:00
parent 0379823098
commit 954c96cf5b
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
3 changed files with 178 additions and 7 deletions

View file

@ -64,9 +64,15 @@ Job control follows LSF's TERMINATE and SUSPEND actions:
- **Stop** (`xcecli jobs stop <id>`): SIGTSTP first, so the job can catch
it, prepare and stop itself; SIGSTOP follows after the interval if it has
not stopped. **Resume** sends SIGCONT and cancels a stop still in progress.
- **Explicit signal**: that signal only, once (REST API: `signal` in the
control request, kill action; `xcecli` has no signal option yet).
- **Force kill**: SIGKILL at once (REST API: `force_kill: true`).
- **Explicit signal**: that signal only, once (`xcecli jobs kill -s
<name|number> <id>`, e.g. `-s TERM`, `-s SIGUSR1`, `-s 9`; REST API:
`signal` in the control request, kill action only).
- **Force kill**: SIGKILL at once (`xcecli jobs kill --force <id>`; REST
API: `force_kill: true`).
`--signal` and `--force` work with job IDs and with the filters (`-J`, `-q`,
`-u`, `-a`), and cannot be used together. `stop` and `resume` take no
signal.
The interval is the API server's `job.terminate_interval` setting
(`config/app.yaml`, seconds; default 10 when unset or 0, as LSF's