zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robin <rchzz...@163.com>
Subject Possible logic error in ClientCnxnSocketNIO
Date Tue, 25 Nov 2014 01:10:38 GMT
When SASL authentication is enabled, the ZooKeeper client will finally call ClientCnxnSocketNIO#sendPacket(Packet
p) to send a packet to server:
void sendPacket(Packet p) throws IOException {
    SocketChannel sock = (SocketChannel) sockKey.channel();
    if (sock == null) {
        throw new IOException("Socket is null!");
    ByteBuffer pbb = p.bb;

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.

- Robin
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message