Skip to content

chore(deps): Upgrade netty to 4.2.10.Final#27277

Merged
feilong-liu merged 1 commit intoprestodb:masterfrom
vandreykiv:export-D95429747
Mar 6, 2026
Merged

chore(deps): Upgrade netty to 4.2.10.Final#27277
feilong-liu merged 1 commit intoprestodb:masterfrom
vandreykiv:export-D95429747

Conversation

@vandreykiv
Copy link
Copy Markdown
Contributor

@vandreykiv vandreykiv commented Mar 6, 2026

Description

Upgrade Netty to 4.2.10.Final

Motivation and Context

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).

Release Notes

== RELEASE NOTES ==

General Changes
* Update netty from version 4.1.130.Final to 4.2.10.Final.

Summary: Bump netty to 4.2.10.Final

Differential Revision: D95429747
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Mar 6, 2026

Reviewer's Guide

Updates Netty and related networking dependencies to newer versions and adjusts Presto’s Netty/Drift integration and build configuration to be compatible with Netty 4.2, including SSL behavior, allocator wiring, and dependency scoping/exclusions.

Class diagram for updated SafeEventLoopGroup integration

classDiagram
    class HttpRemoteTaskFactory {
        - Optional~EventLoopGroup~ eventLoopGroup
        + HttpRemoteTaskFactory(...)
    }

    class SafeEventLoopGroup {
        + SafeEventLoopGroup(int nThreads, ThreadFactory threadFactory, long slowMethodThresholdNanos)
        + newChild(Executor executor, Object args) EventLoop
        + run()
    }

    class SafeEventLoop {
        + SafeEventLoop(SafeEventLoopGroup parent, Executor executor)
        + run()
    }

    HttpRemoteTaskFactory --> SafeEventLoopGroup : creates
    SafeEventLoopGroup --> SafeEventLoop : newChild
Loading

File-Level Changes

Change Details Files
Upgrade Netty and Reactor Netty versions and align Reactor Core dependency
  • Bump Netty from 4.1.130.Final to 4.2.10.Final via the shared dependency property
  • Bump Reactor Netty from 1.2.8 to 1.3.3 via the shared dependency property
  • Replace the older reactor-core dependency version in presto-main with a managed dependency in the parent POM at version 3.8.3
pom.xml
presto-main/pom.xml
Adapt SafeEventLoopGroup and its usage to Netty 4.2 API changes
  • Remove the custom anonymous SafeEventLoopGroup subclass in HttpRemoteTaskFactory and instantiate SafeEventLoopGroup directly
  • Update SafeEventLoopGroup.newChild signature to declare throws Exception, matching Netty 4.2
  • Change SafeEventLoop.run to invoke task.run() instead of runTask(task) to align with underlying EventLoop behavior
presto-main/src/main/java/com/facebook/presto/server/remotetask/HttpRemoteTaskFactory.java
presto-main-base/src/main/java/com/facebook/presto/execution/SafeEventLoopGroup.java
Work around Netty 4.2 default SSL endpoint verification for Drift
  • On server startup, detect if io.netty.handler.ssl.defaultEndpointVerificationAlgorithm is unset and force it to "NONE" to avoid SSLHandshakeException due to Drift not passing hostnames to the SSL engine
presto-main/src/main/java/com/facebook/presto/server/PrestoServer.java
Wire Netty pooled allocator into Drift Netty client modules
  • Update all DriftNettyClientModule usages to pass PooledByteBufAllocator.DEFAULT
  • Ensure MySQL/H2 function namespace managers, server main module, and Thrift connector use the allocator-aware DriftNettyClientModule constructor
presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/mysql/MySqlFunctionNamespaceManagerFactory.java
presto-function-namespace-managers/src/test/java/com/facebook/presto/functionNamespace/mysql/TestMySqlFunctionNamespaceManager.java
presto-main/src/main/java/com/facebook/presto/server/ServerMainModule.java
presto-tests/src/main/java/com/facebook/presto/tests/H2FunctionNamespaceManagerFactory.java
presto-thrift-connector/src/main/java/com/facebook/presto/connector/thrift/ThriftConnectorFactory.java
Adjust Maven dependencies to support Netty 4.2 and avoid conflicts
  • Add explicit netty-buffer dependency where Drift transport is used (function namespace managers, tests, thrift connector) to satisfy new Netty 4.2 modularization
  • Exclude all io.netty artifacts from the shaded JDBC driver to prevent native .so conflicts and Java 11+ multi-release class bytecode issues with Java 8 enforcement
