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:01:17 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 77c3c61b3 -> b3c62680b


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

Branch: refs/heads/branch-1
Commit: b3c62680bcf93ebab7df9914ff8ca2d28cda3156
Parents: 77c3c61
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Mar 3 16:01:15 2016 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Thu Mar 3 16:01:15 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/b3c62680/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 6c92a66..c656898 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