[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13475085#comment-13475085
 ] 

Eugene Koontz commented on ZOOKEEPER-1560:
------------------------------------------

It seems like in a particular iteration, 0 bytes is written:

{code}
localhost/127.0.0.1:11222, unexpected error, closing socket connection and 
attempting reconnect
     [exec]     [junit] java.io.IOException: Couldn't write 2000 bytes, 0 bytes 
written in this iteration and 77152 bytes written in total. Original limit: 
500074
     [exec]     [junit]         at 
org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:145)
     [exec]     [junit]         at 
org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:375)
     [exec]     [junit]         at 
org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
     [exec]     [junit] 2012-10-12 15:20:42,629 [myid:] - WARN  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11222:NIOServerCnxn@349] - caught end of 
stream exception
     [exec]     [junit] EndOfStreamException: Unable to read additional data 
from client sessionid 0x13a55902b650001, likely client has closed socket
     [exec]     [junit]         at 
org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220)
     [exec]     [junit]         at 
org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
     [exec]     [junit]         at java.lang.Thread.run(Thread.java:662)
     [exec]     [junit] 2012-10-12 15:20:42,630 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11222:NIOServerCnxn@1001] - Closed socket 
connection for client /127.0.0.1:57126 which had sessionid 0x13a55902b650001
{code}

Seems like there's a strange resemblance among all the test failures thus far: 
always fails after 77152 bytes written.
                
> Zookeeper client hangs on creation of large nodes
> -------------------------------------------------
>
>                 Key: ZOOKEEPER-1560
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1560
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: java client
>    Affects Versions: 3.4.4, 3.5.0
>            Reporter: Igor Motov
>            Assignee: Ted Yu
>             Fix For: 3.5.0, 3.4.5
>
>         Attachments: ZOOKEEPER-1560.patch, zookeeper-1560-v1.txt, 
> zookeeper-1560-v2.txt, zookeeper-1560-v3.txt, zookeeper-1560-v4.txt, 
> zookeeper-1560-v5.txt, zookeeper-1560-v6.txt
>
>
> To reproduce, try creating a node with 0.5M of data using java client. The 
> test will hang waiting for a response from the server. See the attached patch 
> for the test that reproduces the issue.
> It seems that ZOOKEEPER-1437 introduced a few issues to 
> {{ClientCnxnSocketNIO.doIO}} that prevent {{ClientCnxnSocketNIO}} from 
> sending large packets that require several invocations of 
> {{SocketChannel.write}} to complete. The first issue is that the call to 
> {{outgoingQueue.removeFirstOccurrence(p);}} removes the packet from the queue 
> even if the packet wasn't completely sent yet.  It looks to me that this call 
> should be moved under {{if (!pbb.hasRemaining())}} The second issue is that 
> {{p.createBB()}} is reinitializing {{ByteBuffer}} on every iteration, which 
> confuses {{SocketChannel.write}}. And the third issue is caused by extra 
> calls to {{cnxn.getXid()}} that increment xid on every iteration and confuse 
> the server.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to