HBASE-25595 TestLruBlockCache.testBackgroundEvictionThread is flaky (#2974)
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
6414ef91d6
commit
3c9a7e01ed
|
@ -633,7 +633,7 @@ public class LruBlockCache implements FirstLevelBlockCache {
|
||||||
* Multi-threaded call to run the eviction process.
|
* Multi-threaded call to run the eviction process.
|
||||||
*/
|
*/
|
||||||
private void runEviction() {
|
private void runEviction() {
|
||||||
if (evictionThread == null) {
|
if (evictionThread == null || !evictionThread.isGo()) {
|
||||||
evict();
|
evict();
|
||||||
} else {
|
} else {
|
||||||
evictionThread.evict();
|
evictionThread.evict();
|
||||||
|
@ -947,6 +947,7 @@ public class LruBlockCache implements FirstLevelBlockCache {
|
||||||
}
|
}
|
||||||
LruBlockCache cache = this.cache.get();
|
LruBlockCache cache = this.cache.get();
|
||||||
if (cache == null) {
|
if (cache == null) {
|
||||||
|
this.go = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cache.evict();
|
cache.evict();
|
||||||
|
@ -966,6 +967,10 @@ public class LruBlockCache implements FirstLevelBlockCache {
|
||||||
this.notifyAll();
|
this.notifyAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isGo() {
|
||||||
|
return go;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used for the test.
|
* Used for the test.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue