diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java index 35f4ab90cd1..d7f700a4e26 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java @@ -633,7 +633,7 @@ public class LruBlockCache implements FirstLevelBlockCache { * Multi-threaded call to run the eviction process. */ private void runEviction() { - if (evictionThread == null) { + if (evictionThread == null || !evictionThread.isGo()) { evict(); } else { evictionThread.evict(); @@ -947,6 +947,7 @@ public class LruBlockCache implements FirstLevelBlockCache { } LruBlockCache cache = this.cache.get(); if (cache == null) { + this.go = false; break; } cache.evict(); @@ -966,6 +967,10 @@ public class LruBlockCache implements FirstLevelBlockCache { this.notifyAll(); } + public boolean isGo() { + return go; + } + /** * Used for the test. */