ssh ControlPersist from Node: two traps (pipes never close, socket path too long)
Sharing one ssh connection per host from a Node server (child_process) to cut ~1 s per fresh ssh: (1) Don't let a command's own ssh become the ControlPersist master (ControlMaster=auto). The forked background master inherits that ssh's stdout/stderr, so execFile/spawn never sees the pipes close and the call hangs until its timeout. Instead start the master separately: spawn('ssh', ['-o','ControlMaster=yes','-o','ControlPath=SOCK','-o','ControlPersist=60','-N','-f', ...hostArgs], {stdio:'ignore'}), wait for its exit (-f backgrounds after auth) and for the socket file, then run every command with -o ControlMaster=no -o ControlPath=SOCK (which falls back to a direct connection if the socket is missing). (2) Unix socket paths are limited to ~104 bytes on macOS; os.tmpdir() (/var/folders/...) plus %C (40 hex) overflows and ssh silently creates no socket. Use a short 0700 dir like mkdtemp('/tmp/vv-ssh-') and a short hashed name. Also add proc.stdin.on('error') on long-lived ssh children, or an EPIPE after the remote dies crashes the whole server.