lib.ExecApp: Add class #76

Closed
Jan Lindemann wants to merge 17 commits from jan/feature/20260822-lib-execapp-add-class into master AGit
Showing only changes of commit d89afdc4a5 - Show all commits

lib.ec.ssh.Paramiko: Avoid recv deadlock

_run_ssh() waits for the remote process's exit status before reading
stdout and stderr. When a command produces more output than the
channel's flow-control window can hold, the server stops sending, the
remote process blocks on its write and never exits, and
recv_exit_status() blocks forever.

Drain stdout and stderr to EOF first - the channels close when the
process exits, so reading them also implies completion - and only
then query the exit status.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann 2026-08-16 07:02:54 +02:00
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -95,5 +95,7 @@ class Paramiko(Base):
if cmd_input is not None: if cmd_input is not None:
stdin.write(cmd_input) stdin.write(cmd_input)
stdin.channel.shutdown_write() stdin.channel.shutdown_write()
stdout_data = stdout.read()
stderr_data = stderr.read()
exit_status = stdout.channel.recv_exit_status() exit_status = stdout.channel.recv_exit_status()
return Result(stdout.read(), stderr.read(), exit_status, cmd = cmd) return Result(stdout_data, stderr_data, exit_status, cmd = cmd)