mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
add a note about node connection failure and fallback
This commit is contained in:
@@ -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 {
|
||||
|
||||
7
vendor/github.com/hashicorp/nomad/api/allocations_exec.go
generated
vendored
7
vendor/github.com/hashicorp/nomad/api/allocations_exec.go
generated
vendored
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user