presto-function-namespace-managers/pom.xml
presto-tests/pom.xml
presto-thrift-connector/pom.xml
presto-jdbc/pom.xml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • Disabling Netty’s SSL endpoint verification globally via a system property in PrestoServer.run() is a broad change; consider scoping this to just the Drift Netty clients (or making it explicitly configurable) so other SSL users can still benefit from hostname verification.
  • The change in SafeEventLoop.run() from runTask(task) to task.run() alters how tasks are executed and may bypass any Netty bookkeeping or hooks in runTask; if this is required for 4.2 compatibility, consider adding a short comment explaining why the override is necessary and safe.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Disabling Netty’s SSL endpoint verification globally via a system property in PrestoServer.run() is a broad change; consider scoping this to just the Drift Netty clients (or making it explicitly configurable) so other SSL users can still benefit from hostname verification.
- The change in SafeEventLoop.run() from runTask(task) to task.run() alters how tasks are executed and may bypass any Netty bookkeeping or hooks in runTask; if this is required for 4.2 compatibility, consider adding a short comment explaining why the override is necessary and safe.

## Individual Comments

### Comment 1
<location path="presto-main-base/src/main/java/com/facebook/presto/execution/SafeEventLoopGroup.java" line_range="74-75" />
<code_context>
                 Runnable task = takeTask();
                 if (task != null) {
                     try {
-                        runTask(task);
+                        task.run();
                     }
                     catch (Throwable t) {
</code_context>
<issue_to_address>
**issue (bug_risk):** Replacing `runTask(task)` with `task.run()` may bypass Netty’s internal execution/measurement logic.

In `SingleThreadEventExecutor`, `runTask(task)` may perform additional work (e.g., internal accounting, instrumentation, executor state checks). Given this class’s `slowMethodThreshold` and its role as a safe wrapper, calling `task.run()` directly risks bypassing those hooks and breaking existing timing/monitoring behavior. Please consider keeping `runTask(task)` (or the appropriate 4.2 API) and layering your extra safety/metrics on top of it instead.
</issue_to_address>

### Comment 2
<location path="presto-main/src/main/java/com/facebook/presto/server/PrestoServer.java" line_range="123-126" />
<code_context>
         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");
+        }
</code_context>
<issue_to_address>
**🚨 issue (security):** Disabling Netty’s default endpoint verification globally may be too broad and could weaken TLS guarantees.

This system property applies to all Netty SSL usage in the JVM, so this change weakens TLS verification for every Netty-based client that doesn’t explicitly override the algorithm. Can we instead confine the workaround to Drift’s SSL configuration, or at least guard it with a dedicated config flag so operators must opt in to disabling verification?
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@vandreykiv vandreykiv changed the title Bump netty version chore(deps): Bump netty version to 4.2.10.Final Mar 6, 2026
@vandreykiv vandreykiv changed the title chore(deps): Bump netty version to 4.2.10.Final chore(deps): Upgrade netty to 4.2.10.Final Mar 6, 2026
@feilong-liu feilong-liu merged commit de008fd into prestodb:master Mar 6, 2026
87 of 105 checks passed
@vandreykiv vandreykiv deleted the export-D95429747 branch March 6, 2026 17:33
garimauttam pushed a commit to garimauttam/presto that referenced this pull request Mar 9, 2026
## Description
Upgrade Netty to 4.2.10.Final

## Motivation and Context

## Impact

## Test Plan

## Contributor checklist

- [x] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [x] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [x] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [x] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [x] Adequate tests were added if applicable.
- [x] CI passed.
- [x] If adding new dependencies, verified they have an [OpenSSF
Scorecard](https://securityscorecards.dev/#the-checks) score of 5.0 or
higher (or obtained explicit TSC approval for lower scores).

## Release Notes

```
== RELEASE NOTES ==

General Changes
* Update netty from version 4.1.130.Final to 4.2.10.Final.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants