Skip to content

Commit

Permalink
Disable HTTP/2 for internal communication
Browse files Browse the repository at this point in the history
There were reports of cluster instability after the HTTP/2 was enabled
for internal communication. This requires more investigation and testing.
  • Loading branch information
wendigo committed Nov 28, 2024
1 parent dc64f02 commit 59ac727
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class TaskManagerConfig
private Duration clientTimeout = new Duration(2, TimeUnit.MINUTES);
private Duration infoMaxAge = new Duration(15, TimeUnit.MINUTES);

private Duration statusRefreshMaxWait = new Duration(3, TimeUnit.SECONDS);
private Duration statusRefreshMaxWait = new Duration(1, TimeUnit.SECONDS);
private Duration infoUpdateInterval = new Duration(3, TimeUnit.SECONDS);
private Duration taskTerminationTimeout = new Duration(1, TimeUnit.MINUTES);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class InternalCommunicationConfig
{
private String sharedSecret;
private boolean http2Enabled = true;
private boolean http2Enabled;
private boolean httpsRequired;
private String keyStorePath;
private String keyStorePassword;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,21 @@ protected void setup(Binder binder)

// exchange client
binder.bind(DirectExchangeClientSupplier.class).to(DirectExchangeClientFactory.class).in(Scopes.SINGLETON);

InternalCommunicationConfig internalCommunicationConfig = buildConfigObject(InternalCommunicationConfig.class);

install(internalHttpClientModule("exchange", ForExchange.class)
.withConfigDefaults(config -> {
config.setIdleTimeout(new Duration(30, SECONDS));
config.setRequestTimeout(new Duration(10, SECONDS));
config.setMaxConnectionsPerServer(64);
config.setMaxContentLength(DataSize.of(32, MEGABYTE));
config.setMaxRequestsQueuedPerDestination(65536);
if (internalCommunicationConfig.isHttp2Enabled()) {
config.setMaxConnectionsPerServer(64);
}
else {
config.setMaxConnectionsPerServer(250);
}
}).build());

configBinder(binder).bindConfig(DirectExchangeClientConfig.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void testDefaults()
.setThreadPerDriverSchedulerEnabled(true)
.setInitialSplitsPerNode(Runtime.getRuntime().availableProcessors() * 2)
.setSplitConcurrencyAdjustmentInterval(new Duration(100, TimeUnit.MILLISECONDS))
.setStatusRefreshMaxWait(new Duration(3, TimeUnit.SECONDS))
.setStatusRefreshMaxWait(new Duration(1, TimeUnit.SECONDS))
.setInfoUpdateInterval(new Duration(3, TimeUnit.SECONDS))
.setTaskTerminationTimeout(new Duration(1, TimeUnit.MINUTES))
.setPerOperatorCpuTimerEnabled(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void testDefaults()
{
assertRecordedDefaults(recordDefaults(InternalCommunicationConfig.class)
.setSharedSecret(null)
.setHttp2Enabled(true)
.setHttp2Enabled(false)
.setHttpsRequired(false)
.setKeyStorePath(null)
.setKeyStorePassword(null)
Expand All @@ -50,7 +50,7 @@ public void testExplicitPropertyMappings()

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

InternalCommunicationConfig expected = new InternalCommunicationConfig()
.setSharedSecret("secret")
.setHttp2Enabled(false)
.setHttp2Enabled(true)
.setHttpsRequired(true)
.setKeyStorePath(keystoreFile.toString())
.setKeyStorePassword("key-key")
Expand Down

0 comments on commit 59ac727

Please sign in to comment.