You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2021/03/15 21:26:00 UTC

[hbase] branch master updated: HBASE-25595 TestLruBlockCache.testBackgroundEvictionThread is flaky (#2974)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 625bea3  HBASE-25595 TestLruBlockCache.testBackgroundEvictionThread is flaky (#2974)
625bea3 is described below

commit 625bea3eccc026efdc62e0c38b52b62b8cef3a42
Author: haxiaolin <li...@gmail.com>
AuthorDate: Tue Mar 16 05:25:38 2021 +0800

    HBASE-25595 TestLruBlockCache.testBackgroundEvictionThread is flaky (#2974)
    
    Signed-off-by: stack <st...@apache.org>
---
 .../main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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 bc0df43..3e5ba1d 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
@@ -628,7 +628,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();
@@ -942,6 +942,7 @@ public class LruBlockCache implements FirstLevelBlockCache {
         }
         LruBlockCache cache = this.cache.get();
         if (cache == null) {
+          this.go = false;
           break;
         }
         cache.evict();
@@ -961,6 +962,10 @@ public class LruBlockCache implements FirstLevelBlockCache {
       this.notifyAll();
     }
 
+    public boolean isGo() {
+      return go;
+    }
+
     /**
      * Used for the test.
      */