Skip to content

Upgrade Netty to 4.2.12.Final#4744

Merged
merlimat merged 3 commits intoapache:masterfrom
merlimat:netty-4.2-upgrade
Apr 18, 2026
Merged

Upgrade Netty to 4.2.12.Final#4744
merlimat merged 3 commits intoapache:masterfrom
merlimat:netty-4.2-upgrade

Conversation

@merlimat
Copy link
Copy Markdown
Contributor

Summary

Upgrades Netty from 4.1.130.Final to 4.2.12.Final (latest 4.2.x). This upgrade is needed to enable upgrading the async-http-client library, which has switched to Netty 4.2 and is no longer compatible with 4.1.

Key changes

  • Netty version: 4.1.130.Final4.2.12.Final, removed separate netty-iouring.version since io_uring transport is now part of the main Netty release
  • io_uring migration: Package io.netty.incubator.channel.uringio.netty.channel.uring, class naming convention IOUring*IoUring*. The IOUringEventLoopGroup class was removed in 4.2 and is replaced by MultiThreadIoEventLoopGroup(IoUringIoHandler.newFactory())
  • Epoll classes split: Netty 4.2 split epoll into netty-transport-classes-epoll (pure Java) + netty-transport-native-epoll (native binaries); added the explicit classes dependency in bookkeeper-server/pom.xml
  • EventLoopUtil helper: Added isIoUringGroup(EventLoopGroup) that uses MultiThreadIoEventLoopGroup.isIoType(IoUringIoHandler.class) since instanceof IOUringEventLoopGroup is no longer possible
  • LICENSE/NOTICE files in bookkeeper-dist updated to reflect new artifact names (netty-codec was split into netty-codec-base / netty-codec-compression, io_uring moved from io.netty.incubator to io.netty, netty-tcnative-boringssl-static 2.0.74 → 2.0.75)

EpollEventLoopGroup and NioEventLoopGroup are now deprecated in favor of MultiThreadIoEventLoopGroup with factories, but remain functional; this PR keeps using them to minimize surface area of the change.

Test plan

  • mvn install -DskipTests — full build succeeds
  • mvn -pl bookkeeper-dist/{server,all,bkctl} -am package — all three distribution bundles build successfully
  • TestPerChannelBookieClient + ClientSocketDisconnectTest — pass
  • BookieInitializationTest (40 tests) — pass
  • CI full test suite

Migrates io_uring transport from the `io.netty.incubator` incubator
module (removed in 4.2) to the graduated `io.netty.channel.uring`
package. Adds explicit `netty-transport-classes-epoll` dependency
since Netty 4.2 splits epoll classes from native binaries.

Replaces `IOUringEventLoopGroup` with
`MultiThreadIoEventLoopGroup(IoUringIoHandler.newFactory())` and
introduces `EventLoopUtil.isIoUringGroup()` to replace the former
`instanceof IOUringEventLoopGroup` checks.

Updates LICENSE/NOTICE files in bookkeeper-dist to reflect the new
Netty 4.2.12 artifact names (split of netty-codec into
netty-codec-base/compression and io_uring moving from
io.netty.incubator to io.netty).
TLSContextFactory: Netty 4.2 enables HTTPS endpoint identification
on the client side by default (previously null). Explicitly set the
algorithm based on the getHostnameVerificationEnabled() config so
that disabling hostname verification actually disables it under 4.2.

BookieProtoEncodingTest: the V2 batch read request/response tests
compared fields on the pre-encoded object against the decoded one.
encode() recycles the request (clearing ledgerId etc. to -1); in
Netty 4.2 the Recycler returns a fresh object on the next get(),
so the comparison failed. Capture the expected values before encode.
@merlimat merlimat requested review from lhotari and zymap April 17, 2026 17:41
Copy link
Copy Markdown
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

@merlimat merlimat merged commit 6fac859 into apache:master Apr 18, 2026
20 checks passed
@merlimat merlimat deleted the netty-4.2-upgrade branch April 18, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants