Our HPC cluster is set up so that as soon as the ssh connection to a login node exits, it tears down any processes associated with that session. This of course breaks the linux host adapter as the tmux session will get cleaned up before it has actually done anything.
There is potentially a workaround - using session muxing with a timeout. This actually does work for starting the session, since the ssh process on the cluster end doesn’t exit until the connection has been idle for whatever is set up for the ControlPersist timeout ssh option.
The issue is that, while the session is launched through the head node, the periodic checks that tmux is still running go directly to the backend node - and thus don’t go down the original mux connection, since the hostname is different. As a result, once the ControlPersist timeout is hit, the session exits.
Now I could set the ControlPersist timeout to something like 86400, but that can cause other issues if something goes wrong with the mux connection (which does happen sometimes) - the user ends up unable to make a new connection to the cluster until the mux gets cleaned up. Currently we have it set to 10 minutes, which I think is a reasonable balance.
The other workarounds I can think of would probably required code changes:
- rework the linux host adapter code to connect to the head node only to get the hostname of a working backend node, and then connect to the backend node directly to start the tmux process.
- rework the linux host adapter code to randomly pick a node from ssh_hosts if submit host isn’t set
Has anyone else solved this problem in a smarter way that I haven’t thought of yet?