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

Steve Loughran commented on HDFS-10277:
---------------------------------------

What's failing here is a file of size zero, with a {{read(new buf[0], 0, 0))}}

That is: it's returning -1, "no data", rather than 0 "you didn't ask for 
anything".

Fixing the code *and* clarifying the behaviour, based on that defined in 
`java.io.inputstream`: the check for zero remaining bytes comes ahead of the 
check for the end of file

> PositionedReadable test testReadFullyZeroByteFile failing in HDFS
> -----------------------------------------------------------------
>
>                 Key: HDFS-10277
>                 URL: https://issues.apache.org/jira/browse/HDFS-10277
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 2.8.0
>         Environment: Jenkins
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>
> Jenkins is failing after HADOOP-12994, 
> {{che.hadoop.fs.contract.AbstractContractSeekTest.testReadFullyZeroByteFile(AbstractContractSeekTest.java:373)}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to