lib.ec.ssh.AsyncSSH: Forward SIGINT to remote #182

Merged
Jan Lindemann merged 1 commit from jan/fix/20261120-lib-ec-ssh-asyncssh-forward-sigint-to-remote into master 2026-11-20 22:39:16 +01:00 AGit
Owner

lib.ec.ssh.AsyncSSH: Forward SIGINT to remote

The first Ctrl-C cancels the running task while the SSH connection is still open, but _run_ssh() has no cleanup: the connection is abandoned and the remote process is never signalled. A long-running command such as zypper dup therefore keeps running after the client dies, taking its children with it and leaving the system in a half-baked state, e.g. a mid-air package transaction.

Catch the cancellation inside the run, forward SIGINT to the remote process, and wait for it to exit, draining the captured output, before propagating the cancellation.

#### lib.ec.ssh.AsyncSSH: Forward SIGINT to remote The first Ctrl-C cancels the running task while the SSH connection is still open, but `_run_ssh()` has no cleanup: the connection is abandoned and the remote process is never signalled. A long-running command such as zypper dup therefore keeps running after the client dies, taking its children with it and leaving the system in a half-baked state, e.g. a mid-air package transaction. Catch the cancellation inside the run, forward `SIGINT` to the remote process, and wait for it to exit, draining the captured output, before propagating the cancellation.
lib.ec.ssh.AsyncSSH: Forward SIGINT to remote
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m15s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 6m1s
CI / Packaging test (pull_request) Successful in 0s
dd67dbf544
The first Ctrl-C cancels the running task while the SSH connection is still
open, but _run_ssh() has no cleanup: the connection is abandoned and the
remote process is never signalled. A long-running command such as zypper
dup therefore keeps running after the client dies, taking its children with
it and leaving the system in a half-baked state, e.g. a mid-air package
transaction.

Catch the cancellation inside the run, forward SIGINT to the remote
process, and wait for it to exit, draining the captured output, before
propagating the cancellation.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.2
Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-11-20 22:27:58 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!182
No description provided.