@@ -490,6 +490,8 @@ private void collectRemoteNodes(Iterator<Supplier<DiscoveryNode>> seedNodes,
490490 if (seedNodes .hasNext ()) {
491491 cancellableThreads .executeIO (() -> {
492492 final DiscoveryNode seedNode = maybeAddProxyAddress (proxyAddress , seedNodes .next ().get ());
493+ logger .debug ("[{}] opening connection to seed node: [{}] proxy address: [{}]" , clusterAlias , seedNode ,
494+ proxyAddress );
493495 final TransportService .HandshakeResponse handshakeResponse ;
494496 Transport .Connection connection = manager .openConnection (seedNode ,
495497 ConnectionProfile .buildSingleChannelProfile (TransportRequestOptions .Type .REG , null , null ));
@@ -523,7 +525,7 @@ private void collectRemoteNodes(Iterator<Supplier<DiscoveryNode>> seedNodes,
523525 ThreadContext threadContext = threadPool .getThreadContext ();
524526 TransportService .ContextRestoreResponseHandler <ClusterStateResponse > responseHandler = new TransportService
525527 .ContextRestoreResponseHandler <>(threadContext .newRestorableContext (false ),
526- new SniffClusterStateResponseHandler (transportService , connection , listener , seedNodes ,
528+ new SniffClusterStateResponseHandler (connection , listener , seedNodes ,
527529 cancellableThreads ));
528530 try (ThreadContext .StoredContext ignore = threadContext .stashContext ()) {
529531 // we stash any context here since this is an internal execution and should not leak any
@@ -543,13 +545,16 @@ private void collectRemoteNodes(Iterator<Supplier<DiscoveryNode>> seedNodes,
543545 listener .onFailure (new IllegalStateException ("no seed node left" ));
544546 }
545547 } catch (CancellableThreads .ExecutionCancelledException ex ) {
548+ logger .warn (() -> new ParameterizedMessage ("fetching nodes from external cluster [{}] failed" , clusterAlias ), ex );
546549 listener .onFailure (ex ); // we got canceled - fail the listener and step out
547550 } catch (ConnectTransportException | IOException | IllegalStateException ex ) {
548551 // ISE if we fail the handshake with an version incompatible node
549552 if (seedNodes .hasNext ()) {
550- logger .debug (() -> new ParameterizedMessage ("fetching nodes from external cluster {} failed" , clusterAlias ), ex );
553+ logger .debug (() -> new ParameterizedMessage ("fetching nodes from external cluster [{}] failed moving to next node" ,
554+ clusterAlias ), ex );
551555 collectRemoteNodes (seedNodes , transportService , manager , listener );
552556 } else {
557+ logger .warn (() -> new ParameterizedMessage ("fetching nodes from external cluster [{}] failed" , clusterAlias ), ex );
553558 listener .onFailure (ex );
554559 }
555560 }
@@ -581,8 +586,8 @@ private class SniffClusterStateResponseHandler implements TransportResponseHandl
581586 private final Iterator <Supplier <DiscoveryNode >> seedNodes ;
582587 private final CancellableThreads cancellableThreads ;
583588
584- SniffClusterStateResponseHandler (TransportService transportService , Transport .Connection connection ,
585- ActionListener < Void > listener , Iterator <Supplier <DiscoveryNode >> seedNodes ,
589+ SniffClusterStateResponseHandler (Transport .Connection connection , ActionListener < Void > listener ,
590+ Iterator <Supplier <DiscoveryNode >> seedNodes ,
586591 CancellableThreads cancellableThreads ) {
587592 this .connection = connection ;
588593 this .listener = listener ;
0 commit comments