Github user eolivelli commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/669#discussion_r226681741 --- Diff: zookeeper-common/src/main/java/org/apache/zookeeper/ClientCnxnSocketNetty.java --- @@ -68,18 +70,21 @@ public class ClientCnxnSocketNetty extends ClientCnxnSocket { private static final Logger LOG = LoggerFactory.getLogger(ClientCnxnSocketNetty.class); - ChannelFactory channelFactory = new NioClientSocketChannelFactory( - Executors.newCachedThreadPool(), Executors.newCachedThreadPool()); - Channel channel; - CountDownLatch firstConnect; - ChannelFuture connectFuture; - Lock connectLock = new ReentrantLock(); - AtomicBoolean disconnected = new AtomicBoolean(); - AtomicBoolean needSasl = new AtomicBoolean(); - Semaphore waitSasl = new Semaphore(0); + private final EventLoopGroup eventLoopGroup; + private Channel channel; + private CountDownLatch firstConnect; + private ChannelFuture connectFuture; + private final Lock connectLock = new ReentrantLock(); + private final AtomicBoolean disconnected = new AtomicBoolean(); + private final AtomicBoolean needSasl = new AtomicBoolean(); + private final Semaphore waitSasl = new Semaphore(0); + + private static final AtomicReference<ByteBufAllocator> TEST_ALLOCATOR = + new AtomicReference<>(null); ClientCnxnSocketNetty(ZKClientConfig clientConfig) throws IOException { this.clientConfig = clientConfig; + eventLoopGroup = new NioEventLoopGroup(0, Executors.newCachedThreadPool()); --- End diff -- Let's move to Epoll. It can be a followup change (I can send of you don't have already it on your stack of changes)
---