[ https://issues.apache.org/jira/browse/HDFS-12881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16291102#comment-16291102 ]
Hudson commented on HDFS-12881: ------------------------------- SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #13375 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/13375/]) HDFS-12881. Output streams closed with IOUtils suppressing write errors. (jlowe: rev 80db744ee57c52a1dc306c576c663ccc76cced4c) * (edit) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/FSImageTestUtil.java * (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java * (edit) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java > Output streams closed with IOUtils suppressing write errors > ----------------------------------------------------------- > > Key: HDFS-12881 > URL: https://issues.apache.org/jira/browse/HDFS-12881 > Project: Hadoop HDFS > Issue Type: Bug > Reporter: Jason Lowe > Assignee: Ajay Kumar > Fix For: 3.1.0, 3.0.1 > > Attachments: HDFS-12881.001.patch, HDFS-12881.002.patch, > HDFS-12881.003.patch, HDFS-12881.004.patch > > > There are a few places in HDFS code that are closing an output stream with > IOUtils.cleanupWithLogger like this: > {code} > try { > ...write to outStream... > } finally { > IOUtils.cleanupWithLogger(LOG, outStream); > } > {code} > This suppresses any IOException that occurs during the close() method which > could lead to partial/corrupted output without throwing a corresponding > exception. The code should either use try-with-resources or explicitly close > the stream within the try block so the exception thrown during close() is > properly propagated as exceptions during write operations are. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org