Skip to content

Commit 920d339

Browse files
committed
possible resource leak in InMemoryAliasMap
1 parent 2960d83 commit 920d339

File tree

1 file changed

+6
-3
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/aliasmap

1 file changed

+6
-3
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/aliasmap/InMemoryAliasMap.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,13 @@ private static File getCompressedAliasMap(File aliasMapDir)
330330
tOut = new TarArchiveOutputStream(gzOut);
331331
addFileToTarGzRecursively(tOut, aliasMapDir, "", new Configuration());
332332
} finally {
333-
if (tOut != null) {
334-
tOut.finish();
333+
try {
334+
if (tOut != null) {
335+
tOut.finish();
336+
}
337+
} finally {
338+
IOUtils.cleanupWithLogger(null, tOut, gzOut, bOut);
335339
}
336-
IOUtils.cleanupWithLogger(null, tOut, gzOut, bOut);
337340
}
338341
return outCompressedFile;
339342
}

0 commit comments

Comments
 (0)