You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/02/19 05:54:51 UTC

[GitHub] [lucene-solr] zacharymorn opened a new pull request #2404: LUCENE-9639: Add unit tests for SimpleTextVector format

zacharymorn opened a new pull request #2404:
URL: https://github.com/apache/lucene-solr/pull/2404


   # Description
   
   Added unit tests for SimpleTextVector format, and made a few changes in SimpleTextVectorReader and SimpleTextVectorWriter to pass the tests 
   
   # Solution
   
   Added unit tests for SimpleTextVector format by extending BaseVectorFormatTestCase
   
   # Tests
   
   * Added unit tests for SimpleTextVector format by extending BaseVectorFormatTestCase
   * Tests passed but the nocommit comment is currently failing pre-commit
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request title.
   - [x] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [x] I have developed this patch against the `master` branch.
   - [x] I have run `./gradlew check`.
   - [x] I have added tests for my changes.
   - [ ] I have added documentation for the [Ref Guide](https://github.com/apache/lucene-solr/tree/master/solr/solr-ref-guide) (for Solr changes only).
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] msokolov commented on a change in pull request #2404: LUCENE-9639: Add unit tests for SimpleTextVector format

Posted by GitBox <gi...@apache.org>.
msokolov commented on a change in pull request #2404:
URL: https://github.com/apache/lucene-solr/pull/2404#discussion_r580512737



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90VectorReader.java
##########
@@ -120,6 +120,7 @@ private static IndexInput openDataInput(
 
     String fileName =
         IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, fileExtension);
+    // nocommit should the openInput call be put in try-finally as well for IOException handling?

Review comment:
       I think it's OK - the exception handling got moved to the outer scope in the PR I referenced above

##########
File path: lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextVectorReader.java
##########
@@ -93,22 +94,35 @@
             readState.segmentInfo.name,
             readState.segmentSuffix,
             SimpleTextVectorFormat.VECTOR_EXTENSION);
-    dataIn = readState.directory.openInput(vectorFileName, IOContext.DEFAULT);
+
+    boolean success = false;

Review comment:
       I'm concerned this might lead to test fails (and theoretically production issues) caused by exceptions raised during this constructor leading to an inconsistent state. See https://github.com/apache/lucene-solr/commit/4cdfbbb95be1b25adb839ee8d1fe61052a53a4a3 where opening the two index files were both pushed under the same exception handler.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] msokolov merged pull request #2404: LUCENE-9639: Add unit tests for SimpleTextVector format

Posted by GitBox <gi...@apache.org>.
msokolov merged pull request #2404:
URL: https://github.com/apache/lucene-solr/pull/2404


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] zacharymorn commented on pull request #2404: LUCENE-9639: Add unit tests for SimpleTextVector format

Posted by GitBox <gi...@apache.org>.
zacharymorn commented on pull request #2404:
URL: https://github.com/apache/lucene-solr/pull/2404#issuecomment-783852145


   > Thanks for the PR! I just have one comment about exception handling, otherwise looks good
   
   Thanks Michael for the review! I've pushed an update to improve on the exception handling like you suggested. Please let me know if it looks good to you.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] zacharymorn commented on a change in pull request #2404: LUCENE-9639: Add unit tests for SimpleTextVector format

Posted by GitBox <gi...@apache.org>.
zacharymorn commented on a change in pull request #2404:
URL: https://github.com/apache/lucene-solr/pull/2404#discussion_r580741603



##########
File path: lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextVectorReader.java
##########
@@ -93,22 +94,35 @@
             readState.segmentInfo.name,
             readState.segmentSuffix,
             SimpleTextVectorFormat.VECTOR_EXTENSION);
-    dataIn = readState.directory.openInput(vectorFileName, IOContext.DEFAULT);
+
+    boolean success = false;

Review comment:
       Makes sense. I've extended the try-finally block to contain meta file input as well.

##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90VectorReader.java
##########
@@ -120,6 +120,7 @@ private static IndexInput openDataInput(
 
     String fileName =
         IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, fileExtension);
+    // nocommit should the openInput call be put in try-finally as well for IOException handling?

Review comment:
       Sounds good. I have removed the nocommit.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org