[ https://issues.apache.org/jira/browse/ZOOKEEPER-2091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14244892#comment-14244892 ]
Camille Fournier commented on ZOOKEEPER-2091: --------------------------------------------- I agree [~hdeng] but I'm not sure what conclusion you're driving to. From my observation, we can do one of two obvious things: 1) Only change SendPacket, not doIO, which I *think* I agree should solve the observed problem with less impact than the current patch 2) Something more drastic to actually fix the hack that is our current Sasl hacks, which I don't have a patch to do and I'm not sure if we have any other open tickets that will resolve this. If we think solution 1 solves the issue, I think it is a simple enough fix to go ahead and use while we look into Netty etc. > Possible logic error in ClientCnxnSocketNIO > ------------------------------------------- > > Key: ZOOKEEPER-2091 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2091 > Project: ZooKeeper > Issue Type: Bug > Components: java client > Affects Versions: 3.4.6 > Reporter: Cheng > Assignee: Rakesh R > Fix For: 3.5.1 > > Attachments: ZOOKEEPER-2091.patch > > > When SASL authentication is enabled, the ZooKeeper client will finally call > ClientCnxnSocketNIO#sendPacket(Packet p) to send a packet to server: > @Override > void sendPacket(Packet p) throws IOException { > SocketChannel sock = (SocketChannel) sockKey.channel(); > if (sock == null) { > throw new IOException("Socket is null!"); > } > p.createBB(); > ByteBuffer pbb = p.bb; > sock.write(pbb); > } > One problem I can see is that the sock is non-blocking, so when the sock's > output buffer is full(theoretically), only part of the Packet is sent out and > the communication will break. -- This message was sent by Atlassian JIRA (v6.3.4#6332)