lordmauve / chopsticks

Chopsticks is an orchestration library: it lets you execute Python code on remote hosts over SSH.
https://chopsticks.readthedocs.io/
Apache License 2.0
158 stars 16 forks source link

Tunnel doesn't detect connection lost #20

Open lordmauve opened 7 years ago

lordmauve commented 7 years ago

The SSHTunnel doesn't appear to detect connection interruption in some cases.

Steps to reproduce:

  1. Using a laptop, connect an SSHTunnel
  2. Put laptop into sleep mode
  3. Resume laptop
  4. Chopsticks operations on the tunnel now hang
lordmauve commented 7 years ago

The ssh subprocess is still running. Perhaps some options to ssh can help it detect connection loss.

lordmauve commented 7 years ago

We should pass -o BatchMode=yes to ssh - this is both appropriate and sets ServerAliveInterval to 300. (Lower might be more appropriate).