[
https://issues.apache.org/jira/browse/ZOOKEEPER-2227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14610863#comment-14610863
]
Chris Nauroth commented on ZOOKEEPER-2227:
------------------------------------------
See below for sample stack traces from both the NIO connection and the Netty
connection. I believe this has been broken since release 3.3.0 by the
ZOOKEEPER-572 patch. Prior to that patch, the code had been allocating an
8-byte buffer for reading the trace mask argument.
{code}
2015-06-30 16:03:03,723 [myid:] - WARN
[NIOWorkerThread-15:WorkerService$ScheduledWorkRequest@164] - Unexpected
exception
java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:498)
at java.nio.HeapByteBuffer.getLong(HeapByteBuffer.java:406)
at
org.apache.zookeeper.server.NIOServerCnxn.checkFourLetterWord(NIOServerCnxn.java:514)
at
org.apache.zookeeper.server.NIOServerCnxn.readLength(NIOServerCnxn.java:535)
at
org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:331)
at
org.apache.zookeeper.server.NIOServerCnxnFactory$IOWorkRequest.doWork(NIOServerCnxnFactory.java:530)
at
org.apache.zookeeper.server.WorkerService$ScheduledWorkRequest.run(WorkerService.java:162)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
{code}
{code}
2015-07-01 10:57:34,958 [myid:] - WARN [New I/O worker
#3:NettyServerCnxnFactory$CnxnChannelHandler@141] - Exception caught [id:
0xefdbe549, /0:0:0:0:0:0:0:1:50197 => /0:0:0:0:0:0:0:1:2181] EXCEPTION:
java.nio.BufferUnderflowException
java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:498)
at java.nio.HeapByteBuffer.getLong(HeapByteBuffer.java:406)
at
org.apache.zookeeper.server.NettyServerCnxn.checkFourLetterWord(NettyServerCnxn.java:285)
at
org.apache.zookeeper.server.NettyServerCnxn.receiveMessage(NettyServerCnxn.java:387)
at
org.apache.zookeeper.server.NettyServerCnxnFactory$CnxnChannelHandler.processMessage(NettyServerCnxnFactory.java:243)
at
org.apache.zookeeper.server.NettyServerCnxnFactory$CnxnChannelHandler.messageReceived(NettyServerCnxnFactory.java:165)
at
org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at
org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at
org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109)
at
org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
at
org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
{code}
> stmk four-letter word fails execution at server while reading trace mask
> argument.
> ----------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-2227
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2227
> Project: ZooKeeper
> Issue Type: Bug
> Components: server
> Affects Versions: 3.3.0
> Reporter: Chris Nauroth
> Assignee: Chris Nauroth
>
> When the server handles the {{stmk}} four-letter word, it attempts to read an
> 8-byte Java {{long}} from the request as the trace mask argument. The read
> fails, because the destination buffer's capacity is only 4 bytes.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)