vigyasharma commented on code in PR #633:
URL: https://github.com/apache/lucene/pull/633#discussion_r862140381


##########
lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnDiskFull.java:
##########
@@ -352,15 +352,15 @@ public void testAddIndexOnDiskFull() throws IOException {
               done = true;
             }
 
-          } catch (IllegalStateException | IOException e) {
+          } catch (IllegalStateException | IOException | 
MergePolicy.MergeException e) {

Review Comment:
   If the merge threads triggered for addIndexes readers fail, they throw a 
merge exception, which is silently recorded in that OneMerge object. After all 
threads join, we check if merge passed on all threads, and if not, we rethrow 
this MergeException, to surface the actual cause of API failure. This is [done 
here](https://github.com/apache/lucene/pull/633/files/826116d47268714685ad42988ae5f9b66bac6673#diff-edbb11369e2e565210ea9761ee167ac0c6a39521c0e71f8af24f25f4092c740aR3224-R3229).
 If all threads passed, we proceed to register the new segmentinfo.
   
   `testAddIndexOnDiskFull()` simulates this by randomly filling up the disk 
and causing these merge threads to fail.
   



-- 
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: issues-unsubscr...@lucene.apache.org

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

Reply via email to