This is an automated email from the ASF dual-hosted git repository.
xiangfu0 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 86091a1fe5f Use managed Netty for Pinot's gRPC transport (#20410)
86091a1fe5f is described below
commit 86091a1fe5f131c6780437973dd852327a93d980
Author: Xiang Fu <[email protected]>
AuthorDate: Thu Dec 3 16:30:50 2026 -0800
Use managed Netty for Pinot's gRPC transport (#20410)
* Use managed Netty for Pinot's gRPC transport
grpc-netty-shaded 1.86.0 embeds Netty 4.2.17.Final, so the Netty BOM
cannot apply the HTTP codec fixes for CVE-2026-93567, CVE-2026-93568,
and CVE-2026-93569 to that copy. Use grpc-netty 1.86.0 with the
existing managed Netty and preserve the native transport and TLS
providers.
Isolate the Spark connector's transport and its JNI libraries from
Spark's Netty. Keep GCS on its existing HTTP storage backend and omit
the SDK's unused gRPC transports. Preserve the legacy gRPC memory
metric names as aliases for the shared process-wide Netty counters.
To reproduce the packaging issue, build the distribution, GCS and
Kinesis shaded JARs on the parent commit and inspect their entries
for io/grpc/netty/shaded/io/netty/. Rebuilding with this change removes
that namespace from the runtime and plugins.
* Drain gRPC query responses after error metadata
Partial broker responses can carry query exceptions before schema and data
blocks. Consume the remaining blocking stream before returning the error
metadata so gRPC can release its receive buffers.
---
.github/workflows/pinot_unit_tests.yml | 2 -
.mvn/jvm.config | 1 -
LICENSE-binary | 2 +-
.../apache/pinot/broker/grpc/BrokerGrpcServer.java | 25 ++++-----
.../apache/pinot/client/grpc/GrpcConnection.java | 11 +++-
.../pinot/client/grpc/GrpcConnectionTest.java | 21 ++++++++
.../pinot/client/AbstractJdbcDriverAuthTest.java | 2 +-
pinot-common/pom.xml | 20 +++++++-
.../apache/pinot/common/metrics/BrokerGauge.java | 8 +--
.../apache/pinot/common/metrics/ServerGauge.java | 8 +--
.../common/utils/grpc/BaseGrpcQueryClient.java | 14 ++---
pinot-connectors/pinot-spark-3-connector/pom.xml | 10 +++-
pinot-connectors/pinot-spark-common/pom.xml | 2 +-
.../pinot/controller/BaseControllerStarter.java | 2 +-
.../pinot/core/instance/context/BrokerContext.java | 2 +-
.../core/instance/context/ControllerContext.java | 2 +-
.../pinot/core/instance/context/ServerContext.java | 2 +-
.../pinot/core/transport/NettyInspector.java | 14 ++---
.../apache/pinot/core/transport/NettyInstance.java | 60 ++--------------------
.../PooledByteBufAllocatorWithLimits.java | 6 +--
.../pinot/core/transport/grpc/GrpcQueryServer.java | 25 ++++-----
pinot-plugins/pinot-file-system/pinot-gcs/pom.xml | 35 +++++++++++++
.../apache/pinot/plugin/filesystem/GcsPinotFS.java | 2 +-
.../pinot/query/grpc/GrpcKeepAliveConfig.java | 2 +-
.../apache/pinot/query/mailbox/MailboxService.java | 6 +--
.../query/mailbox/channel/ChannelManager.java | 10 ++--
.../query/mailbox/channel/GrpcMailboxServer.java | 22 +++-----
.../query/service/dispatch/DispatchClient.java | 8 +--
.../query/service/dispatch/QueryDispatcher.java | 2 +-
.../timeseries/TimeSeriesDispatchClient.java | 6 +--
.../pinot/query/service/server/QueryServer.java | 4 +-
.../pinot/query/grpc/GrpcKeepAliveConfigTest.java | 2 +-
.../channel/MailboxChannelKeepAliveTest.java | 2 +-
.../query/service/dispatch/DispatchClientTest.java | 2 +-
pinot-server/pom.xml | 2 +-
.../src/main/resources/appAssemblerScriptTemplate | 1 -
pom.xml | 6 +--
37 files changed, 178 insertions(+), 173 deletions(-)
diff --git a/.github/workflows/pinot_unit_tests.yml
b/.github/workflows/pinot_unit_tests.yml
index 68191b99ca7..0b4cce9dd92 100644
--- a/.github/workflows/pinot_unit_tests.yml
+++ b/.github/workflows/pinot_unit_tests.yml
@@ -144,7 +144,6 @@ jobs:
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
-Dio.netty.tryReflectionSetAccessible=true
- -Dio.grpc.netty.shaded.io.netty.tryReflectionSetAccessible=true
timeout-minutes: 120
run: |
.github/workflows/scripts/pr-tests/.pinot_tests_build.sh
@@ -171,7 +170,6 @@ jobs:
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
-Dio.netty.tryReflectionSetAccessible=true
- -Dio.grpc.netty.shaded.io.netty.tryReflectionSetAccessible=true
timeout-minutes: 120
run: |
.github/workflows/scripts/pr-tests/.pinot_tests_unit.sh
diff --git a/.mvn/jvm.config b/.mvn/jvm.config
index 981650a9b82..a1fcdf57d9a 100644
--- a/.mvn/jvm.config
+++ b/.mvn/jvm.config
@@ -6,4 +6,3 @@
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
-Dio.netty.tryReflectionSetAccessible=true
--Dio.grpc.netty.shaded.io.netty.tryReflectionSetAccessible=true
diff --git a/LICENSE-binary b/LICENSE-binary
index 3433b595e7b..123f98f26fb 100644
--- a/LICENSE-binary
+++ b/LICENSE-binary
@@ -322,7 +322,7 @@ io.grpc:grpc-core:1.79.0
io.grpc:grpc-googleapis:1.79.0
io.grpc:grpc-grpclb:1.79.0
io.grpc:grpc-inprocess:1.79.0
-io.grpc:grpc-netty-shaded:1.79.0
+io.grpc:grpc-netty:1.86.0
io.grpc:grpc-opentelemetry:1.79.0
io.grpc:grpc-protobuf-lite:1.79.0
io.grpc:grpc-protobuf:1.79.0
diff --git
a/pinot-broker/src/main/java/org/apache/pinot/broker/grpc/BrokerGrpcServer.java
b/pinot-broker/src/main/java/org/apache/pinot/broker/grpc/BrokerGrpcServer.java
index da8e696c489..753393b5d11 100644
---
a/pinot-broker/src/main/java/org/apache/pinot/broker/grpc/BrokerGrpcServer.java
+++
b/pinot-broker/src/main/java/org/apache/pinot/broker/grpc/BrokerGrpcServer.java
@@ -26,17 +26,17 @@ import io.grpc.Grpc;
import io.grpc.Server;
import io.grpc.ServerTransportFilter;
import io.grpc.Status;
-import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts;
-import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder;
-import io.grpc.netty.shaded.io.netty.buffer.PooledByteBufAllocator;
-import io.grpc.netty.shaded.io.netty.buffer.PooledByteBufAllocatorMetric;
-import io.grpc.netty.shaded.io.netty.channel.ChannelOption;
-import io.grpc.netty.shaded.io.netty.handler.ssl.ClientAuth;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslProvider;
-import io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent;
+import io.grpc.netty.GrpcSslContexts;
+import io.grpc.netty.NettyServerBuilder;
import io.grpc.stub.StreamObserver;
+import io.netty.buffer.PooledByteBufAllocator;
+import io.netty.buffer.PooledByteBufAllocatorMetric;
+import io.netty.channel.ChannelOption;
+import io.netty.handler.ssl.ClientAuth;
+import io.netty.handler.ssl.SslContext;
+import io.netty.handler.ssl.SslContextBuilder;
+import io.netty.handler.ssl.SslProvider;
+import io.netty.util.internal.PlatformDependent;
import java.io.IOException;
import java.util.Map;
import java.util.stream.Collectors;
@@ -167,10 +167,7 @@ public class BrokerGrpcServer extends
PinotQueryBrokerGrpc.PinotQueryBrokerImplB
brokerMetrics.setOrUpdateGlobalGauge(BrokerGauge.GRPC_NETTY_POOLED_CACHE_SIZE_NORMAL,
metric::normalCacheSize);
brokerMetrics.setOrUpdateGlobalGauge(BrokerGauge.GRPC_NETTY_POOLED_THREADLOCALCACHE,
metric::numThreadLocalCaches);
brokerMetrics.setOrUpdateGlobalGauge(BrokerGauge.GRPC_NETTY_POOLED_CHUNK_SIZE,
metric::chunkSize);
- // Notice here we are using
io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent instead of
- // io.netty.util.internal.PlatformDependent because gRPC shades Netty to
avoid version conflicts.
- // This also means it uses a different pool of direct memory and a
different setting of max direct memory.
- //
+ // gRPC shares the process-wide Netty direct memory limit and usage.
// Also notice these two metrics are also set by GrpcQueryService. Both
are set to the same value, so it
// doesn't matter which one _wins_ in the metrics system.
brokerMetrics.setOrUpdateGlobalGauge(BrokerGauge.GRPC_TOTAL_MAX_DIRECT_MEMORY,
PlatformDependent::maxDirectMemory);
diff --git
a/pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/grpc/GrpcConnection.java
b/pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/grpc/GrpcConnection.java
index 39a15a81d63..0ba9b27f9f3 100644
---
a/pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/grpc/GrpcConnection.java
+++
b/pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/grpc/GrpcConnection.java
@@ -21,6 +21,7 @@ package org.apache.pinot.client.grpc;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
+import io.grpc.StatusRuntimeException;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
@@ -228,8 +229,16 @@ public class GrpcConnection implements AutoCloseable {
if (response.hasNext()) {
brokerResponseJson.setAll(GrpcUtils.extractMetadataJson(response.next()));
}
- // Directly return when there is exception
if (brokerResponseJson.has("exceptions") &&
!brokerResponseJson.get("exceptions").isEmpty()) {
+ // A partial result can include schema and data blocks after the error
metadata. Drain the RPC to release them.
+ try {
+ while (response.hasNext()) {
+ response.next();
+ }
+ } catch (StatusRuntimeException e) {
+ // Keep the query exceptions already returned in the metadata.
+ LOGGER.debug("gRPC stream failed after returning query exceptions", e);
+ }
return brokerResponseJson;
}
// Process schema
diff --git
a/pinot-clients/pinot-java-client/src/test/java/org/apache/pinot/client/grpc/GrpcConnectionTest.java
b/pinot-clients/pinot-java-client/src/test/java/org/apache/pinot/client/grpc/GrpcConnectionTest.java
index d873fd994e0..f800953d002 100644
---
a/pinot-clients/pinot-java-client/src/test/java/org/apache/pinot/client/grpc/GrpcConnectionTest.java
+++
b/pinot-clients/pinot-java-client/src/test/java/org/apache/pinot/client/grpc/GrpcConnectionTest.java
@@ -56,6 +56,23 @@ public class GrpcConnectionTest {
}
}
+ @Test
+ public void testGetJsonResponseDrainsStreamAfterQueryException()
+ throws Exception {
+ RecordingBrokerStreamingQueryClient grpcQueryClient = new
RecordingBrokerStreamingQueryClient();
+ try (GrpcConnection connection =
+ new GrpcConnection(new Properties(), new
FixedBrokerSelector("localhost:8099"), grpcQueryClient)) {
+ Iterator<Broker.BrokerResponse> responses =
List.of(Broker.BrokerResponse.newBuilder()
+
.setPayload(ByteString.copyFromUtf8("{\"exceptions\":[{\"errorCode\":500,\"message\":\"query
failed\"}]}"))
+ .build(), Broker.BrokerResponse.getDefaultInstance()).iterator();
+ grpcQueryClient._queryResponses = responses;
+
+ Assert.assertEquals(connection.getJsonResponse("SELECT * FROM
testTable", Map.of())
+ .get("exceptions").get(0).get("message").asText(), "query failed");
+ Assert.assertFalse(responses.hasNext());
+ }
+ }
+
private static final class FixedBrokerSelector implements BrokerSelector {
private final String _broker;
@@ -80,6 +97,7 @@ public class GrpcConnectionTest {
private static final class RecordingBrokerStreamingQueryClient extends
GrpcConnection.BrokerStreamingQueryClient {
private final List<Broker.BrokerRequest> _submittedRequests = new
ArrayList<>();
+ private Iterator<Broker.BrokerResponse> _queryResponses;
private RecordingBrokerStreamingQueryClient() {
super(new GrpcConfig(Map.of()));
@@ -89,6 +107,9 @@ public class GrpcConnectionTest {
public Iterator<Broker.BrokerResponse> submit(String brokerHost, int
brokerGrpcPort,
Broker.BrokerRequest brokerRequest) {
_submittedRequests.add(brokerRequest);
+ if (_queryResponses != null) {
+ return _queryResponses;
+ }
return List.of(Broker.BrokerResponse.newBuilder()
.setPayload(ByteString.copyFromUtf8("{}"))
.build()).iterator();
diff --git
a/pinot-clients/pinot-jdbc-client/src/test/java/org/apache/pinot/client/AbstractJdbcDriverAuthTest.java
b/pinot-clients/pinot-jdbc-client/src/test/java/org/apache/pinot/client/AbstractJdbcDriverAuthTest.java
index d41520a57aa..352e1fb93df 100644
---
a/pinot-clients/pinot-jdbc-client/src/test/java/org/apache/pinot/client/AbstractJdbcDriverAuthTest.java
+++
b/pinot-clients/pinot-jdbc-client/src/test/java/org/apache/pinot/client/AbstractJdbcDriverAuthTest.java
@@ -20,7 +20,7 @@ package org.apache.pinot.client;
import com.google.protobuf.ByteString;
import io.grpc.Server;
-import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder;
+import io.grpc.netty.NettyServerBuilder;
import io.grpc.stub.StreamObserver;
import java.io.IOException;
import java.net.ServerSocket;
diff --git a/pinot-common/pom.xml b/pinot-common/pom.xml
index d71d6176c22..a3ddf778014 100644
--- a/pinot-common/pom.xml
+++ b/pinot-common/pom.xml
@@ -308,7 +308,25 @@
</dependency>
<dependency>
<groupId>io.grpc</groupId>
- <artifactId>grpc-netty-shaded</artifactId>
+ <artifactId>grpc-netty</artifactId>
+ </dependency>
+ <!-- Preserve the native transports and OpenSSL provider available to
standalone gRPC clients. -->
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport-native-epoll</artifactId>
+ <classifier>linux-x86_64</classifier>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport-native-epoll</artifactId>
+ <classifier>linux-aarch_64</classifier>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-tcnative-boringssl-static</artifactId>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
diff --git
a/pinot-common/src/main/java/org/apache/pinot/common/metrics/BrokerGauge.java
b/pinot-common/src/main/java/org/apache/pinot/common/metrics/BrokerGauge.java
index b7924004cf1..8cad95351e3 100644
---
a/pinot-common/src/main/java/org/apache/pinot/common/metrics/BrokerGauge.java
+++
b/pinot-common/src/main/java/org/apache/pinot/common/metrics/BrokerGauge.java
@@ -104,13 +104,9 @@ public enum BrokerGauge implements AbstractMetrics.Gauge {
MAILBOX_CLIENT_USED_DIRECT_MEMORY("bytes", true),
MAILBOX_CLIENT_USED_HEAP_MEMORY("bytes", true),
- /// Exports the max amount of direct memory that can be allocated by the
shaded Netty code used by gRPC
- /// It is basically an adaptor for
io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.maxDirectMemory()
- ///
- /// This value can be changed by setting the JVM option
-Dio.grpc.netty.shaded.io.netty.maxDirectMemory
+ /// Exports the process-wide Netty direct memory limit shared by gRPC.
GRPC_TOTAL_MAX_DIRECT_MEMORY("bytes", true),
- /// Exports the total amount of direct memory allocated by the shaded Netty
code used by gRPC
- /// It is basically an adaptor for
io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.usedDirectMemory()
+ /// Exports the process-wide Netty direct memory usage shared by gRPC.
GRPC_TOTAL_USED_DIRECT_MEMORY("bytes", true),
/// Number of MV definition+runtime entries the broker currently holds in
/// `MaterializedViewMetadataCache`. Operators monitor this to confirm the
cache is not
diff --git
a/pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerGauge.java
b/pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerGauge.java
index a7e3b033914..1126961e9be 100644
---
a/pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerGauge.java
+++
b/pinot-common/src/main/java/org/apache/pinot/common/metrics/ServerGauge.java
@@ -139,13 +139,9 @@ public enum ServerGauge implements AbstractMetrics.Gauge {
/// Exports the total amount of direct memory allocated by Netty
/// It is basically an adaptor for
io.netty.util.internal.PlatformDependent.usedDirectMemory()
NETTY_TOTAL_USED_DIRECT_MEMORY("bytes", true),
- /// Exports the max amount of direct memory that can be allocated by the
shaded Netty code used by gRPC
- /// It is basically an adaptor for
io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.maxDirectMemory()
- ///
- /// This value can be changed by setting the JVM option
-Dio.grpc.netty.shaded.io.netty.maxDirectMemory
+ /// Exports the process-wide Netty direct memory limit shared by gRPC.
GRPC_TOTAL_MAX_DIRECT_MEMORY("bytes", true),
- /// Exports the total amount of direct memory allocated by the shaded Netty
code used by gRPC
- /// It is basically an adaptor for
io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.usedDirectMemory()
+ /// Exports the process-wide Netty direct memory usage shared by gRPC.
GRPC_TOTAL_USED_DIRECT_MEMORY("bytes", true),
// how many message are there in the server's message queue in helix
diff --git
a/pinot-common/src/main/java/org/apache/pinot/common/utils/grpc/BaseGrpcQueryClient.java
b/pinot-common/src/main/java/org/apache/pinot/common/utils/grpc/BaseGrpcQueryClient.java
index ec1aabc33c9..24744fb0e2d 100644
---
a/pinot-common/src/main/java/org/apache/pinot/common/utils/grpc/BaseGrpcQueryClient.java
+++
b/pinot-common/src/main/java/org/apache/pinot/common/utils/grpc/BaseGrpcQueryClient.java
@@ -19,13 +19,13 @@
package org.apache.pinot.common.utils.grpc;
import io.grpc.ManagedChannel;
-import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts;
-import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder;
-import io.grpc.netty.shaded.io.netty.buffer.PooledByteBufAllocator;
-import io.grpc.netty.shaded.io.netty.channel.ChannelOption;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslProvider;
+import io.grpc.netty.GrpcSslContexts;
+import io.grpc.netty.NettyChannelBuilder;
+import io.netty.buffer.PooledByteBufAllocator;
+import io.netty.channel.ChannelOption;
+import io.netty.handler.ssl.SslContext;
+import io.netty.handler.ssl.SslContextBuilder;
+import io.netty.handler.ssl.SslProvider;
import java.io.Closeable;
import java.util.Iterator;
import java.util.Map;
diff --git a/pinot-connectors/pinot-spark-3-connector/pom.xml
b/pinot-connectors/pinot-spark-3-connector/pom.xml
index 024ca2f81b1..bef656bdcdf 100644
--- a/pinot-connectors/pinot-spark-3-connector/pom.xml
+++ b/pinot-connectors/pinot-spark-3-connector/pom.xml
@@ -58,13 +58,20 @@
<include>com.google.common.**</include>
</includes>
</relocation>
+ <!-- Spark provides its own Netty. Keep Pinot's gRPC
providers and Netty JNI libraries isolated. -->
<relocation>
<pattern>io</pattern>
- <shadedPattern>${shadeBase}.io</shadedPattern>
+ <shadedPattern>org.apache.pinot.shaded.io</shadedPattern>
<includes>
<include>io.grpc.**</include>
+ <include>io.netty.**</include>
</includes>
</relocation>
+ <relocation>
+ <pattern>^META-INF/native/(lib)?netty_</pattern>
+
<shadedPattern>META-INF/native/$1org_apache_pinot_shaded_netty_</shadedPattern>
+ <rawString>true</rawString>
+ </relocation>
</relocations>
</configuration>
</execution>
@@ -169,7 +176,6 @@
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
-Dio.netty.tryReflectionSetAccessible=true
- -Dio.grpc.netty.shaded.io.netty.tryReflectionSetAccessible=true
</argLine>
</configuration>
</plugin>
diff --git a/pinot-connectors/pinot-spark-common/pom.xml
b/pinot-connectors/pinot-spark-common/pom.xml
index b1e137dff09..98b163e9997 100644
--- a/pinot-connectors/pinot-spark-common/pom.xml
+++ b/pinot-connectors/pinot-spark-common/pom.xml
@@ -148,7 +148,7 @@
<dependency>
<groupId>io.grpc</groupId>
- <artifactId>grpc-netty-shaded</artifactId>
+ <artifactId>grpc-netty</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
diff --git
a/pinot-controller/src/main/java/org/apache/pinot/controller/BaseControllerStarter.java
b/pinot-controller/src/main/java/org/apache/pinot/controller/BaseControllerStarter.java
index d02ddd30f87..e9805772ac4 100644
---
a/pinot-controller/src/main/java/org/apache/pinot/controller/BaseControllerStarter.java
+++
b/pinot-controller/src/main/java/org/apache/pinot/controller/BaseControllerStarter.java
@@ -22,7 +22,7 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.primitives.Longs;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
+import io.netty.handler.ssl.SslContext;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
diff --git
a/pinot-core/src/main/java/org/apache/pinot/core/instance/context/BrokerContext.java
b/pinot-core/src/main/java/org/apache/pinot/core/instance/context/BrokerContext.java
index 40385a7da19..c7ac3096267 100644
---
a/pinot-core/src/main/java/org/apache/pinot/core/instance/context/BrokerContext.java
+++
b/pinot-core/src/main/java/org/apache/pinot/core/instance/context/BrokerContext.java
@@ -18,7 +18,7 @@
*/
package org.apache.pinot.core.instance.context;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
+import io.netty.handler.ssl.SslContext;
import java.util.Objects;
import javax.annotation.Nullable;
import javax.net.ssl.SSLContext;
diff --git
a/pinot-core/src/main/java/org/apache/pinot/core/instance/context/ControllerContext.java
b/pinot-core/src/main/java/org/apache/pinot/core/instance/context/ControllerContext.java
index 8f4454ead03..72c9618ba2a 100644
---
a/pinot-core/src/main/java/org/apache/pinot/core/instance/context/ControllerContext.java
+++
b/pinot-core/src/main/java/org/apache/pinot/core/instance/context/ControllerContext.java
@@ -18,7 +18,7 @@
*/
package org.apache.pinot.core.instance.context;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
+import io.netty.handler.ssl.SslContext;
import java.util.Objects;
import javax.annotation.Nullable;
import javax.net.ssl.SSLContext;
diff --git
a/pinot-core/src/main/java/org/apache/pinot/core/instance/context/ServerContext.java
b/pinot-core/src/main/java/org/apache/pinot/core/instance/context/ServerContext.java
index c87ba7699da..fedc78d502f 100644
---
a/pinot-core/src/main/java/org/apache/pinot/core/instance/context/ServerContext.java
+++
b/pinot-core/src/main/java/org/apache/pinot/core/instance/context/ServerContext.java
@@ -18,7 +18,7 @@
*/
package org.apache.pinot.core.instance.context;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
+import io.netty.handler.ssl.SslContext;
import java.util.Objects;
import javax.annotation.Nullable;
import javax.net.ssl.SSLContext;
diff --git
a/pinot-core/src/main/java/org/apache/pinot/core/transport/NettyInspector.java
b/pinot-core/src/main/java/org/apache/pinot/core/transport/NettyInspector.java
index 6c0b88f9fa2..4fc85601be1 100644
---
a/pinot-core/src/main/java/org/apache/pinot/core/transport/NettyInspector.java
+++
b/pinot-core/src/main/java/org/apache/pinot/core/transport/NettyInspector.java
@@ -47,8 +47,7 @@ public class NettyInspector {
}
);
KNOWN_INSTANCES = new CopyOnWriteArrayList<>(new NettyInstance[] {
- new NettyInstance.UnshadedNettyInstance(),
- new NettyInstance.GrpcNettyInstance()
+ new NettyInstance.UnshadedNettyInstance()
});
}
@@ -58,11 +57,14 @@ public class NettyInspector {
public static void registerMetrics(AbstractMetrics<?, ?, ?, ?> metrics) {
for (NettyInstance instance : KNOWN_INSTANCES) {
- metrics.setOrUpdateGauge(instance.getName() + "NettyDirectMemoryUsed",
- instance::getUsedDirectMemory);
- metrics.setOrUpdateGauge(instance.getName() + "NettyDirectMemoryMax",
- instance::getMaxDirectMemory);
+ registerMetrics(metrics, instance);
}
+ registerMetrics(metrics, new NettyInstance.GrpcNettyInstance());
+ }
+
+ private static void registerMetrics(AbstractMetrics<?, ?, ?, ?> metrics,
NettyInstance instance) {
+ metrics.setOrUpdateGauge(instance.getName() + "NettyDirectMemoryUsed",
instance::getUsedDirectMemory);
+ metrics.setOrUpdateGauge(instance.getName() + "NettyDirectMemoryMax",
instance::getMaxDirectMemory);
}
/// Logs the values of all constants for all Netty instances, and logs
warnings if any checks fail.
diff --git
a/pinot-core/src/main/java/org/apache/pinot/core/transport/NettyInstance.java
b/pinot-core/src/main/java/org/apache/pinot/core/transport/NettyInstance.java
index 964d8033781..39f19097967 100644
---
a/pinot-core/src/main/java/org/apache/pinot/core/transport/NettyInstance.java
+++
b/pinot-core/src/main/java/org/apache/pinot/core/transport/NettyInstance.java
@@ -22,31 +22,7 @@ package org.apache.pinot.core.transport;
import java.lang.reflect.Constructor;
import javax.annotation.Nullable;
-/// Represents an instance of Netty, allowing access to certain static
properties via reflection, with support for
-/// shaded Netty versions.
-///
-/// We know 2 common Netty instances:
-/// - Unshaded Netty, which uses the standard `io.netty` package
-/// - gRPC-shaded Netty, shaded by gRPC and included as a dependency. It uses
`io.grpc.netty.shaded.io.netty` package.
-///
-/// This is important because Netty defines is not designed to be shaded, and
it uses some static attributes to
-/// determine its behavior, specially whether it can use `Unsafe` or not or
how much memory to allocate for direct
-/// buffers.
-/// These attributes are set using JAVA_OPTs. Each shaded version uses
different JAVA_OPT properties. If we forget to
-/// set one of these properties for a shaded version, that Netty _instance_
will fall back to some default behavior that
-/// may not be optimal, and we won't have any indication of that happening.
-///
-/// Given we do not shade Netty our-selves, we can access the different copies
of the Netty classes without using
-/// reflection. [NettyInstance] provides an abstraction to access the
different Netty instances and their properties in
-/// a simple way.
-///
-/// **It is critical to not shade this class**, otherwise the literals used
for reflection
-/// (ie `io.netty.util.internal.PlatformDependent`) will be shaded too, so
instead of looking for
-/// `io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent`, as you
may think reading this class, the shaded
-/// version of this class will look for
-///
`io.grpc.netty.shaded.org.apache.pinot.shaded.io.netty.util.internal.PlatformDependent`.
-/// At the moment this is written, Pinot _does not_ shade Netty, so it is
safe. Just to be sure, this class should be
-/// excluded in the maven shade plugin configuration (see pom.xml on the root
of the project).
+/// Exposes Netty direct memory and JVM diagnostics for the bundled transport
and any additional Netty instances.
public abstract class NettyInstance {
private static final Constructor<DummyClass> CONSTRUCTOR;
@@ -116,42 +92,12 @@ public abstract class NettyInstance {
}
}
- public static class GrpcNettyInstance extends NettyInstance {
+ /// Keeps the legacy gRPC metric names for the shared Netty instance.
+ public static class GrpcNettyInstance extends UnshadedNettyInstance {
@Override
public String getName() {
return "gRPC";
}
-
- @Override
- public String getShadePrefix() {
- return "io.grpc.netty.shaded.";
- }
-
- @Override
- public boolean isExplicitTryReflectionSetAccessible() {
- return
io.grpc.netty.shaded.io.netty.util.internal.ReflectionUtil.trySetAccessible(CONSTRUCTOR,
true) == null;
- }
-
- @Override
- public boolean hasUnsafe() {
- return
io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.hasUnsafe();
- }
-
- @Nullable
- @Override
- public Throwable getUnsafeUnavailabilityCause() {
- return
io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.getUnsafeUnavailabilityCause();
- }
-
- @Override
- public long getUsedDirectMemory() {
- return
io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.usedDirectMemory();
- }
-
- @Override
- public long getMaxDirectMemory() {
- return
io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.maxDirectMemory();
- }
}
private static class DummyClass {
diff --git
a/pinot-core/src/main/java/org/apache/pinot/core/transport/PooledByteBufAllocatorWithLimits.java
b/pinot-core/src/main/java/org/apache/pinot/core/transport/PooledByteBufAllocatorWithLimits.java
index e907cf531fb..16ae18ed540 100644
---
a/pinot-core/src/main/java/org/apache/pinot/core/transport/PooledByteBufAllocatorWithLimits.java
+++
b/pinot-core/src/main/java/org/apache/pinot/core/transport/PooledByteBufAllocatorWithLimits.java
@@ -18,11 +18,11 @@
*/
package org.apache.pinot.core.transport;
-import io.grpc.netty.shaded.io.netty.util.internal.SystemPropertyUtil;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.buffer.PooledByteBufAllocatorMetric;
import io.netty.util.NettyRuntime;
import io.netty.util.internal.PlatformDependent;
+import io.netty.util.internal.SystemPropertyUtil;
import java.lang.reflect.Field;
import java.util.concurrent.atomic.AtomicLong;
import org.slf4j.Logger;
@@ -43,8 +43,8 @@ public class PooledByteBufAllocatorWithLimits {
/// allocator: pooled arenas retain chunk memory after the buffers allocated
from them are released, and free space
/// in one allocator's pool can never serve another allocator's allocations,
so per-connection allocators can retain
/// many times the intended amount of direct memory and exhaust it. Note
that the reduced arena count limits the
- /// worst case retention but is not a hard cap on direct memory usage. The
gRPC based transports use shaded Netty
- /// classes and maintain their own allocators.
+ /// worst case retention but is not a hard cap on direct memory usage. The
gRPC transports maintain their own
+ /// allocators.
public static PooledByteBufAllocator getSharedBufferAllocatorWithLimits() {
PooledByteBufAllocator sharedAllocator = _sharedBufferAllocatorWithLimits;
if (sharedAllocator == null) {
diff --git
a/pinot-core/src/main/java/org/apache/pinot/core/transport/grpc/GrpcQueryServer.java
b/pinot-core/src/main/java/org/apache/pinot/core/transport/grpc/GrpcQueryServer.java
index 9eeecd28f4b..77424bd5e9b 100644
---
a/pinot-core/src/main/java/org/apache/pinot/core/transport/grpc/GrpcQueryServer.java
+++
b/pinot-core/src/main/java/org/apache/pinot/core/transport/grpc/GrpcQueryServer.java
@@ -23,17 +23,17 @@ import io.grpc.Grpc;
import io.grpc.Server;
import io.grpc.ServerTransportFilter;
import io.grpc.Status;
-import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts;
-import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder;
-import io.grpc.netty.shaded.io.netty.buffer.PooledByteBufAllocator;
-import io.grpc.netty.shaded.io.netty.buffer.PooledByteBufAllocatorMetric;
-import io.grpc.netty.shaded.io.netty.channel.ChannelOption;
-import io.grpc.netty.shaded.io.netty.handler.ssl.ClientAuth;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslProvider;
-import io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent;
+import io.grpc.netty.GrpcSslContexts;
+import io.grpc.netty.NettyServerBuilder;
import io.grpc.stub.StreamObserver;
+import io.netty.buffer.PooledByteBufAllocator;
+import io.netty.buffer.PooledByteBufAllocatorMetric;
+import io.netty.channel.ChannelOption;
+import io.netty.handler.ssl.ClientAuth;
+import io.netty.handler.ssl.SslContext;
+import io.netty.handler.ssl.SslContextBuilder;
+import io.netty.handler.ssl.SslProvider;
+import io.netty.util.internal.PlatformDependent;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -149,10 +149,7 @@ public class GrpcQueryServer extends
PinotQueryServerGrpc.PinotQueryServerImplBa
metrics.setOrUpdateGlobalGauge(ServerGauge.GRPC_NETTY_POOLED_THREADLOCALCACHE,
metric::numThreadLocalCaches);
metrics.setOrUpdateGlobalGauge(ServerGauge.GRPC_NETTY_POOLED_CHUNK_SIZE,
metric::chunkSize);
- // Notice here we are using
io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent instead of
- // io.netty.util.internal.PlatformDependent because gRPC shades Netty to
avoid version conflicts.
- // This also means it uses a different pool of direct memory and a
different setting of max direct memory.
- //
+ // gRPC shares the process-wide Netty direct memory limit and usage.
// Also notice these two metrics are also set by the MSE query engine.
Both are set to the same value, so it
// doesn't matter which one _wins_ in the metrics system.
metrics.setOrUpdateGlobalGauge(ServerGauge.GRPC_TOTAL_MAX_DIRECT_MEMORY,
PlatformDependent::maxDirectMemory);
diff --git a/pinot-plugins/pinot-file-system/pinot-gcs/pom.xml
b/pinot-plugins/pinot-file-system/pinot-gcs/pom.xml
index 888ef4a10e1..3b24a37abbf 100644
--- a/pinot-plugins/pinot-file-system/pinot-gcs/pom.xml
+++ b/pinot-plugins/pinot-file-system/pinot-gcs/pom.xml
@@ -43,11 +43,46 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
+ <!-- GcsPinotFS uses the HTTP storage client. -->
+ <exclusion>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-alts</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-googleapis</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-netty-shaded</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-xds</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-nio</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-alts</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-googleapis</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-netty-shaded</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-xds</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
diff --git
a/pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java
b/pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java
index 5beb3da0ce5..68d4651ad7f 100644
---
a/pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java
+++
b/pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java
@@ -81,7 +81,7 @@ public class GcsPinotFS extends BasePinotFS {
String userAgent = "apache-pinot/" + version + " (GPN:apache-pinot)";
Credentials credentials = null;
try {
- StorageOptions.Builder storageBuilder = StorageOptions.newBuilder()
+ StorageOptions.Builder storageBuilder = StorageOptions.http()
.setHeaderProvider(FixedHeaderProvider.create(Map.of("User-Agent",
userAgent)));
if (!Strings.isNullOrEmpty(config.getProperty(PROJECT_ID))) {
LOGGER.info("Configs are: {}, {}", PROJECT_ID,
config.getProperty(PROJECT_ID));
diff --git
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/grpc/GrpcKeepAliveConfig.java
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/grpc/GrpcKeepAliveConfig.java
index 880d9bbff01..ce36b3dfe91 100644
---
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/grpc/GrpcKeepAliveConfig.java
+++
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/grpc/GrpcKeepAliveConfig.java
@@ -19,7 +19,7 @@
package org.apache.pinot.query.grpc;
import com.google.common.base.Preconditions;
-import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder;
+import io.grpc.netty.NettyChannelBuilder;
import java.util.concurrent.TimeUnit;
import org.apache.pinot.spi.env.PinotConfiguration;
import org.apache.pinot.spi.utils.CommonConstants;
diff --git
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/MailboxService.java
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/MailboxService.java
index 967e10ba8ff..bda8f7b22ab 100644
---
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/MailboxService.java
+++
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/MailboxService.java
@@ -22,7 +22,7 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.RemovalListener;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
+import io.netty.handler.ssl.SslContext;
import java.time.Duration;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
@@ -167,10 +167,6 @@ public class MailboxService {
/// shared by every [GrpcSendingMailbox] this service creates. The companion
/// gauges for the server allocator are registered in [GrpcMailboxServer].
///
- /// Notice we are wiring the shaded gRPC Netty allocator
- /// ([io.grpc.netty.shaded.io.netty.buffer.PooledByteBufAllocator]) rather
than
- /// the non-shaded one.
- ///
/// Only the two `MAILBOX_CLIENT_USED_*` gauges are mirrored on the client
side;
/// the six debug-only counterparts exposed by the server
(`MAILBOX_SERVER_ARENAS_*`,
/// `MAILBOX_SERVER_CACHE_SIZE_*`, `MAILBOX_SERVER_THREADLOCALCACHE`,
diff --git
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/channel/ChannelManager.java
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/channel/ChannelManager.java
index 64ad177f640..fa5db2d0a6a 100644
---
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/channel/ChannelManager.java
+++
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/channel/ChannelManager.java
@@ -21,11 +21,11 @@ package org.apache.pinot.query.mailbox.channel;
import com.google.common.base.Preconditions;
import io.grpc.ConnectivityState;
import io.grpc.ManagedChannel;
-import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder;
-import io.grpc.netty.shaded.io.netty.buffer.PooledByteBufAllocator;
-import io.grpc.netty.shaded.io.netty.channel.ChannelOption;
-import io.grpc.netty.shaded.io.netty.channel.WriteBufferWaterMark;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
+import io.grpc.netty.NettyChannelBuilder;
+import io.netty.buffer.PooledByteBufAllocator;
+import io.netty.channel.ChannelOption;
+import io.netty.channel.WriteBufferWaterMark;
+import io.netty.handler.ssl.SslContext;
import java.time.Duration;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
diff --git
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/channel/GrpcMailboxServer.java
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/channel/GrpcMailboxServer.java
index e532a72829d..a4ca400263d 100644
---
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/channel/GrpcMailboxServer.java
+++
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/mailbox/channel/GrpcMailboxServer.java
@@ -21,14 +21,14 @@ package org.apache.pinot.query.mailbox.channel;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import io.grpc.Server;
-import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder;
-import io.grpc.netty.shaded.io.netty.buffer.PooledByteBufAllocator;
-import io.grpc.netty.shaded.io.netty.buffer.PooledByteBufAllocatorMetric;
-import io.grpc.netty.shaded.io.netty.channel.ChannelOption;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
-import io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent;
+import io.grpc.netty.NettyServerBuilder;
import io.grpc.stub.ServerCallStreamObserver;
import io.grpc.stub.StreamObserver;
+import io.netty.buffer.PooledByteBufAllocator;
+import io.netty.buffer.PooledByteBufAllocatorMetric;
+import io.netty.channel.ChannelOption;
+import io.netty.handler.ssl.SslContext;
+import io.netty.util.internal.PlatformDependent;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
@@ -103,10 +103,7 @@ public class GrpcMailboxServer extends
PinotMailboxGrpc.PinotMailboxImplBase {
brokerMetrics.setOrUpdateGlobalGauge(BrokerGauge.MAILBOX_SERVER_THREADLOCALCACHE,
metric::numThreadLocalCaches);
brokerMetrics.setOrUpdateGlobalGauge(BrokerGauge.MAILBOX_SERVER_CHUNK_SIZE,
metric::chunkSize);
- // Notice here we are using
io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent instead of
- // io.netty.util.internal.PlatformDependent because gRPC shades Netty to
avoid version conflicts.
- // This also means it uses a different pool of direct memory and a
different setting of max direct memory.
- //
+ // gRPC shares the process-wide Netty direct memory limit and usage.
// Also notice these two metrics are also set by GrpcQueryService. Both
are set to the same value, so it
// doesn't matter which one _wins_ in the metrics system.
brokerMetrics.setOrUpdateGlobalGauge(BrokerGauge.GRPC_TOTAL_MAX_DIRECT_MEMORY,
@@ -125,10 +122,7 @@ public class GrpcMailboxServer extends
PinotMailboxGrpc.PinotMailboxImplBase {
serverMetrics.setOrUpdateGlobalGauge(ServerGauge.MAILBOX_SERVER_THREADLOCALCACHE,
metric::numThreadLocalCaches);
serverMetrics.setOrUpdateGlobalGauge(ServerGauge.MAILBOX_SERVER_CHUNK_SIZE,
metric::chunkSize);
- // Notice here we are using
io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent instead of
- // io.netty.util.internal.PlatformDependent because gRPC shades Netty to
avoid version conflicts.
- // This also means it uses a different pool of direct memory and a
different setting of max direct memory.
- //
+ // gRPC shares the process-wide Netty direct memory limit and usage.
// Also notice these two metrics are also set by GrpcQueryService. Both
are set to the same value, so it
// doesn't matter which one _wins_ in the metrics system.
serverMetrics.setOrUpdateGlobalGauge(ServerGauge.GRPC_TOTAL_MAX_DIRECT_MEMORY,
diff --git
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/DispatchClient.java
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/DispatchClient.java
index 1bce102c50e..d9bc054d8b2 100644
---
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/DispatchClient.java
+++
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/DispatchClient.java
@@ -21,12 +21,12 @@ package org.apache.pinot.query.service.dispatch;
import io.grpc.Deadline;
import io.grpc.ManagedChannel;
import io.grpc.Metadata;
-import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder;
-import io.grpc.netty.shaded.io.netty.buffer.PooledByteBufAllocator;
-import io.grpc.netty.shaded.io.netty.channel.ChannelOption;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
+import io.grpc.netty.NettyChannelBuilder;
import io.grpc.stub.MetadataUtils;
import io.grpc.stub.StreamObserver;
+import io.netty.buffer.PooledByteBufAllocator;
+import io.netty.channel.ChannelOption;
+import io.netty.handler.ssl.SslContext;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
diff --git
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/QueryDispatcher.java
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/QueryDispatcher.java
index 3a50512bd3e..b2a30941f65 100644
---
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/QueryDispatcher.java
+++
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/QueryDispatcher.java
@@ -25,7 +25,7 @@ import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
import io.grpc.ConnectivityState;
import io.grpc.Deadline;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
+import io.netty.handler.ssl.SslContext;
import java.time.Duration;
import java.util.ArrayList;
import java.util.HashMap;
diff --git
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/timeseries/TimeSeriesDispatchClient.java
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/timeseries/TimeSeriesDispatchClient.java
index 9a442fc94d1..e5b75559701 100644
---
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/timeseries/TimeSeriesDispatchClient.java
+++
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/timeseries/TimeSeriesDispatchClient.java
@@ -20,10 +20,10 @@ package org.apache.pinot.query.service.dispatch.timeseries;
import io.grpc.Deadline;
import io.grpc.ManagedChannel;
-import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder;
-import io.grpc.netty.shaded.io.netty.buffer.PooledByteBufAllocator;
-import io.grpc.netty.shaded.io.netty.channel.ChannelOption;
+import io.grpc.netty.NettyChannelBuilder;
import io.grpc.stub.StreamObserver;
+import io.netty.buffer.PooledByteBufAllocator;
+import io.netty.channel.ChannelOption;
import org.apache.pinot.common.proto.PinotQueryWorkerGrpc;
import org.apache.pinot.common.proto.Worker;
diff --git
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/server/QueryServer.java
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/server/QueryServer.java
index de846fbc9b9..9d84bcad02d 100644
---
a/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/server/QueryServer.java
+++
b/pinot-query-runtime/src/main/java/org/apache/pinot/query/service/server/QueryServer.java
@@ -22,9 +22,9 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.protobuf.ByteString;
import io.grpc.Server;
-import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder;
-import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext;
+import io.grpc.netty.NettyServerBuilder;
import io.grpc.stub.StreamObserver;
+import io.netty.handler.ssl.SslContext;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.HashMap;
diff --git
a/pinot-query-runtime/src/test/java/org/apache/pinot/query/grpc/GrpcKeepAliveConfigTest.java
b/pinot-query-runtime/src/test/java/org/apache/pinot/query/grpc/GrpcKeepAliveConfigTest.java
index d520fad322f..17a75e2e446 100644
---
a/pinot-query-runtime/src/test/java/org/apache/pinot/query/grpc/GrpcKeepAliveConfigTest.java
+++
b/pinot-query-runtime/src/test/java/org/apache/pinot/query/grpc/GrpcKeepAliveConfigTest.java
@@ -18,7 +18,7 @@
*/
package org.apache.pinot.query.grpc;
-import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder;
+import io.grpc.netty.NettyChannelBuilder;
import java.util.Map;
import org.apache.pinot.spi.env.PinotConfiguration;
import org.apache.pinot.spi.utils.CommonConstants.MultiStageQueryRunner;
diff --git
a/pinot-query-runtime/src/test/java/org/apache/pinot/query/mailbox/channel/MailboxChannelKeepAliveTest.java
b/pinot-query-runtime/src/test/java/org/apache/pinot/query/mailbox/channel/MailboxChannelKeepAliveTest.java
index 0205b590903..af178d9fb05 100644
---
a/pinot-query-runtime/src/test/java/org/apache/pinot/query/mailbox/channel/MailboxChannelKeepAliveTest.java
+++
b/pinot-query-runtime/src/test/java/org/apache/pinot/query/mailbox/channel/MailboxChannelKeepAliveTest.java
@@ -22,7 +22,7 @@ import io.grpc.ManagedChannel;
import io.grpc.Server;
import io.grpc.Status;
import io.grpc.StatusRuntimeException;
-import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder;
+import io.grpc.netty.NettyServerBuilder;
import io.grpc.stub.StreamObserver;
import java.io.Closeable;
import java.io.IOException;
diff --git
a/pinot-query-runtime/src/test/java/org/apache/pinot/query/service/dispatch/DispatchClientTest.java
b/pinot-query-runtime/src/test/java/org/apache/pinot/query/service/dispatch/DispatchClientTest.java
index 264eb8528a9..dfccfca8658 100644
---
a/pinot-query-runtime/src/test/java/org/apache/pinot/query/service/dispatch/DispatchClientTest.java
+++
b/pinot-query-runtime/src/test/java/org/apache/pinot/query/service/dispatch/DispatchClientTest.java
@@ -21,7 +21,7 @@ package org.apache.pinot.query.service.dispatch;
import io.grpc.Deadline;
import io.grpc.Server;
import io.grpc.Status;
-import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder;
+import io.grpc.netty.NettyServerBuilder;
import io.grpc.stub.StreamObserver;
import java.io.IOException;
import java.time.Duration;
diff --git a/pinot-server/pom.xml b/pinot-server/pom.xml
index 671b155089d..f9fa8299ae7 100644
--- a/pinot-server/pom.xml
+++ b/pinot-server/pom.xml
@@ -44,7 +44,7 @@
</dependency>
<dependency>
<groupId>io.grpc</groupId>
- <artifactId>grpc-netty-shaded</artifactId>
+ <artifactId>grpc-netty</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
diff --git a/pinot-tools/src/main/resources/appAssemblerScriptTemplate
b/pinot-tools/src/main/resources/appAssemblerScriptTemplate
index ccb46176b15..63ed9b3095c 100644
--- a/pinot-tools/src/main/resources/appAssemblerScriptTemplate
+++ b/pinot-tools/src/main/resources/appAssemblerScriptTemplate
@@ -283,7 +283,6 @@ if [ "$JDK_VERSION" -gt 11 ]; then
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED \
-Dio.netty.tryReflectionSetAccessible=true \
- -Dio.grpc.netty.shaded.io.netty.tryReflectionSetAccessible=true \
$JAVA_OPTS"
fi
diff --git a/pom.xml b/pom.xml
index b191bcaa671..1495061d1d4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2212,7 +2212,7 @@
<artifactId>mchange-commons-java</artifactId>
<version>${mchange-commons-java.version}</version>
</dependency>
- <!-- Used by grpc-netty-shade and google-cloud-storage -->
+ <!-- Used by gRPC and Google Cloud Storage -->
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-annotations</artifactId>
@@ -2434,7 +2434,6 @@
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
-Dio.netty.tryReflectionSetAccessible=true
- -Dio.grpc.netty.shaded.io.netty.tryReflectionSetAccessible=true
-Dnet.bytebuddy.experimental=true
-javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito-core.version}/mockito-core-${mockito-core.version}.jar
-Xshare:off
@@ -3175,9 +3174,6 @@
and its vulnerable pipelining handler (CVE-2026-47874),
including already shaded inputs. -->
<exclude>reactor/netty/http/server/**</exclude>
<exclude>META-INF/versions/**/reactor/netty/http/server/**</exclude>
-
- <!-- Exclude NettyInstance because it includes Netty package
literals -->
-
<exclude>src/main/java/org/apache/pinot/core/transport/NettyInstance.java</exclude>
</excludes>
</filter>
<filter>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]