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

Duo Zhang commented on HBASE-18081:
-----------------------------------

[~stack] We always use the dataLengthBuffer to read the first 4 bytes. And if 
we haven't read preamble yet, we will read two more bytes, it is version and 
authMethod. But the buffer to hold these two bytes is a local variable, which 
means if we only read 1 byte here, we will just return and this byte will be 
discarded. So the next readPreamble call will be broken.

Let me commit and resolve this.

Thanks.

> The way we process connection preamble in SimpleRpcServer is broken
> -------------------------------------------------------------------
>
>                 Key: HBASE-18081
>                 URL: https://issues.apache.org/jira/browse/HBASE-18081
>             Project: HBase
>          Issue Type: Bug
>          Components: IPC/RPC
>    Affects Versions: 2.0.0, 1.4.0, 1.3.1, 1.2.5, 1.1.10
>            Reporter: Duo Zhang
>            Assignee: Duo Zhang
>             Fix For: 2.0.0, 1.4.0, 1.2.6, 1.3.2, 1.1.11
>
>         Attachments: HBASE-18081-branch-1.2.patch, 
> HBASE-18081-branch-1.3.patch, HBASE-18081-branch-1.patch, HBASE-18081.patch, 
> HBASE-18081-testcase.patch
>
>
> Though very rare, but if the preamble is not sent at once, the logic will be 
> broken.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to