diff --git a/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java b/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java index 794215410e9..bea067d9363 100644 --- a/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java +++ b/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java @@ -253,6 +253,7 @@ public class ZenDiscovery extends AbstractLifecycleComponent implemen @Override protected void doStop() throws ElasticsearchException { + joinThreadControl.stop(); pingService.stop(); masterFD.stop("zen disco stop"); nodesFD.stop(); @@ -282,7 +283,6 @@ public class ZenDiscovery extends AbstractLifecycleComponent implemen } } } - joinThreadControl.stop(); } @Override @@ -1354,16 +1354,7 @@ public class ZenDiscovery extends AbstractLifecycleComponent implemen running.set(false); Thread joinThread = currentJoinThread.getAndSet(null); if (joinThread != null) { - try { - joinThread.interrupt(); - } catch (Exception e) { - // ignore - } - try { - joinThread.join(10000); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } + joinThread.interrupt(); } } diff --git a/src/main/java/org/elasticsearch/discovery/zen/ping/unicast/UnicastZenPing.java b/src/main/java/org/elasticsearch/discovery/zen/ping/unicast/UnicastZenPing.java index b35621b78d2..b318a87f3fa 100644 --- a/src/main/java/org/elasticsearch/discovery/zen/ping/unicast/UnicastZenPing.java +++ b/src/main/java/org/elasticsearch/discovery/zen/ping/unicast/UnicastZenPing.java @@ -373,6 +373,9 @@ public class UnicastZenPing extends AbstractLifecycleComponent implemen } catch (ConnectTransportException e) { // can't connect to the node - this is a more common path! logger.trace("[{}] failed to connect to {}", e, sendPingsHandler.id(), finalNodeToSend); + } catch (RemoteTransportException e) { + // something went wrong on the other side + logger.debug("[{}] received a remote error as a response to ping {}", e, sendPingsHandler.id(), finalNodeToSend); } catch (Throwable e) { logger.warn("[{}] failed send ping to {}", e, sendPingsHandler.id(), finalNodeToSend); } finally {