Skip to content
Closed
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 @@ -357,11 +357,17 @@ List<OutputStatsEstimatorFactory> getCompositeOutputDataSizeEstimatorDelegateFac
binder.bind(RemoteTaskStats.class).in(Scopes.SINGLETON);
newExporter(binder).export(RemoteTaskStats.class).withGeneratedName();

InternalCommunicationConfig internalCommunicationConfig = buildConfigObject(InternalCommunicationConfig.class);
install(internalHttpClientModule("scheduler", ForScheduler.class)
.withConfigDefaults(config -> {
config.setIdleTimeout(new Duration(60, SECONDS));
config.setRequestTimeout(new Duration(20, SECONDS));
config.setMaxConnectionsPerServer(250);
if (internalCommunicationConfig.isHttp2Enabled()) {
config.setMaxConnectionsPerServer(64);
}
else {
Comment thread
wendigo marked this conversation as resolved.
config.setMaxConnectionsPerServer(250);
}
}).build());

binder.bind(ScheduledExecutorService.class).annotatedWith(ForScheduler.class)
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;
private boolean http2Enabled = true;
private boolean httpsRequired;
private String keyStorePath;
private String keyStorePassword;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ protected void setup(Binder binder)
public static void configureClient(HttpClientConfig httpConfig, InternalCommunicationConfig internalCommunicationConfig)
{
httpConfig.setHttp2Enabled(internalCommunicationConfig.isHttp2Enabled());
httpConfig.setUseVirtualThreads(true);

if (internalCommunicationConfig.isHttpsRequired() && internalCommunicationConfig.getKeyStorePath() == null && internalCommunicationConfig.getTrustStorePath() == null) {
configureClientForAutomaticHttps(httpConfig, internalCommunicationConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
import static com.google.inject.multibindings.OptionalBinder.newOptionalBinder;
import static io.airlift.concurrent.Threads.daemonThreadsNamed;
import static io.airlift.configuration.ConfigBinder.configBinder;
import static io.airlift.http.server.HttpServerBinder.httpServerBinder;
import static io.airlift.jaxrs.JaxrsBinder.jaxrsBinder;
import static io.airlift.json.JsonBinder.jsonBinder;
import static io.airlift.json.JsonCodecBinder.jsonCodecBinder;
Expand Down Expand Up @@ -198,6 +199,8 @@ protected void setup(Binder binder)
install(new WorkerModule());
}

httpServerBinder(binder).enableVirtualThreads();

binder.bind(StartupStatus.class).in(Scopes.SINGLETON);

configBinder(binder).bindConfigDefaults(HttpServerConfig.class, httpServerConfig -> {
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(false)
.setHttp2Enabled(true)
Comment thread
wendigo marked this conversation as resolved.
.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", "true")
.put("internal-communication.http2.enabled", "false")
.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(true)
.setHttp2Enabled(false)
.setHttpsRequired(true)
.setKeyStorePath(keystoreFile.toString())
.setKeyStorePassword("key-key")
Expand Down
Loading