jimczi commented on code in PR #16883:
URL: https://github.com/apache/lucene/pull/16883#discussion_r4360247068
##########
lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99FlatVectorsReader.java:
##########
@@ -212,59 +211,40 @@ public void checkIntegrity(MergePolicy.OneMerge merge)
throws IOException {
@Override
public FlatVectorsReader getMergeInstance() throws IOException {
- if (mergeNeedsItsOwnMapping() == false) {
- return this;
- }
- IndexInput data = original.mergeVectorData();
- boolean success = false;
- try {
- FlatVectorsReader mergeInstance = new Lucene99FlatVectorsReader(this,
data.clone());
- success = true;
- return mergeInstance;
- } finally {
- if (success == false) {
- IOUtils.closeWhileHandlingException(original.release());
- }
- }
+ IndexInput data = original.sequentialVectorData();
+ return data == vectorData ? this : new Lucene99FlatVectorsReader(this,
data.clone());
Review Comment:
Actually I take that back, sorry. Closing the input closes its arena, so
every clone throws once it's closed anyway. Cloning under the lock only moves
the AlreadyClosedException from clone() to the first read, so I put it back the
way it was. Using a reader while it's being closed gives AlreadyClosedException
either way. The earlier race was different, it leaked an input, and that fix
stays.
--
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]