add a note about node connection failure and fallback

This commit is contained in:
Mahmood Ali
2021-05-25 14:24:24 -04:00
parent a15a61759e
commit b294f6353a
2 changed files with 12 additions and 2 deletions

View File

@@ -62,7 +62,12 @@ func (s *execSession) run(ctx context.Context) (exitCode int, err error) {
}
func (s *execSession) startConnection() (*websocket.Conn, error) {
nodeClient, _ := s.client.GetNodeClientWithTimeout(s.alloc.NodeID, ClientConnTimeout, s.q)
// First, attempt to connect to the node directly, but may fail due to network isolation
// and network errors. Fallback to using server-side forwarding instead.
nodeClient, err := s.client.GetNodeClientWithTimeout(s.alloc.NodeID, ClientConnTimeout, s.q)
if err == NodeDownErr {
return nil, NodeDownErr
}
q := s.q
if q == nil {