Fix possible assertion failure in IndicesQueryCache.close (#38731)
The assertion that the stats2 map is empty in IndicesQueryCache.close has been observed to fail very occasionally in internal cluster tests. The likely cause is a cross-thread visibility problem for a count variable. This change makes that count volatile. Relates #37117 Backport of #38714
This commit is contained in:
parent
dc212de822
commit
d1848b96fc
|
@ -206,7 +206,7 @@ public class IndicesQueryCache implements QueryCache, Closeable {
|
|||
}
|
||||
|
||||
private static class StatsAndCount {
|
||||
int count;
|
||||
volatile int count;
|
||||
final Stats stats;
|
||||
|
||||
StatsAndCount(Stats stats) {
|
||||
|
|
Loading…
Reference in New Issue