hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "legend (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HDFS-12393) Fix incorrect package length for doRead in PacketReceiver
Date Tue, 05 Sep 2017 12:27:00 GMT

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

legend edited comment on HDFS-12393 at 9/5/17 12:26 PM:
--------------------------------------------------------

Thanks [~drankye]  for review.
That's right, the allocated packet buffer size is correct.
But the check does not work. I think the {{totalLen}} indicates the size of the packet.

{code:java}
    // Sanity check the buffer size so we don't allocate too much memory
    // and OOME.
    int totalLen = payloadLen + headerLen;
    if (totalLen < 0 || totalLen > MAX_PACKET_SIZE) {
      throw new IOException("Incorrect value for packet payload size: " +
                            payloadLen);
    }
{code}

The package structure is as follows. 

{code:java}
    // Each packet looks like:
    //   PLEN    HLEN      HEADER     CHECKSUMS  DATA
    //   32-bit  16-bit   <protobuf>  <variable length>
{code}

So we should make sure that the check is an accurate check.


was (Author: legend):
Thanks [~drankye]  for review.
That's right, the allocated packet buffer size is correct.
But the check does not work. I think the {{totalLen }}indicates the size of the packet.
{quote}    // Sanity check the buffer size so we don't allocate too much memory
    // and OOME.
    int totalLen = payloadLen + headerLen;
    if (totalLen < 0 || totalLen > MAX_PACKET_SIZE) {
      throw new IOException("Incorrect value for packet payload size: " +
                            payloadLen);
    }{quote}
The package structure is as follows. 
{quote}    // Each packet looks like:
    //   PLEN    HLEN      HEADER     CHECKSUMS  DATA
    //   32-bit  16-bit   <protobuf>  <variable length>{quote}
So we should make sure that the check is an accurate check.

> Fix incorrect package length for doRead in PacketReceiver
> ---------------------------------------------------------
>
>                 Key: HDFS-12393
>                 URL: https://issues.apache.org/jira/browse/HDFS-12393
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs-client
>    Affects Versions: 3.0.0-alpha4
>            Reporter: legend
>            Assignee: legend
>              Labels: patch
>         Attachments: HDFS-12393.001.patch
>
>
> {{headerLen=length(HEADER)}}
> {{payloadLen=length(PLEN) + length(CHECKSUMS) + length(DATA)}}
> So {{totalLen = payloadLen + headerLen + length(HLEN)}}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message