hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-15291 FileSystem not closed in secure bulkLoad (Yong Zhang)
Date Thu, 03 Mar 2016 23:59:40 GMT
Repository: hbase
Updated Branches:
  refs/heads/master f658f3ef8 -> 4fba1c362


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


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4fba1c36
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4fba1c36
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4fba1c36

Branch: refs/heads/master
Commit: 4fba1c36275710d9970066310489b927e5d194a1
Parents: f658f3e
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Mar 3 15:59:37 2016 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Thu Mar 3 15:59:37 2016 -0800

----------------------------------------------------------------------
 .../hbase/security/access/SecureBulkLoadEndpoint.java     | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/4fba1c36/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
----------------------------------------------------------------------
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 06a2298..c1f9251 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;
         }


Mime
View raw message