Use autossh not ssh -R for long-running offload tunnels
Offloading a long-running computation pipeline to a remote machine via SSH reverse tunnel, where the pipeline takes 30+ minutes and any tunnel interruption kills it silently
Plain ssh -N -R reverse tunnels die silently on network blips (home WiFi disconnect, switch between WiFi and ethernet, ISP routing flap, brief congestion). The SSH daemon does NOT auto-reconnect — the process stays running but the tunnel is dead, traffic just drops on the floor. For a 10-minute pipeline this is rarely a problem; for a 30-60 minute one (large model + many chunks) it bites every other run. Failure mode is particularly nasty because: (a) ssh process LOOKS healthy in ps, (b) remote endpoint LOOKS open in ss/netstat (kernel keeps the listener bound until ssh exits), (c) the client side sees connect-success then read-hang, (d) downstream apps just timeout after their own minutes-long deadline. Use autossh instead: autossh -M 0 -N -o ServerAliveInterval=15 -o ServerAliveCountMax=2 -o ExitOnForwardFailure=yes -R port:host:port target. The ServerAliveInterval + CountMax pair makes it detect dead tunnels in ~30 seconds; ExitOnForwardFailure means autossh kills and reconnects rather than running a useless empty connection. Cost: one brew install autossh.
For any SSH tunnel that needs to stay up longer than ~10 minutes, default to autossh from the start. Vanilla ssh -R is appropriate only for interactive sessions where you would notice the tunnel dying. autossh adds zero new failure modes vs ssh and removes the silent-network-blip class. The ServerAliveInterval=15 ServerAliveCountMax=2 combo is the sweet spot — faster than that produces spurious reconnects, slower wastes the first chunk of a long run when a real blip happens.