From 7beac4ddbfabc2e2cecc06708dc48783aed4b2a1 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Thu, 3 Jul 2014 13:42:53 +0200 Subject: [PATCH] [Discovery] Fault detection should also check cause exceptions for disconnects The change introduced in #6686 checks for ConnectionTransportException during pinging. However, transport layer wraps it in SendRequestTransportException --- .../elasticsearch/discovery/zen/fd/MasterFaultDetection.java | 2 +- .../org/elasticsearch/discovery/zen/fd/NodesFaultDetection.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/elasticsearch/discovery/zen/fd/MasterFaultDetection.java b/src/main/java/org/elasticsearch/discovery/zen/fd/MasterFaultDetection.java index a438d3bc736..6b08297f84c 100644 --- a/src/main/java/org/elasticsearch/discovery/zen/fd/MasterFaultDetection.java +++ b/src/main/java/org/elasticsearch/discovery/zen/fd/MasterFaultDetection.java @@ -299,7 +299,7 @@ public class MasterFaultDetection extends AbstractComponent { synchronized (masterNodeMutex) { // check if the master node did not get switched on us... if (masterToPing.equals(MasterFaultDetection.this.masterNode())) { - if (exp instanceof ConnectTransportException) { + if (exp instanceof ConnectTransportException || exp.getCause() instanceof ConnectTransportException) { handleTransportDisconnect(masterToPing); return; } else if (exp.getCause() instanceof NoLongerMasterException) { diff --git a/src/main/java/org/elasticsearch/discovery/zen/fd/NodesFaultDetection.java b/src/main/java/org/elasticsearch/discovery/zen/fd/NodesFaultDetection.java index ed300343745..ee4fc71a04e 100644 --- a/src/main/java/org/elasticsearch/discovery/zen/fd/NodesFaultDetection.java +++ b/src/main/java/org/elasticsearch/discovery/zen/fd/NodesFaultDetection.java @@ -233,7 +233,7 @@ public class NodesFaultDetection extends AbstractComponent { if (!nodeFD.running) { return; } - if (exp instanceof ConnectTransportException) { + if (exp instanceof ConnectTransportException || exp.getCause() instanceof ConnectTransportException) { handleTransportDisconnect(node); return; }