diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java b/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java index 768ae1f9563..8f445bda60a 100644 --- a/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java +++ b/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java @@ -70,6 +70,9 @@ public class ClusterHealthRequest extends MasterNodeOperationRequest { public ClusterHealthRequest timeout(TimeValue timeout) { this.timeout = timeout; + if (masterNodeTimeout == DEFAULT_MASTER_NODE_TIMEOUT) { + masterNodeTimeout = timeout; + } return this; } diff --git a/src/main/java/org/elasticsearch/action/support/master/MasterNodeOperationRequest.java b/src/main/java/org/elasticsearch/action/support/master/MasterNodeOperationRequest.java index 84509d264b7..9ac53394c55 100644 --- a/src/main/java/org/elasticsearch/action/support/master/MasterNodeOperationRequest.java +++ b/src/main/java/org/elasticsearch/action/support/master/MasterNodeOperationRequest.java @@ -33,7 +33,7 @@ public abstract class MasterNodeOperationRequest implements ActionRequest { public static TimeValue DEFAULT_MASTER_NODE_TIMEOUT = TimeValue.timeValueSeconds(30); - private TimeValue masterNodeTimeout = DEFAULT_MASTER_NODE_TIMEOUT; + protected TimeValue masterNodeTimeout = DEFAULT_MASTER_NODE_TIMEOUT; @Override public boolean listenerThreaded() {