You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by vi...@apache.org on 2018/03/23 23:56:05 UTC

[1/2] hive git commit: HIVE-18885 : DbNotificationListener has a deadlock between Java and DB locks

Repository: hive
Updated Branches:
  refs/heads/branch-2 d5c19a76a -> 32055ca4e


HIVE-18885 : DbNotificationListener has a deadlock between Java and DB locks


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

Branch: refs/heads/branch-2
Commit: d32adf51603dd23fe5727b4f1799199bf0e78104
Parents: d5c19a7
Author: Vihang Karajgaonkar <vi...@cloudera.com>
Authored: Thu Mar 22 22:48:49 2018 -0700
Committer: Vihang Karajgaonkar <vi...@cloudera.com>
Committed: Thu Mar 22 22:48:49 2018 -0700

----------------------------------------------------------------------
 .../listener/DbNotificationListener.java        | 29 ++++++++++----------
 1 file changed, 14 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/d32adf51/hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
----------------------------------------------------------------------
diff --git a/hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java b/hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
index 41347c2..1989a5e 100644
--- a/hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
+++ b/hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
@@ -83,8 +83,6 @@ public class DbNotificationListener extends MetaStoreEventListener {
   private static final Logger LOG = LoggerFactory.getLogger(DbNotificationListener.class.getName());
   private static CleanerThread cleaner = null;
 
-  private static final Object NOTIFICATION_TBL_LOCK = new Object();
-
   // This is the same object as super.conf, but it's convenient to keep a copy of it as a
   // HiveConf rather than a Configuration.
   private HiveConf hiveConf;
@@ -479,18 +477,14 @@ public class DbNotificationListener extends MetaStoreEventListener {
    */
   private void process(NotificationEvent event, ListenerEvent listenerEvent) throws MetaException {
     event.setMessageFormat(msgFactory.getMessageFormat());
-    synchronized (NOTIFICATION_TBL_LOCK) {
-      LOG.debug("DbNotificationListener: Processing : {}:{}", event.getEventId(),
-          event.getMessage());
-      HMSHandler.getMSForConf(hiveConf).addNotificationEvent(event);
-    }
+    LOG.debug("DbNotificationListener: Processing : {}:{}", event.getEventId(), event.getMessage());
+    HMSHandler.getMSForConf(hiveConf).addNotificationEvent(event);
 
-      // Set the DB_NOTIFICATION_EVENT_ID for future reference by other listeners.
-      if (event.isSetEventId()) {
-        listenerEvent.putParameter(
-            MetaStoreEventListenerConstants.DB_NOTIFICATION_EVENT_ID_KEY_NAME,
-            Long.toString(event.getEventId()));
-      }
+    // Set the DB_NOTIFICATION_EVENT_ID for future reference by other listeners.
+    if (event.isSetEventId()) {
+      listenerEvent.putParameter(MetaStoreEventListenerConstants.DB_NOTIFICATION_EVENT_ID_KEY_NAME,
+          Long.toString(event.getEventId()));
+    }
   }
 
   private static class CleanerThread extends Thread {
@@ -509,8 +503,13 @@ public class DbNotificationListener extends MetaStoreEventListener {
     @Override
     public void run() {
       while (true) {
-        synchronized(NOTIFICATION_TBL_LOCK) {
-          rs.cleanNotificationEvents(ttl);
+        synchronized (this) {
+          try {
+            rs.cleanNotificationEvents(ttl);
+          } catch (Exception ex) {
+            //catch exceptions so that this thread doesn't die
+            LOG.debug("Exception caught while cleaning notifications", ex);
+          }
         }
         LOG.debug("Cleaner thread done");
         try {


[2/2] hive git commit: HIVE-18863 : trunc() calls itself trunk() in an error message (Bharathkrishna Guruvayoor Murali, reviewed by Vihang Karajgaonkar)

Posted by vi...@apache.org.
HIVE-18863 : trunc() calls itself trunk() in an error message (Bharathkrishna Guruvayoor Murali, reviewed by Vihang Karajgaonkar)


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

Branch: refs/heads/branch-2
Commit: 32055ca4e7a98ae2efccdaf474e1aba2c41f3818
Parents: d32adf5
Author: Vihang Karajgaonkar <vi...@cloudera.com>
Authored: Fri Mar 23 16:48:00 2018 -0700
Committer: Vihang Karajgaonkar <vi...@cloudera.com>
Committed: Fri Mar 23 16:55:47 2018 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/32055ca4/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java
index d8368eb..25ebb6f 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java
@@ -259,7 +259,7 @@ public class GenericUDFTrunc extends GenericUDF {
         && PrimitiveObjectInspectorUtils
             .getPrimitiveGrouping(inputType2) != PrimitiveGrouping.VOID_GROUP) {
       throw new UDFArgumentTypeException(1,
-          "trunk() only takes STRING/CHAR/VARCHAR types as second argument, got " + inputType2);
+          "trunc() only takes STRING/CHAR/VARCHAR types as second argument, got " + inputType2);
     }
 
     inputType2 = PrimitiveCategory.STRING;