feature: upgrade Netty to 4.2.15.Final - #8209
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.x #8209 +/- ##
============================================
+ Coverage 73.22% 73.38% +0.15%
- Complexity 1146 1147 +1
============================================
Files 1153 1153
Lines 42348 42359 +11
Branches 5061 5061
============================================
+ Hits 31011 31085 +74
+ Misses 8852 8803 -49
+ Partials 2485 2471 -14
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request upgrades Seata’s Netty stack to 4.2.15.Final via a centralized BOM and migrates the transport event-loop implementation from deprecated Netty 4.1 APIs to the Netty 4.2 IoHandler / MultiThreadIoEventLoopGroup APIs. It also updates dependency management precedence (notably for Spring Boot–managed modules), adjusts distribution startup scripts to keep pooled allocator settings explicit, and refreshes/extends tests to validate the new Netty-based behavior paths.
Changes:
- Upgrade Netty to
4.2.15.Finaland enforce alignment via BOM imports + Maven Enforcer convergence forio.netty:*. - Migrate server/client event loops to
MultiThreadIoEventLoopGroup+NioIoHandler/EpollIoHandler, and explicitly configure pooled allocators at runtime. - Update tests (including gRPC interceptor tests) and distribution scripts to reflect the new transport/runtime settings.
Reviewed changes
Copilot reviewed 20 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test-suite/test-new-version/src/test/java/org/apache/seata/core/rpc/netty/v1/ProtocolV1Server.java | Updates compatibility test server to Netty 4.2 event loop group + IO handler APIs. |
| test-suite/test-new-version/src/test/java/org/apache/seata/core/rpc/netty/v1/ProtocolV1Client.java | Updates compatibility test client to Netty 4.2 event loop group + IO handler APIs. |
| test-suite/test-new-version/src/test/java/org/apache/seata/core/rpc/netty/multiversion/AbstractMultiVersionCompatibilityTest.java | Migrates multiversion test event loops to Netty 4.2 IO handler model. |
| server/pom.xml | Imports Netty BOM ahead of other BOMs to ensure Netty version precedence. |
| namingserver/pom.xml | Imports Netty BOM ahead of Spring Boot BOM to avoid Netty version drift. |
| mock-server/pom.xml | Imports Netty BOM ahead of Spring Boot BOM to keep Netty aligned. |
| extensions/rpc/seata-grpc/src/test/java/org/apache/seata/integration/grpc/interceptor/GrpcTest.java | Moves interceptor test to real grpc-netty TCP transport and JUnit Jupiter lifecycle. |
| extensions/apm/apm-seata-skywalking-plugin/pom.xml | Adds direct provided Netty dependencies required by the plugin’s Netty API usage. |
| distribution/bin/seata-setup.sh | Ensures pooled allocator system property is set in server setup script. |
| distribution/bin/seata-server.bat | Ensures pooled allocator system property is set in Windows server launcher. |
| distribution/bin/seata-namingserver.bat | Ensures pooled allocator system property is set in Windows namingserver launcher. |
| distribution/bin/seata-namingserver-setup.sh | Ensures pooled allocator system property is set in namingserver setup script. |
| dependencies/pom.xml | Adds Netty BOM import in dependency management for unified Netty 4.2 module alignment. |
| core/src/test/java/org/apache/seata/core/rpc/netty/NettyServerBootstrapTest.java | Adds coverage asserting server uses Netty 4.2 MultiThreadIoEventLoopGroup when epoll disabled. |
| core/src/test/java/org/apache/seata/core/rpc/netty/NettyClientBootstrapTest.java | Extends coverage for pooled allocator option and Netty 4.2 event loop group selection. |
| core/src/test/java/org/apache/seata/core/rpc/netty/ChannelEventHandlerIntegrationTest.java | Migrates integration test event loops to Netty 4.2 IO handler model. |
| core/src/main/java/org/apache/seata/core/rpc/netty/NettyServerBootstrap.java | Migrates server event loops to Netty 4.2 APIs and explicitly sets pooled allocators on channels. |
| core/src/main/java/org/apache/seata/core/rpc/netty/NettyClientBootstrap.java | Migrates client event loops to Netty 4.2 APIs and explicitly sets pooled allocator + improved epoll fallback logging. |
| core/src/main/java/org/apache/seata/core/rpc/netty/NettyBaseConfig.java | Simplifies epoll selection logic around Epoll.isAvailable(). |
| core/src/main/java/org/apache/seata/core/protocol/detector/HttpDetector.java | Adds bounds check to prevent prefix scan on insufficient readable bytes. |
| config/seata-config-etcd3/src/main/java/org/apache/seata/config/etcd3/EtcdConfiguration.java | Removes Netty internal ConcurrentSet usage in favor of ConcurrentHashMap.newKeySet(). |
| changes/zh-cn/2.x.md | Adds changelog entry and contributor acknowledgement for the Netty upgrade. |
| changes/en-us/2.x.md | Adds changelog entry and contributor acknowledgement for the Netty upgrade. |
| build/pom.xml | Defines netty.version=4.2.15.Final, upgrades enforcer plugin, and enforces Netty dependency convergence. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
WangzJi
left a comment
There was a problem hiding this comment.
Could you confirm whether seata-console also needs to be aligned with Netty 4.2.15? Under the source-release profile, its effective dependency tree still resolves io.netty:* to 4.2.12.Final via Spring Boot 4.0.6. If only the final server/namingserver distributions need alignment and they already resolve to 4.2.15, no change is needed; otherwise, console should import the Netty BOM before Spring Boot as well.
| <spotless-maven-plugin.version>2.44.3</spotless-maven-plugin.version> | ||
| <palantirJavaFormat.version>2.38.0</palantirJavaFormat.version> | ||
| <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version> | ||
| <maven-enforcer-plugin.version>3.6.3</maven-enforcer-plugin.version> |
Ⅰ. Describe what this PR did
4.1.137.Finalto4.2.15.Finalthrough the Netty BOM.IoHandler/MultiThreadIoEventLoopGroupAPIs.pooled, and remove use of Netty internal APIs.grpc-nettyTCP server and client.changes/.Ⅱ. Does this pull request fix one issue?
No.
Ⅲ. Why don't you add test cases (unit test/integration test)?
N/A. This PR updates existing tests and executes the relevant test suites.
In particular,
GrpcTestwas migrated from the in-process transport to a realgrpc-nettyTCP transport, so the test now verifies the Netty-based gRPC request path. Existing core remoting, HTTP/2, Etcd registry, and version-compatibility tests were also executed.Ⅳ. Describe how to verify it
Run the relevant unit tests on JDK 8:
extensions/rpc/seata-grpcinterceptor tests.Run the cross-version compatibility tests on JDK 21:
Build the release distribution with JDK 25 and the
release-seataprofile.Inspect the generated server and naming-server distributions:
4.2.15.Final.netty-4.1.xartifacts should remain.-Dio.netty.allocator.type=pooled.Ⅴ. Special notes for reviews
providedNetty dependencies because it directly uses NettyChannelandAttributeMaptypes.