HBASE-15291 FileSystem not closed in secure bulkLoad (Yong Zhang)

This commit is contained in:
tedyu 2016-02-23 06:12:13 -08:00
parent cc45b4ab38
commit 49cb0cfccb
1 changed files with 10 additions and 0 deletions

View File

@ -291,6 +291,16 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService
new SecureBulkLoadListener(fs, bulkToken, conf));
} catch (Exception e) {
LOG.error("Failed to complete bulk load", e);
} finally {
if (fs != null) {
try {
if(!UserGroupInformation.getCurrentUser().equals(ugi)) {
FileSystem.closeAllForUGI(ugi);
}
} catch (IOException e) {
LOG.error("Failed to close FileSystem for " + ugi.getUserName(), e);
}
}
}
return false;
}