hadoop-hdfs-issues mailing list archives

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

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

Kai Zheng commented on HDFS-12393:
----------------------------------

Thanks [~legend] for the ping.

Why {{Shorts.BYTES}} would make it accurate? Could you explain some bit? 
{code}
-    int totalLen = payloadLen + headerLen;
+    int totalLen = payloadLen + headerLen + Shorts.BYTES;
{code}
I noticed the following codes, not sure if you aware of it.
{code}
    // Make sure we have space for the whole packet, and
    // read it.
    reallocPacketBuf(PacketHeader.PKT_LENGTHS_LEN +
        dataPlusChecksumLen + headerLen);
...
  public static final int PKT_LENGTHS_LEN =
      Ints.BYTES + Shorts.BYTES;
{code}


> 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