Description
If a client that is SSH RemoteForward
ing from their workspace is abruptly disconnected, the SSH server isn't immediately notified because the TCP sessions can be held open for a long time (currently 72h), and we currently block other SSH connections from RemoteForward
the same target Unix socket path (and TCP port).
This can put the workspace in a state where RemoteForward no longer works unless they restart the workspace or the old TCP session times out.
Since Coder workspaces (unlike a general SSH server) are meant for a single user, we could fix this problem by allowing new connections to override previous RemoteForward
requests. The target would begin forwarding to a new connection that requests it and cease forwarding to the old connection.
We have a customer trying to configure remote forwarding to happen by default, and blocking remote forwarding based on a failed, old connection is making this unusable.