Skip to content

Commit

Permalink
Fix possible assertion failure in IndicesQueryCache.close (#38714)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
droberts195 authored Feb 11, 2019
1 parent f3cfb66 commit 6871f14
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ QueryCacheStats toQueryCacheStats() {
}

private static class StatsAndCount {
int count;
volatile int count;
final Stats stats;

StatsAndCount(Stats stats) {
Expand Down

0 comments on commit 6871f14

Please sign in to comment.