Github user eolivelli commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/669#discussion_r226835891
--- 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 --
In almost of the project I know using Netty you are trying to use EPoll ig
available and then fallback to Nio.
I will be happy to create a JIRA and send a diff once we get this merged
---