lib.ec.ssh.AsyncSSH: Forward SIGINT to remote #182
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/fix/20261120-lib-ec-ssh-asyncssh-forward-sigint-to-remote"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
SIGINTto the remote process, and wait for it to exit, draining the captured output, before propagating the cancellation.