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:36 UTC

[hbase] branch branch-2 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 branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


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

commit 13574de1569fe35d1e46aa1a54bdc7284d4cfcba
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 35f4ab9..d7f700a 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.
      */