Skip to content

Commit 59ac727

Browse files
committed
Disable HTTP/2 for internal communication
There were reports of cluster instability after the HTTP/2 was enabled for internal communication. This requires more investigation and testing.
1 parent dc64f02 commit 59ac727

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

core/trino-main/src/main/java/io/trino/execution/TaskManagerConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public class TaskManagerConfig
7474
private Duration clientTimeout = new Duration(2, TimeUnit.MINUTES);
7575
private Duration infoMaxAge = new Duration(15, TimeUnit.MINUTES);
7676

77-
private Duration statusRefreshMaxWait = new Duration(3, TimeUnit.SECONDS);
77+
private Duration statusRefreshMaxWait = new Duration(1, TimeUnit.SECONDS);
7878
private Duration infoUpdateInterval = new Duration(3, TimeUnit.SECONDS);
7979
private Duration taskTerminationTimeout = new Duration(1, TimeUnit.MINUTES);
8080

core/trino-main/src/main/java/io/trino/server/InternalCommunicationConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
public class InternalCommunicationConfig
3232
{
3333
private String sharedSecret;
34-
private boolean http2Enabled = true;
34+
private boolean http2Enabled;
3535
private boolean httpsRequired;
3636
private String keyStorePath;
3737
private String keyStorePassword;

core/trino-main/src/main/java/io/trino/server/ServerMainModule.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,21 @@ protected void setup(Binder binder)
350350

351351
// exchange client
352352
binder.bind(DirectExchangeClientSupplier.class).to(DirectExchangeClientFactory.class).in(Scopes.SINGLETON);
353+
354+
InternalCommunicationConfig internalCommunicationConfig = buildConfigObject(InternalCommunicationConfig.class);
355+
353356
install(internalHttpClientModule("exchange", ForExchange.class)
354357
.withConfigDefaults(config -> {
355358
config.setIdleTimeout(new Duration(30, SECONDS));
356359
config.setRequestTimeout(new Duration(10, SECONDS));
357-
config.setMaxConnectionsPerServer(64);
358360
config.setMaxContentLength(DataSize.of(32, MEGABYTE));
359361
config.setMaxRequestsQueuedPerDestination(65536);
362+
if (internalCommunicationConfig.isHttp2Enabled()) {
363+
config.setMaxConnectionsPerServer(64);
364+
}
365+
else {
366+
config.setMaxConnectionsPerServer(250);
367+
}
360368
}).build());
361369

362370
configBinder(binder).bindConfig(DirectExchangeClientConfig.class);

core/trino-main/src/test/java/io/trino/execution/TestTaskManagerConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void testDefaults()
4242
.setThreadPerDriverSchedulerEnabled(true)
4343
.setInitialSplitsPerNode(Runtime.getRuntime().availableProcessors() * 2)
4444
.setSplitConcurrencyAdjustmentInterval(new Duration(100, TimeUnit.MILLISECONDS))
45-
.setStatusRefreshMaxWait(new Duration(3, TimeUnit.SECONDS))
45+
.setStatusRefreshMaxWait(new Duration(1, TimeUnit.SECONDS))
4646
.setInfoUpdateInterval(new Duration(3, TimeUnit.SECONDS))
4747
.setTaskTerminationTimeout(new Duration(1, TimeUnit.MINUTES))
4848
.setPerOperatorCpuTimerEnabled(true)

core/trino-main/src/test/java/io/trino/server/TestInternalCommunicationConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void testDefaults()
3232
{
3333
assertRecordedDefaults(recordDefaults(InternalCommunicationConfig.class)
3434
.setSharedSecret(null)
35-
.setHttp2Enabled(true)
35+
.setHttp2Enabled(false)
3636
.setHttpsRequired(false)
3737
.setKeyStorePath(null)
3838
.setKeyStorePassword(null)
@@ -50,7 +50,7 @@ public void testExplicitPropertyMappings()
5050

5151
Map<String, String> properties = ImmutableMap.<String, String>builder()
5252
.put("internal-communication.shared-secret", "secret")
53-
.put("internal-communication.http2.enabled", "false")
53+
.put("internal-communication.http2.enabled", "true")
5454
.put("internal-communication.https.required", "true")
5555
.put("internal-communication.https.keystore.path", keystoreFile.toString())
5656
.put("internal-communication.https.keystore.key", "key-key")
@@ -61,7 +61,7 @@ public void testExplicitPropertyMappings()
6161

6262
InternalCommunicationConfig expected = new InternalCommunicationConfig()
6363
.setSharedSecret("secret")
64-
.setHttp2Enabled(false)
64+
.setHttp2Enabled(true)
6565
.setHttpsRequired(true)
6666
.setKeyStorePath(keystoreFile.toString())
6767
.setKeyStorePassword("key-key")

0 commit comments

Comments
 (0)