Skip to content

Commit 1d07a26

Browse files
only retry remote node closed
1 parent d3b05a1 commit 1d07a26

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/main/java/org/elasticsearch/action/support/master/TransportMasterNodeAction.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.elasticsearch.tasks.Task;
4747
import org.elasticsearch.threadpool.ThreadPool;
4848
import org.elasticsearch.transport.ConnectTransportException;
49+
import org.elasticsearch.transport.RemoteTransportException;
4950
import org.elasticsearch.transport.TransportException;
5051
import org.elasticsearch.transport.TransportService;
5152

@@ -178,7 +179,8 @@ protected void doStart(ClusterState clusterState) {
178179
@Override
179180
public void handleException(final TransportException exp) {
180181
Throwable cause = exp.unwrapCause();
181-
if (cause instanceof ConnectTransportException || cause instanceof NodeClosedException) {
182+
if (cause instanceof ConnectTransportException ||
183+
(exp instanceof RemoteTransportException && cause instanceof NodeClosedException)) {
182184
// we want to retry here a bit to see if a new master is elected
183185
logger.debug("connection exception while trying to forward request with action name [{}] to " +
184186
"master node [{}], scheduling a retry. Error: [{}]",

0 commit comments

Comments
 (0)