Skip to content

Commit 621a26b

Browse files
authored
Deprecate http.pipelining setting (#30786)
This is related to #29500. In 7.0 this setting will be removed. This PR marks the setting in 6.x as deprecated.
1 parent 42d0af1 commit 621a26b

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerPipeliningTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@
3232
import io.netty.handler.codec.http.HttpHeaderNames;
3333
import io.netty.handler.codec.http.HttpResponseStatus;
3434
import io.netty.handler.codec.http.HttpVersion;
35+
import org.elasticsearch.common.network.NetworkModule;
3536
import org.elasticsearch.common.network.NetworkService;
37+
import org.elasticsearch.common.settings.Setting;
3638
import org.elasticsearch.common.settings.Settings;
3739
import org.elasticsearch.common.transport.TransportAddress;
3840
import org.elasticsearch.common.util.MockBigArrays;
3941
import org.elasticsearch.common.util.MockPageCacheRecycler;
4042
import org.elasticsearch.common.util.concurrent.ThreadContext;
4143
import org.elasticsearch.http.HttpServerTransport;
44+
import org.elasticsearch.http.HttpTransportSettings;
4245
import org.elasticsearch.http.NullDispatcher;
4346
import org.elasticsearch.http.netty4.pipelining.HttpPipelinedRequest;
4447
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
@@ -110,6 +113,8 @@ public void testThatHttpPipeliningWorksWhenEnabled() throws Exception {
110113
assertThat(responseBodies, contains(requests.toArray()));
111114
}
112115
}
116+
117+
assertSettingDeprecationsAndWarnings(new Setting<?>[] {HttpTransportSettings.SETTING_PIPELINING});
113118
}
114119

115120
public void testThatHttpPipeliningCanBeDisabled() throws Exception {
@@ -152,6 +157,8 @@ public void testThatHttpPipeliningCanBeDisabled() throws Exception {
152157
assertThat(slowIds, equalTo(ids));
153158
}
154159
}
160+
161+
assertSettingDeprecationsAndWarnings(new Setting<?>[] {HttpTransportSettings.SETTING_PIPELINING});
155162
}
156163

157164
class CustomNettyHttpServerTransport extends Netty4HttpServerTransport {

server/src/main/java/org/elasticsearch/http/HttpTransportSettings.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ public final class HttpTransportSettings {
4949
new Setting<>("http.cors.allow-headers", "X-Requested-With,Content-Type,Content-Length", (value) -> value, Property.NodeScope);
5050
public static final Setting<Boolean> SETTING_CORS_ALLOW_CREDENTIALS =
5151
Setting.boolSetting("http.cors.allow-credentials", false, Property.NodeScope);
52+
// In 7.0 pipelining support will always be enabled and this setting will be removed.
5253
public static final Setting<Boolean> SETTING_PIPELINING =
53-
Setting.boolSetting("http.pipelining", true, Property.NodeScope);
54+
Setting.boolSetting("http.pipelining", true, Property.NodeScope, Property.Deprecated);
5455
public static final Setting<Integer> SETTING_PIPELINING_MAX_EVENTS =
5556
Setting.intSetting("http.pipelining.max_events", 10000, Property.NodeScope);
5657
public static final Setting<Boolean> SETTING_HTTP_COMPRESSION =

test/framework/src/test/java/org/elasticsearch/node/MockNodeTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.elasticsearch.common.util.BigArrays;
2626
import org.elasticsearch.common.util.MockBigArrays;
2727
import org.elasticsearch.env.Environment;
28+
import org.elasticsearch.http.HttpTransportSettings;
2829
import org.elasticsearch.plugins.Plugin;
2930
import org.elasticsearch.search.MockSearchService;
3031
import org.elasticsearch.search.SearchService;
@@ -69,6 +70,6 @@ public void testComponentsMockedByMarkerPlugins() throws IOException {
6970
assertSame(searchService.getClass(), SearchService.class);
7071
}
7172
}
72-
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
73+
assertSettingDeprecationsAndWarnings(new Setting<?>[] {NetworkModule.HTTP_ENABLED});
7374
}
7475
}

test/framework/src/test/java/org/elasticsearch/test/test/InternalTestClusterTests.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.elasticsearch.discovery.DiscoverySettings;
3232
import org.elasticsearch.discovery.zen.ZenDiscovery;
3333
import org.elasticsearch.env.NodeEnvironment;
34+
import org.elasticsearch.http.HttpTransportSettings;
3435
import org.elasticsearch.plugins.Plugin;
3536
import org.elasticsearch.test.ESTestCase;
3637
import org.elasticsearch.test.InternalTestCluster;
@@ -72,6 +73,8 @@
7273
@LuceneTestCase.SuppressFileSystems("ExtrasFS") // doesn't work with potential multi data path from test cluster yet
7374
public class InternalTestClusterTests extends ESTestCase {
7475

76+
private static final Setting<?>[] DEPRECATED_SETTINGS = {NetworkModule.HTTP_ENABLED, HttpTransportSettings.SETTING_PIPELINING};
77+
7578
public void testInitializiationIsConsistent() {
7679
long clusterSeed = randomLong();
7780
boolean masterNodes = randomBoolean();
@@ -233,7 +236,7 @@ public Settings transportClientSettings() {
233236
assertArrayEquals(cluster0.getNodeNames(), cluster1.getNodeNames());
234237
if (cluster0.getNodeNames().length > 0) {
235238
shouldAssertSettingsDeprecationsAndWarnings = true;
236-
assertSettingDeprecationsAndWarnings(new Setting<?>[]{NetworkModule.HTTP_ENABLED});
239+
assertSettingDeprecationsAndWarnings(DEPRECATED_SETTINGS);
237240
}
238241
Iterator<Client> iterator1 = cluster1.getClients().iterator();
239242
for (Client client : cluster0.getClients()) {
@@ -248,7 +251,7 @@ public Settings transportClientSettings() {
248251
} finally {
249252
IOUtils.close(cluster0, cluster1);
250253
if (shouldAssertSettingsDeprecationsAndWarnings) {
251-
assertSettingDeprecationsAndWarnings(new Setting<?>[]{NetworkModule.HTTP_ENABLED});
254+
assertSettingDeprecationsAndWarnings(new Setting<?>[] {NetworkModule.HTTP_ENABLED});
252255
}
253256
}
254257
}
@@ -355,7 +358,7 @@ public Settings transportClientSettings() {
355358
} finally {
356359
cluster.close();
357360
}
358-
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
361+
assertSettingDeprecationsAndWarnings(DEPRECATED_SETTINGS);
359362
}
360363

361364
private Path[] getNodePaths(InternalTestCluster cluster, String name) {
@@ -456,7 +459,7 @@ public Settings transportClientSettings() {
456459
} finally {
457460
cluster.close();
458461
}
459-
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
462+
assertSettingDeprecationsAndWarnings(DEPRECATED_SETTINGS);
460463
}
461464

462465
public void testTwoNodeCluster() throws Exception {
@@ -518,7 +521,7 @@ public Settings onNodeStopped(String nodeName) throws Exception {
518521
} finally {
519522
cluster.close();
520523
}
521-
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NetworkModule.HTTP_ENABLED });
524+
assertSettingDeprecationsAndWarnings(DEPRECATED_SETTINGS);
522525
}
523526

524527
/**

0 commit comments

Comments
 (0)