You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by sy...@apache.org on 2016/02/27 00:09:26 UTC

[05/37] hbase git commit: HBASE-15291 FileSystem not closed in secure bulkLoad (Yong Zhang)

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

Branch: refs/heads/hbase-12439
Commit: 58283fa1b1b10beec62cefa40babff6a1424b06c
Parents: 3ba1a7f
Author: tedyu <yu...@gmail.com>
Authored: Tue Feb 23 06:11:39 2016 -0800
Committer: tedyu <yu...@gmail.com>
Committed: Tue Feb 23 06:11:39 2016 -0800

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/58283fa1/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..710ab44 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.getCurrentUser().equals(ugi)) {
+                  FileSystem.closeAllForUGI(ugi);
+                }
+              } catch (IOException e) {
+                LOG.error("Failed to close FileSystem for " + ugi.getUserName(), e);
+              }
+            }
           }
           return false;
         }