You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by sz...@apache.org on 2019/08/06 12:48:11 UTC

[hive] branch master updated: HIVE-22037: HS2 should log when shutting down due to OOM (Barnabas Maidics, reviewed by Adam Szita)

This is an automated email from the ASF dual-hosted git repository.

szita pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 5737095  HIVE-22037: HS2 should log when shutting down due to OOM (Barnabas Maidics, reviewed by Adam Szita)
5737095 is described below

commit 5737095ba83fe2d1e01fbee79cf897e942905936
Author: Barnabas Maidics <b....@gmail.com>
AuthorDate: Tue Aug 6 14:45:54 2019 +0200

    HIVE-22037: HS2 should log when shutting down due to OOM (Barnabas Maidics, reviewed by Adam Szita)
---
 .../hive/service/cli/thrift/ThreadPoolExecutorWithOomHook.java      | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/service/src/java/org/apache/hive/service/cli/thrift/ThreadPoolExecutorWithOomHook.java b/service/src/java/org/apache/hive/service/cli/thrift/ThreadPoolExecutorWithOomHook.java
index 1d24262..1294136 100644
--- a/service/src/java/org/apache/hive/service/cli/thrift/ThreadPoolExecutorWithOomHook.java
+++ b/service/src/java/org/apache/hive/service/cli/thrift/ThreadPoolExecutorWithOomHook.java
@@ -17,6 +17,8 @@
  */
 package org.apache.hive.service.cli.thrift;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.Future;
 import java.util.concurrent.ThreadFactory;
@@ -24,6 +26,9 @@ import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
 final class ThreadPoolExecutorWithOomHook extends ThreadPoolExecutor {
+
+  public static final Logger LOG = LoggerFactory.getLogger(ThreadPoolExecutorWithOomHook.class.getName());
+
   private final Runnable oomHook;
 
   public ThreadPoolExecutorWithOomHook(int corePoolSize, int maximumPoolSize, long keepAliveTime,
@@ -49,6 +54,7 @@ final class ThreadPoolExecutorWithOomHook extends ThreadPoolExecutor {
       }
     }
     if (t instanceof OutOfMemoryError) {
+      LOG.error("Stopping HiveServer2 due to OOM", t);
       oomHook.run();
     }
   }