ClusterUpdateSettingsAction will hang if no changes were made
Closes #3560
This commit is contained in:
parent
fc3133d087
commit
109e2944f2
|
@ -159,6 +159,7 @@ public class TransportClusterUpdateSettingsAction extends TransportMasterNodeOpe
|
|||
public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
|
||||
if (oldState == newState) {
|
||||
// nothing changed...
|
||||
listener.onResponse(new ClusterUpdateSettingsResponse(transientUpdates.build(), persistentUpdates.build()));
|
||||
return;
|
||||
}
|
||||
// now, reroute
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.elasticsearch.common.settings.ImmutableSettings;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.node.Node;
|
||||
import org.elasticsearch.node.NodeBuilder;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
@ -34,6 +35,24 @@ import static org.hamcrest.Matchers.nullValue;
|
|||
|
||||
public class ClusterSettingsTests {
|
||||
|
||||
@Test
|
||||
public void clusterNonExistingSettingsUpdate() {
|
||||
Node node1 = NodeBuilder.nodeBuilder().node();
|
||||
node1.start();
|
||||
Client client = node1.client();
|
||||
|
||||
String key1 = "no_idea_what_you_are_talking_about";
|
||||
int value1 = 10;
|
||||
|
||||
ClusterUpdateSettingsResponse response = client.admin().cluster()
|
||||
.prepareUpdateSettings()
|
||||
.setTransientSettings(ImmutableSettings.builder().put(key1, value1).build())
|
||||
.get();
|
||||
|
||||
assertThat(response.getTransientSettings().getAsMap().entrySet(), Matchers.emptyIterable());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clusterSettingsUpdateResponse() {
|
||||
Node node1 = NodeBuilder.nodeBuilder().node();
|
||||
|
|
Loading…
Reference in New Issue