Skip to content
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
10 changes: 8 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
<dep.commons.compress.version>1.27.1</dep.commons.compress.version>
<dep.protobuf-java.version>4.30.2</dep.protobuf-java.version>
<dep.jetty.version>12.0.29</dep.jetty.version>
<dep.netty.version>4.1.130.Final</dep.netty.version>
<dep.reactor-netty.version>1.2.8</dep.reactor-netty.version>
<dep.netty.version>4.2.10.Final</dep.netty.version>
<dep.reactor-netty.version>1.3.3</dep.reactor-netty.version>
<dep.snakeyaml.version>2.5</dep.snakeyaml.version>
<dep.gson.version>2.12.1</dep.gson.version>
<dep.commons.lang3.version>3.18.0</dep.commons.lang3.version>
Expand Down Expand Up @@ -1649,6 +1649,12 @@
<version>${dep.reactor-netty.version}</version>
</dependency>

<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>3.8.3</version>
</dependency>

<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions presto-function-namespace-managers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@
<artifactId>drift-transport-netty</artifactId>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</dependency>

<!-- for testing -->
<dependency>
<groupId>com.facebook.presto</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.facebook.presto.spi.function.FunctionNamespaceManagerFactory;
import com.facebook.presto.spi.function.SqlFunctionHandle;
import com.google.inject.Injector;
import io.netty.buffer.PooledByteBufAllocator;

import java.util.Map;

