muse-dev[bot] commented on a change in pull request #2153: URL: https://github.com/apache/lucene-solr/pull/2153#discussion_r551547661
########## File path: lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java ########## @@ -305,20 +298,25 @@ public synchronized boolean store(DataOutput output) throws IOException { @Override public synchronized boolean load(DataInput input) throws IOException { count = input.readVLong(); - this.higherWeightsCompletion = new FSTCompletion(new FST<>( - input, input, NoOutputs.getSingleton())); - this.normalCompletion = new FSTCompletion( - higherWeightsCompletion.getFST(), false, exactMatchFirst); + this.higherWeightsCompletion = + new FSTCompletion(new FST<>(input, input, NoOutputs.getSingleton())); + this.normalCompletion = + new FSTCompletion(higherWeightsCompletion.getFST(), false, exactMatchFirst); return true; } @Override public long ramBytesUsed() { - long mem = RamUsageEstimator.shallowSizeOf(this) + RamUsageEstimator.shallowSizeOf(normalCompletion) + RamUsageEstimator.shallowSizeOf(higherWeightsCompletion); + long mem = + RamUsageEstimator.shallowSizeOf(this) + + RamUsageEstimator.shallowSizeOf(normalCompletion) Review comment: *THREAD_SAFETY_VIOLATION:* Read/Write race. Non-private method `FSTCompletionLookup.ramBytesUsed()` reads without synchronization from `this.normalCompletion`. Potentially races with write in method `FSTCompletionLookup.load(...)`. Reporting because another access to the same memory occurs on a background thread, although this access may not. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org