YARN-3760. FSDataOutputStream leak in AggregatedLogFormat.LogWriter.close(). Contributed by Haibo Chen.
(cherry picked from commit c26ccf1adb3a72df3f68e1150b86b813c691203a)
This commit is contained in:
parent
a7312715a6
commit
9d9087a67a
|
@ -541,14 +541,15 @@ public class AggregatedLogFormat {
|
|||
|
||||
@Override
|
||||
public void close() {
|
||||
if (writer != null) {
|
||||
try {
|
||||
try {
|
||||
if (writer != null) {
|
||||
writer.close();
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Exception closing writer", e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Exception closing writer", e);
|
||||
} finally {
|
||||
IOUtils.closeStream(this.fsDataOStream);
|
||||
}
|
||||
IOUtils.closeStream(fsDataOStream);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue