Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable HTTP/2 for internal communication #24299

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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