Github user ivmaykov commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/669#discussion_r233651445
--- Diff:
zookeeper-server/src/main/java/org/apache/zookeeper/server/NettyServerCnxnFactory.java
---
@@ -316,16 +251,17 @@ public void operationComplete(ChannelFuture future)
if (KeeperException.Code.OK !=
authProvider.handleAuthentication(cnxn, null))
{
LOG.error("Authentication failed for session 0x{}",
- Long.toHexString(cnxn.sessionId));
+ Long.toHexString(cnxn.getSessionId()));
cnxn.close();
return;
}
- allChannels.add(future.getChannel());
+ final Channel futureChannel = future.getNow();
--- End diff --
I think they are equivalent here since we know the future is completed (we
are inside a `if (future.isSuccess())` block). I can change it to `get()` if
you prefer.
---