Grokbase Groups Hive commits May 2016
FAQ
HIVE-13729: FileSystem leaks in FileUtils.checkFileAccessWithImpersonation (Daniel Dai, reviewed by Thejas Nair)


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

Branch: refs/heads/branch-2.1
Commit: ffbd633fa448651e5c15c61826427537b31c160c
Parents: 2209cab
Author: Daniel Dai <daijy@hortonworks.com>
Authored: Wed May 25 21:44:54 2016 -0700
Committer: Daniel Dai <daijy@hortonworks.com>
Committed: Thu May 26 09:52:00 2016 -0700

----------------------------------------------------------------------
  .../apache/hadoop/hive/common/FileUtils.java | 20 ++++++++++++--------
  1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/ffbd633f/common/src/java/org/apache/hadoop/hive/common/FileUtils.java
----------------------------------------------------------------------
diff --git a/common/src/java/org/apache/hadoop/hive/common/FileUtils.java b/common/src/java/org/apache/hadoop/hive/common/FileUtils.java
index 5cf4d39..d755798 100644
--- a/common/src/java/org/apache/hadoop/hive/common/FileUtils.java
+++ b/common/src/java/org/apache/hadoop/hive/common/FileUtils.java
@@ -387,14 +387,18 @@ public final class FileUtils {
      // Otherwise, try user impersonation. Current user must be configured to do user impersonation.
      UserGroupInformation proxyUser = UserGroupInformation.createProxyUser(
          user, UserGroupInformation.getLoginUser());
- proxyUser.doAs(new PrivilegedExceptionAction<Object>() {
- @Override
- public Object run() throws Exception {
- FileSystem fsAsUser = FileSystem.get(fs.getUri(), fs.getConf());
- ShimLoader.getHadoopShims().checkFileAccess(fsAsUser, stat, action);
- return null;
- }
- });
+ try {
+ proxyUser.doAs(new PrivilegedExceptionAction<Object>() {
+ @Override
+ public Object run() throws Exception {
+ FileSystem fsAsUser = FileSystem.get(fs.getUri(), fs.getConf());
+ ShimLoader.getHadoopShims().checkFileAccess(fsAsUser, stat, action);
+ return null;
+ }
+ });
+ } finally {
+ FileSystem.closeAllForUGI(proxyUser);
+ }
    }

    /**

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 6 | next ›
Discussion Overview
groupcommits @
categorieshive, hadoop
postedMay 25, '16 at 10:54p
activeMay 26, '16 at 4:52p
posts6
users1
websitehive.apache.org

1 user in discussion

Daijy: 6 posts

People

Translate

site design / logo © 2021 Grokbase