jimczi commented on code in PR #16883:
URL: https://github.com/apache/lucene/pull/16883#discussion_r4350706725


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene90/compressing/Lucene90CompressingStoredFieldsReader.java:
##########
@@ -274,14 +271,16 @@ private void ensureOpen() throws AlreadyClosedException {
   @Override
   public void close() throws IOException {
     if (!closed) {
-      IOUtils.close(indexReader, fieldsStream, mergeFieldsStreamToClose());
+      IOUtils.close(indexReader, fieldsStream, 
sequentialFieldsStreamToClose());
       closed = true;
     }
   }
 
-  /** The mapping a merge opened, read under the lock that guards it, closed 
outside it. */
-  private synchronized IndexInput mergeFieldsStreamToClose() {
-    return original == this && mergeFieldsStream != fieldsStream ? 
mergeFieldsStream : null;
+  /** Returns the sequential input to close, if it is not {@code 
fieldsStream}. */
+  private synchronized IndexInput sequentialFieldsStreamToClose() {
+    return original == this && sequentialFieldsStream != fieldsStream
+        ? sequentialFieldsStream
+        : null;

Review Comment:
   Good catch, fixed. closed is now set under the same monitor that guards the 
sequential input, like in Lucene99FlatVectorsReader.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to