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

Arshad Mohammad commented on ZOOKEEPER-2227:
--------------------------------------------

Thanks [~cnauroth] for the patch. Here is one review comment.
To trace all the log level mask value is 1022
{code}
long ALL = CLIENT_REQUEST_TRACE_MASK | CLIENT_DATA_PACKET_TRACE_MASK
                | CLIENT_PING_TRACE_MASK | SERVER_PACKET_TRACE_MASK
                | 
SESSION_TRACE_MASK|EVENT_DELIVERY_TRACE_MASK|SERVER_PING_TRACE_MASK|WARNING_TRACE_MASK|JMX_TRACE_MASK;
{code}
After applying your patch, when this mask is set netcat using {{echo stmk 
1022|netcat host port}}, {{java.nio.BufferUnderflowException}} exception is 
thrown.
This happens because " 1022" is not serialized to 8 bytes but actually 5 bytes. 
So can you make it work even in this scenario by reading the number of bytes 
available




> 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
>         Attachments: ZOOKEEPER-2227.001.patch, ZOOKEEPER-2227.002.patch
>
>
> 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)

Reply via email to