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 Fri, 04 Mar 2016 00:02:51 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 dc4bdb992 -> 105fd0865


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/105fd086
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/105fd086
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/105fd086

Branch: refs/heads/branch-1.2
Commit: 105fd08651eeb664f615253790fbe9595d00d387
Parents: dc4bdb9
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Mar 3 16:02:47 2016 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Thu Mar 3 16:02:47 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/105fd086/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 ab27cfc..5d9a506 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
@@ -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.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