From ea266c1950bfbad5bc6be2de50d25d27b35e8296 Mon Sep 17 00:00:00 2001 From: Maksym Ostroverkhov Date: Tue, 21 May 2019 07:54:46 +0300 Subject: [PATCH] Revert "workaround reactor-netty bug when connections are not closed on DisposableChannel close" This reverts commit 67bea790 Signed-off-by: Maksym Ostroverkhov --- .../transport/netty/server/TcpServerTransport.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/rsocket-transport-netty/src/main/java/io/rsocket/transport/netty/server/TcpServerTransport.java b/rsocket-transport-netty/src/main/java/io/rsocket/transport/netty/server/TcpServerTransport.java index 427c76db2..b7f60aa6c 100644 --- a/rsocket-transport-netty/src/main/java/io/rsocket/transport/netty/server/TcpServerTransport.java +++ b/rsocket-transport-netty/src/main/java/io/rsocket/transport/netty/server/TcpServerTransport.java @@ -17,9 +17,6 @@ package io.rsocket.transport.netty.server; import io.netty.buffer.ByteBufAllocator; -import io.netty.channel.group.ChannelGroup; -import io.netty.channel.group.DefaultChannelGroup; -import io.netty.util.concurrent.DefaultEventExecutor; import io.rsocket.DuplexConnection; import io.rsocket.fragmentation.FragmentationDuplexConnection; import io.rsocket.transport.ClientTransport; @@ -97,11 +94,10 @@ public static TcpServerTransport create(TcpServer server) { @Override public Mono start(ConnectionAcceptor acceptor, int mtu) { Objects.requireNonNull(acceptor, "acceptor must not be null"); - ChannelGroup group = new DefaultChannelGroup(new DefaultEventExecutor()); + return server .doOnConnection( c -> { - group.add(c.channel()); c.addHandlerLast(new RSocketLengthCodec()); DuplexConnection connection; if (mtu > 0) { @@ -118,9 +114,6 @@ public Mono start(ConnectionAcceptor acceptor, int mtu) { acceptor.apply(connection).then(Mono.never()).subscribe(c.disposeSubscriber()); }) .bind() - .doOnNext( - disposableChannel -> - disposableChannel.channel().closeFuture().addListener(f -> group.close())) .map(CloseableChannel::new); } }