diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-24 12:24:48 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-24 12:24:48 +0300 |
| commit | 145d870a1fa83b433b0ad02ae3818a338d579efc (patch) | |
| tree | ccb20402c4a692b88fab54df5c15f6457e1c53f3 /lib/hyperstack | |
| parent | c11db6e8f92fc818a87d18998bec6e478a33a824 (diff) | |
fix(watcher): remove Timeout.timeout to prevent orphaning SSH child processes
Replace Timeout.timeout(15) around Open3.capture3 with SSH-level
keepalive options (ServerAliveInterval=5, ServerAliveCountMax=3).
Ruby's Timeout raises in a background thread but leaves the ssh
process running; SSH's own timeouts self-terminate cleanly.
Diffstat (limited to 'lib/hyperstack')
| -rw-r--r-- | lib/hyperstack/watcher.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/hyperstack/watcher.rb b/lib/hyperstack/watcher.rb index 1c126c5..c3eee0c 100644 --- a/lib/hyperstack/watcher.rb +++ b/lib/hyperstack/watcher.rb @@ -4,7 +4,6 @@ require 'json' require 'net/http' require 'open3' require 'socket' -require 'timeout' module HyperstackVM class VllmWatcher @@ -145,7 +144,7 @@ module HyperstackVM BASH ssh = build_ssh_command(config, wg_host) - stdout, stderr, status = Timeout.timeout(15) { Open3.capture3(*ssh, stdin_data: script) } + stdout, stderr, status = Open3.capture3(*ssh, stdin_data: script) return [nil, nil, "exit #{status.exitstatus}: #{stderr.strip}"] unless status.success? gpu_section, rest = stdout.split("===COMFYUI===\n", 2) @@ -191,7 +190,7 @@ module HyperstackVM BASH ssh = build_ssh_command(config, wg_host) - stdout, stderr, status = Timeout.timeout(15) { Open3.capture3(*ssh, stdin_data: script) } + stdout, stderr, status = Open3.capture3(*ssh, stdin_data: script) return [nil, nil, nil, "exit #{status.exitstatus}: #{stderr.strip}"] unless status.success? gpu_section, rest = stdout.split("===VLLM===\n", 2) @@ -251,6 +250,8 @@ module HyperstackVM '-o', 'StrictHostKeyChecking=accept-new', '-o', "UserKnownHostsFile=#{config.ssh_known_hosts_path}", '-o', "ConnectTimeout=#{config.ssh_connect_timeout}", + '-o', 'ServerAliveInterval=5', + '-o', 'ServerAliveCountMax=3', '-p', config.ssh_port.to_s ] key = config.ssh_private_key_path |
