Pārlūkot izejas kodu

Resolve/cluster should handle IllegalArgumentException 'Unable to open connection' as connected=false and not display error (#105512)

Fixed https://github.com/elastic/elasticsearch/issues/105489
Michael Peterson 1 gadu atpakaļ
vecāks
revīzija
949a294ec9

+ 0 - 1
server/src/internalClusterTest/java/org/elasticsearch/indices/cluster/ResolveClusterIT.java

@@ -522,7 +522,6 @@ public class ResolveClusterIT extends AbstractMultiClustersTestCase {
         }
     }
 
-    @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/105489")
     public void testClusterResolveDisconnectedAndErrorScenarios() throws Exception {
         Map<String, Object> testClusterInfo = setupThreeClusters(false);
         String localIndex = (String) testClusterInfo.get("local.index");

+ 3 - 0
server/src/main/java/org/elasticsearch/action/admin/indices/resolve/TransportResolveClusterAction.java

@@ -253,6 +253,9 @@ public class TransportResolveClusterAction extends HandledTransportAction<Resolv
         if (e instanceof ConnectTransportException || e instanceof NoSuchRemoteClusterException) {
             return true;
         }
+        if (e instanceof IllegalStateException && e.getMessage().contains("Unable to open any connections")) {
+            return true;
+        }
         Throwable ill = ExceptionsHelper.unwrap(e, IllegalArgumentException.class);
         if (ill != null && ill.getMessage().contains("unknown host")) {
             return true;