Skip to content

Commit e70a6fd

Browse files
committed
short keepalive timeouts for cloud install, so operation fails quickly when the user cancels
1 parent daecb8d commit e70a6fd

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/cloud/install/installer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ const STATUS_PREFIX = 'CLOUD_INSTALL_STATUS';
3030
const INITIAL_CONNECTION_INTERVAL_MS = 500;
3131
const MAX_CONNECTION_INTERVAL_MS = 10000;
3232

33+
// Timeouts for established SSH connections.
34+
// We define these chiefly so that the installer fails quickly
35+
// in case the server is destroyed during installation, e.g.
36+
// when the user cancels install.
37+
const KEEPALIVE_INTERVAL_MS = 1000;
38+
const KEEPALIVE_MAX_FAILURES = 5;
39+
3340
// Installs uProxy on a server, via SSH.
3441
// The process is as close as possible to a manual install
3542
// so that we have fewer paths to test.
@@ -49,6 +56,8 @@ class CloudInstaller {
4956
port: port,
5057
username: username,
5158
privateKey: key,
59+
keepaliveInterval: KEEPALIVE_INTERVAL_MS,
60+
keepaliveCountMax: KEEPALIVE_MAX_FAILURES,
5261
// Remaining fields only for type-correctness.
5362
tryKeyboard: false,
5463
debug: undefined

0 commit comments

Comments
 (0)