Expand Down Expand Up @@ -51,7 +52,7 @@ public FunctionNamespaceManager<?> create(String catalogName, Map<String, String
{
try {
Bootstrap app = new Bootstrap(
new DriftNettyClientModule(),
new DriftNettyClientModule(PooledByteBufAllocator.DEFAULT),
new MySqlFunctionNamespaceManagerModule(catalogName),
new MySqlConnectionModule(),
new SimpleAddressSqlFunctionExecutorsModule());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Injector;
import io.netty.buffer.PooledByteBufAllocator;
import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.Jdbi;
import org.testng.annotations.AfterClass;
Expand Down Expand Up @@ -99,7 +100,7 @@ public void setup()
Bootstrap app = new Bootstrap(
new MySqlFunctionNamespaceManagerModule(TEST_CATALOG),
new SimpleAddressSqlFunctionExecutorsModule(),
new DriftNettyClientModule(),
new DriftNettyClientModule(PooledByteBufAllocator.DEFAULT),
new MySqlConnectionModule());

try {
Expand Down
5 changes: 5 additions & 0 deletions presto-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@
<artifactSet>
<excludes>
<exclude>com.facebook.presto:presto-ui</exclude>
<!-- Netty is not used by the JDBC driver (it uses OkHttp).
Exclude to avoid: (1) duplicate native .so conflict with
hadoop-apache shaded jar, (2) Java 11+ bytecode from Netty 4.2
multi-release classes violating Java 8 bytecode enforcement -->
<exclude>io.netty:*</exclude>
</excludes>
</artifactSet>
<createSourcesJar>true</createSourcesJar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public SafeEventLoopGroup(int nThreads, ThreadFactory threadFactory, long slowMe

@Override
protected EventLoop newChild(Executor executor, Object... args)
throws Exception
{
return new SafeEventLoop(this, executor);
}
Expand All @@ -71,7 +72,7 @@ protected void run()
Runnable task = takeTask();
if (task != null) {
try {
runTask(task);
task.run();
}
catch (Throwable t) {
log.error(t, "Error executing task on event loop");
Expand Down
1 change: 0 additions & 1 deletion presto-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>3.8.0-M2</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ public void run()
verifyJvmRequirements();
verifySystemTimeIsReasonable();

// Netty 4.2 enables SSL endpoint verification by default. The Drift Netty transport
// does not pass hostnames to the SSL engine, causing SSLHandshakeException. Disable
// the default endpoint verification until Drift is updated to support it.
if (System.getProperty("io.netty.handler.ssl.defaultEndpointVerificationAlgorithm") == null) {
System.setProperty("io.netty.handler.ssl.defaultEndpointVerificationAlgorithm", "NONE");
}

Logger log = Logger.get(PrestoServer.class);

ImmutableList.Builder<Module> modules = ImmutableList.builder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
import com.google.inject.TypeLiteral;
import com.google.inject.multibindings.MapBinder;
import io.airlift.slice.Slice;
import io.netty.buffer.PooledByteBufAllocator;
import jakarta.annotation.PreDestroy;
import jakarta.inject.Singleton;
import jakarta.servlet.Filter;
Expand Down Expand Up @@ -628,7 +629,7 @@ public ListeningExecutorService createResourceManagerExecutor(ResourceManagerCon
config.setMaxContentLength(new DataSize(32, MEGABYTE));
});

binder.install(new DriftNettyClientModule());
binder.install(new DriftNettyClientModule(PooledByteBufAllocator.DEFAULT));
driftClientBinder(binder).bindDriftClient(ThriftTaskClient.class, ForExchange.class)
.withAddressSelector(((addressSelectorBinder, annotation, prefix) ->
addressSelectorBinder.bind(AddressSelector.class).annotatedWith(annotation).to(FixedAddressSelector.class)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import com.facebook.presto.sql.planner.PlanFragment;
import com.google.common.collect.Multimap;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import io.netty.channel.EventLoop;
import io.netty.util.concurrent.AbstractEventExecutorGroup;
import jakarta.annotation.PreDestroy;
import jakarta.inject.Inject;
Expand Down Expand Up @@ -205,14 +204,7 @@ else if (binaryTransportEnabled) {
this.taskUpdateSizeTrackingEnabled = taskConfig.isTaskUpdateSizeTrackingEnabled();

this.eventLoopGroup = Optional.of(new SafeEventLoopGroup(config.getRemoteTaskMaxCallbackThreads(),
new ThreadFactoryBuilder().setNameFormat("task-event-loop-%s").setDaemon(true).build(), taskConfig.getSlowMethodThresholdOnEventLoop())
{
@Override
protected EventLoop newChild(Executor executor, Object... args)
{
return new SafeEventLoop(this, executor);
}
});
new ThreadFactoryBuilder().setNameFormat("task-event-loop-%s").setDaemon(true).build(), taskConfig.getSlowMethodThresholdOnEventLoop()));
}

@Managed
Expand Down
5 changes: 5 additions & 0 deletions presto-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@
<artifactId>drift-transport-netty</artifactId>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</dependency>

<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.facebook.presto.spi.function.FunctionNamespaceManagerFactory;
import com.facebook.presto.spi.function.SqlFunctionHandle;
import com.google.inject.Injector;
import io.netty.buffer.PooledByteBufAllocator;

import java.util.Map;

Expand Down Expand Up @@ -53,7 +54,7 @@ public FunctionNamespaceManager<?> create(String catalogName, Map<String, String
{
try {
Bootstrap app = new Bootstrap(
new DriftNettyClientModule(),
new DriftNettyClientModule(PooledByteBufAllocator.DEFAULT),
new MySqlFunctionNamespaceManagerModule(catalogName),
new H2ConnectionModule(),
new SimpleAddressSqlFunctionExecutorsModule());
Expand Down
5 changes: 5 additions & 0 deletions presto-thrift-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<artifactId>drift-transport-netty</artifactId>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.facebook.presto.spi.relation.RowExpressionService;
import com.google.inject.Injector;
import com.google.inject.Module;
import io.netty.buffer.PooledByteBufAllocator;
import org.weakref.jmx.guice.MBeanModule;

import javax.management.MBeanServer;
Expand Down Expand Up @@ -65,7 +66,7 @@ public Connector create(String catalogName, Map<String, String> config, Connecto
try {
Bootstrap app = new Bootstrap(
new MBeanModule(),
new DriftNettyClientModule(),
new DriftNettyClientModule(PooledByteBufAllocator.DEFAULT),
binder -> {
binder.bind(MBeanServer.class).toInstance(new RebindSafeMBeanServer(getPlatformMBeanServer()));
binder.bind(TypeManager.class).toInstance(context.getTypeManager());
Expand Down
Loading