You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by go...@apache.org on 2019/03/25 16:17:47 UTC

[hive] 02/02: HIVE-21183: Interrupt wait time for FileCacheCleanupThread (Oliver Draese, reviewed by Gopal V)

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

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

commit c2796347fa5fcf524ba751e0b5b5aa19c65fd3c4
Author: Olli Draese <od...@cloudera.com>
AuthorDate: Mon Mar 25 09:17:08 2019 -0700

    HIVE-21183: Interrupt wait time for FileCacheCleanupThread (Oliver Draese, reviewed by Gopal V)
    
    Signed-off-by: Gopal V <go...@apache.org>
---
 .../org/apache/hadoop/hive/llap/cache/FileCacheCleanupThread.java    | 4 +++-
 .../org/apache/hadoop/hive/llap/cache/SerDeLowLevelCacheImpl.java    | 5 +++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/cache/FileCacheCleanupThread.java b/llap-server/src/java/org/apache/hadoop/hive/llap/cache/FileCacheCleanupThread.java
index 1835dad..af04f3b 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/cache/FileCacheCleanupThread.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/cache/FileCacheCleanupThread.java
@@ -38,7 +38,7 @@ abstract class FileCacheCleanupThread<T> extends Thread {
     this.newEvictions = newEvictions;
     this.approxCleanupIntervalSec = cleanupInterval;
     setDaemon(true);
-    setPriority(1);
+    setPriority(Thread.MIN_PRIORITY);
   }
 
   @Override
@@ -61,6 +61,8 @@ abstract class FileCacheCleanupThread<T> extends Thread {
     while (true) {
       int evictionsSinceLast = newEvictions.getAndSet(0);
       if (evictionsSinceLast > 0) break;
+
+      // will be notified by SerDeLowLevelCacheImpl or timeout eventually
       synchronized (newEvictions) {
         newEvictions.wait(10000);
       }
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/cache/SerDeLowLevelCacheImpl.java b/llap-server/src/java/org/apache/hadoop/hive/llap/cache/SerDeLowLevelCacheImpl.java
index a8f89ef..c41b34a 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/cache/SerDeLowLevelCacheImpl.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/cache/SerDeLowLevelCacheImpl.java
@@ -661,6 +661,11 @@ public class SerDeLowLevelCacheImpl implements BufferUsageManager, LlapIoDebugDu
 
   public final void notifyEvicted(MemoryBuffer buffer) {
     newEvictions.incrementAndGet();
+
+    // FileCacheCleanupThread might we waiting for eviction increment
+    synchronized(newEvictions) {
+      newEvictions.notifyAll();
+    }
   }
 
   private final class CleanupThread extends FileCacheCleanupThread<FileData> {