This is an automated email from the ASF dual-hosted git repository.
fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/main by this push:
new 92ed723260 upgrade to Netty 4.2.0.Final (#1794)
92ed723260 is described below
commit 92ed723260268ab8bcb88c6e95c919ee21ee6a2a
Author: PJ Fanning <[email protected]>
AuthorDate: Tue Apr 15 15:49:17 2025 +0200
upgrade to Netty 4.2.0.Final (#1794)
* Test Netty 4.2.0.RC4
* ignore deprecated warnings (for now)
* refactor
* Update Dependencies.scala
---
.../apache/pekko/remote/testconductor/RemoteConnection.scala | 9 +++++----
project/Dependencies.scala | 2 +-
.../apache/pekko/remote/transport/netty/NettyTransport.scala | 12 +++++++-----
3 files changed, 13 insertions(+), 10 deletions(-)
diff --git
a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/RemoteConnection.scala
b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/RemoteConnection.scala
index 99801878bf..db5fc70066 100644
---
a/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/RemoteConnection.scala
+++
b/multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/RemoteConnection.scala
@@ -22,7 +22,7 @@ import io.netty.bootstrap.{ Bootstrap, ServerBootstrap }
import io.netty.buffer.{ ByteBuf, ByteBufUtil }
import io.netty.channel._
import io.netty.channel.ChannelHandler.Sharable
-import io.netty.channel.nio.NioEventLoopGroup
+import io.netty.channel.nio.NioIoHandler
import io.netty.channel.socket.SocketChannel
import io.netty.channel.socket.nio.{ NioServerSocketChannel, NioSocketChannel }
import io.netty.handler.codec.{
@@ -123,7 +123,7 @@ private[pekko] object RemoteConnection {
role match {
case Client =>
val bootstrap = new Bootstrap()
- val eventLoopGroup = new NioEventLoopGroup(poolSize)
+ val eventLoopGroup = new MultiThreadIoEventLoopGroup(poolSize,
NioIoHandler.newFactory())
val cf = bootstrap
.group(eventLoopGroup)
.channel(classOf[NioSocketChannel])
@@ -148,8 +148,9 @@ private[pekko] object RemoteConnection {
case Server =>
val bootstrap = new ServerBootstrap()
- val parentEventLoopGroup = new NioEventLoopGroup(poolSize)
- val childEventLoopGroup = new NioEventLoopGroup(poolSize)
+ val ioHandlerFactory = NioIoHandler.newFactory()
+ val parentEventLoopGroup = new MultiThreadIoEventLoopGroup(poolSize,
ioHandlerFactory)
+ val childEventLoopGroup = new MultiThreadIoEventLoopGroup(poolSize,
ioHandlerFactory)
val cf = bootstrap
.group(parentEventLoopGroup, childEventLoopGroup)
.channel(classOf[NioServerSocketChannel])
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index 8b16e5fdeb..e4a16b0f51 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -36,7 +36,7 @@ object Dependencies {
// needs to be inline with the aeron version, check
// https://github.com/real-logic/aeron/blob/1.x.y/build.gradle
val agronaVersion = "1.22.0"
- val nettyVersion = "4.1.119.Final"
+ val nettyVersion = "4.2.0.Final"
val logbackVersion = "1.3.15"
val jacksonCoreVersion = "2.18.3"
diff --git
a/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala
b/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala
index 4016c99bcc..4548c7ff89 100644
---
a/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala
+++
b/remote/src/main/scala/org/apache/pekko/remote/transport/netty/NettyTransport.scala
@@ -52,10 +52,12 @@ import io.netty.channel.{
ChannelHandlerContext,
ChannelInitializer,
ChannelOption,
- ChannelPipeline
+ ChannelPipeline,
+ EventLoopGroup,
+ MultiThreadIoEventLoopGroup
}
import io.netty.channel.group.{ ChannelGroup, ChannelGroupFuture,
ChannelMatchers, DefaultChannelGroup }
-import io.netty.channel.nio.NioEventLoopGroup
+import io.netty.channel.nio.NioIoHandler
import io.netty.channel.socket.SocketChannel
import io.netty.channel.socket.nio.{ NioServerSocketChannel, NioSocketChannel }
import io.netty.handler.codec.{ LengthFieldBasedFrameDecoder,
LengthFieldPrepender }
@@ -365,10 +367,10 @@ class NettyTransport(val settings:
NettyTransportSettings, val system: ExtendedA
private val log = Logging.withMarker(system, classOf[NettyTransport])
- private def createEventLoopGroup(nThreadCount: Int): NioEventLoopGroup =
+ private def createEventLoopGroup(nThreadCount: Int): EventLoopGroup =
UseDispatcherForIo.map(system.dispatchers.lookup)
- .map(executor => new NioEventLoopGroup(0, executor))
- .getOrElse(new NioEventLoopGroup(nThreadCount, system.threadFactory))
+ .map(executor => new MultiThreadIoEventLoopGroup(0, executor,
NioIoHandler.newFactory()))
+ .getOrElse(new MultiThreadIoEventLoopGroup(nThreadCount,
system.threadFactory, NioIoHandler.newFactory()))
/*
* Be aware, that the close() method of DefaultChannelGroup is racy, because
it uses an iterator over a ConcurrentHashMap.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]