Skip to content

Commit

Permalink
close #3879 - disable buffer pooling in DotNetty transport (#4252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb committed Mar 9, 2020
1 parent da53e08 commit 9475326
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
5 changes: 0 additions & 5 deletions src/core/Akka.Remote/Configuration/Remote.conf
Expand Up @@ -432,11 +432,6 @@ akka {
# i.e. how long a connect may take until it is timed out
connection-timeout = 15 s

# Toggles buffer pooling on and off inside DotNetty.
# Only intended to be a work-around for users who are still running on DotNetty v0.4.6-v0.4.7
# for the following bug: https://github.com/akkadotnet/akka.net/issues/3370
enable-pooling = true

# If set to "<id.of.dispatcher>" then the specified dispatcher
# will be used to accept inbound connections, and perform IO. If "" then
# dedicated threads will be used.
Expand Down
4 changes: 2 additions & 2 deletions src/core/Akka.Remote/Transport/DotNetty/DotNettyTransport.cs
Expand Up @@ -275,7 +275,7 @@ protected Bootstrap ClientFactory(Address remoteAddress)
.Option(ChannelOption.TcpNodelay, Settings.TcpNoDelay)
.Option(ChannelOption.ConnectTimeout, Settings.ConnectTimeout)
.Option(ChannelOption.AutoRead, false)
.Option(ChannelOption.Allocator, Settings.EnableBufferPooling ? (IByteBufferAllocator)PooledByteBufferAllocator.Default : UnpooledByteBufferAllocator.Default)
.Option(ChannelOption.Allocator, UnpooledByteBufferAllocator.Default)
.ChannelFactory(() => Settings.EnforceIpFamily
? new TcpSocketChannel(addressFamily)
: new TcpSocketChannel())
Expand Down Expand Up @@ -384,7 +384,7 @@ private ServerBootstrap ServerFactory()
.Option(ChannelOption.TcpNodelay, Settings.TcpNoDelay)
.Option(ChannelOption.AutoRead, false)
.Option(ChannelOption.SoBacklog, Settings.Backlog)
.Option(ChannelOption.Allocator, Settings.EnableBufferPooling ? (IByteBufferAllocator)PooledByteBufferAllocator.Default : UnpooledByteBufferAllocator.Default)
.Option(ChannelOption.Allocator, UnpooledByteBufferAllocator.Default)
.ChannelFactory(() => Settings.EnforceIpFamily
? new TcpServerSocketChannel(addressFamily)
: new TcpServerSocketChannel())
Expand Down
2 changes: 0 additions & 2 deletions src/core/Akka.Remote/Transport/DotNetty/TcpTransport.cs
Expand Up @@ -180,8 +180,6 @@ public override bool Write(ByteString payload)

private IByteBuffer ToByteBuffer(ByteString payload)
{
//TODO: optimize DotNetty byte buffer usage
// (maybe custom IByteBuffer working directly on ByteString?)
var buffer = Unpooled.WrappedBuffer(payload.ToByteArray());
return buffer;
}
Expand Down

0 comments on commit 9475326

Please sign in to comment.