You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Jason Lowe (JIRA)" <ji...@apache.org> on 2017/12/01 15:30:03 UTC
[jira] [Created] (HADOOP-15085) Output streams closed with IOUtils
suppressing write errors
Jason Lowe created HADOOP-15085:
-----------------------------------
Summary: Output streams closed with IOUtils suppressing write errors
Key: HADOOP-15085
URL: https://issues.apache.org/jira/browse/HADOOP-15085
Project: Hadoop Common
Issue Type: Bug
Reporter: Jason Lowe
There are a few places in hadoop-common 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: common-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-dev-help@hadoop.apache.org