HADOOP-14942. DistCp#cleanup() should check whether jobFS is null.

Contributed by Andras Bokor.
This commit is contained in:
Steve Loughran 2017-10-20 22:27:04 +01:00
parent 480187aebb
commit f36cbc8475

View File

@ -453,10 +453,12 @@ private static Configuration getDefaultConf() {
private synchronized void cleanup() {
try {
if (metaFolder == null) return;
jobFS.delete(metaFolder, true);
metaFolder = null;
if (metaFolder != null) {
if (jobFS != null) {
jobFS.delete(metaFolder, true);
}
metaFolder = null;
}
} catch (IOException e) {
LOG.error("Unable to cleanup meta folder: " + metaFolder, e);
}