FAQ
Repository: hive
Updated Branches:
   refs/heads/branch-1.2 f7f8183c6 -> 0f75119f2


HIVE-10925: Non-static threadlocals in metastore code can potentially cause memory leak (Vaibhav Gumashta reviewed by Sushanth Sowmyan, Alan Gates, Thejas Nair)


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

Branch: refs/heads/branch-1.2
Commit: 0f75119f214775b95f7b8697e3eeb230d7770449
Parents: f7f8183
Author: Vaibhav Gumashta <vgumashta@apache.org>
Authored: Thu Jun 4 16:20:00 2015 -0700
Committer: Vaibhav Gumashta <vgumashta@apache.org>
Committed: Thu Jun 4 16:21:06 2015 -0700

----------------------------------------------------------------------
  .../java/org/apache/hadoop/hive/metastore/HiveMetaStore.java | 4 ++--
  .../authorization/AuthorizationPreEventListener.java | 8 ++++----
  2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/0f75119f/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
index 08b5863..b85f192 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
@@ -303,7 +303,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {
            }
          };

- private final ThreadLocal<TxnHandler> threadLocalTxn = new ThreadLocal<TxnHandler>() {
+ private static final ThreadLocal<TxnHandler> threadLocalTxn = new ThreadLocal<TxnHandler>() {
        @Override
        protected synchronized TxnHandler initialValue() {
          return null;
@@ -320,7 +320,7 @@ public class HiveMetaStore extends ThriftHiveMetastore {

      // Thread local configuration is needed as many threads could make changes
      // to the conf using the connection hook
- private final ThreadLocal<Configuration> threadLocalConf =
+ private static final ThreadLocal<Configuration> threadLocalConf =
          new ThreadLocal<Configuration>() {
            @Override
            protected synchronized Configuration initialValue() {

http://git-wip-us.apache.org/repos/asf/hive/blob/0f75119f/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
index 63ba327..84f3f76 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/security/authorization/AuthorizationPreEventListener.java
@@ -68,14 +68,14 @@ public class AuthorizationPreEventListener extends MetaStorePreEventListener {
    public static final Log LOG = LogFactory.getLog(
        AuthorizationPreEventListener.class);

- private final ThreadLocal<Configuration> tConfig = new ThreadLocal<Configuration>() {
+ private static final ThreadLocal<Configuration> tConfig = new ThreadLocal<Configuration>() {
      @Override
      protected Configuration initialValue() {
        return new HiveConf(AuthorizationPreEventListener.class);
      }
    };

- private final ThreadLocal<HiveMetastoreAuthenticationProvider> tAuthenticator
+ private static final ThreadLocal<HiveMetastoreAuthenticationProvider> tAuthenticator
        = new ThreadLocal<HiveMetastoreAuthenticationProvider>() {
      @Override
      protected HiveMetastoreAuthenticationProvider initialValue() {
@@ -88,7 +88,7 @@ public class AuthorizationPreEventListener extends MetaStorePreEventListener {
      }
    };

- private final ThreadLocal<List<HiveMetastoreAuthorizationProvider>> tAuthorizers
+ private static final ThreadLocal<List<HiveMetastoreAuthorizationProvider>> tAuthorizers
        = new ThreadLocal<List<HiveMetastoreAuthorizationProvider>>() {
      @Override
      protected List<HiveMetastoreAuthorizationProvider> initialValue() {
@@ -101,7 +101,7 @@ public class AuthorizationPreEventListener extends MetaStorePreEventListener {
      }
    };

- private final ThreadLocal<Boolean> tConfigSetOnAuths = new ThreadLocal<Boolean>() {
+ private static final ThreadLocal<Boolean> tConfigSetOnAuths = new ThreadLocal<Boolean>() {
      @Override
      protected Boolean initialValue() {
        return false;

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupcommits @
categorieshive, hadoop
postedJun 4, '15 at 11:20p
activeJun 4, '15 at 11:21p
posts2
users1
websitehive.apache.org

1 user in discussion

Vgumashta: 2 posts

People

Translate

site design / logo © 2021 Grokbase