FAQ
Repository: hive
Updated Branches:
   refs/heads/master bef52661c -> c9b7d2538


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

Branch: refs/heads/master
Commit: c9b7d253853573339f54536a552d2564a7a2eadb
Parents: bef5266
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:20:00 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/c9b7d253/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 1688920..85a734c 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
@@ -299,7 +299,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;
@@ -316,7 +316,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/c9b7d253/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

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 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