[ 
https://issues.apache.org/jira/browse/HADOOP-11371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gera Shegalov updated HADOOP-11371:
-----------------------------------
    Attachment: HADOOP-11371.001.patch

I added a regression test that would catch this problem. However, it turns out 
that java.io.BufferedReader#readLine() despite the javadoc not mentioning it 
OpenJDK actually [returns the incomplete line on 
EOF|http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/io/BufferedReader.java#317].

Not sure about whether we can rely on this with other JDK's. 

# This patch eliminates arrayCopies in Buffered for readLine. 
# We also don't need to use synchronized StringBuffer for errMsg because there 
is already a synchronization point via {{joinThread(errThread);}}.
# No need to feed extra line.separator.

 

> Shell#runCommand may miss output on stderr
> ------------------------------------------
>
>                 Key: HADOOP-11371
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11371
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Gera Shegalov
>         Attachments: HADOOP-11371.001.patch
>
>
> Shell#runCommand uses buffered reader to read complete lines. Hence, if the 
> output is not terminated by newline or the thread was interrupted before new 
> line was produced by the child process, this last portion is not consumed.



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

Reply via email to