From 4fba1c36275710d9970066310489b927e5d194a1 Mon Sep 17 00:00:00 2001 From: tedyu Date: Thu, 3 Mar 2016 15:59:37 -0800 Subject: [PATCH] HBASE-15291 FileSystem not closed in secure bulkLoad (Yong Zhang) --- .../hbase/security/access/SecureBulkLoadEndpoint.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java index 06a2298cfd3..c1f9251d715 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java @@ -292,6 +292,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.getLoginUser().equals(ugi)) { + FileSystem.closeAllForUGI(ugi); + } + } catch (IOException e) { + LOG.error("Failed to close FileSystem for " + ugi.getUserName(), e); + } + } } return false; }