s1monw commented on code in PR #12751:
URL: https://github.com/apache/lucene/pull/12751#discussion_r1381543043


##########
lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:
##########
@@ -2560,10 +2560,15 @@ private void rollbackInternalNoCommit() throws 
IOException {
 
           // close all the closeables we can (but important is readerPool and 
writeLock to prevent
           // leaks)
-          IOUtils.closeWhileHandlingException(readerPool, deleter, writeLock);
-          writeLock = null;
-          closed = true;
-          closing = false;
+          try {
+            IOUtils.closeWhileHandlingException(readerPool, deleter, 
writeLock);
+          } catch (Throwable t) {
+            throwable.addSuppressed(t);
+          } finally {
+            writeLock = null;
+            closed = true;
+            closing = false;
+          }
 
           // So any "concurrently closing" threads wake up and see that the 
close has now completed:
           notifyAll();

Review Comment:
   IMO we should also notify all threads waiting on the monitor in the case of 
an exception.



##########
lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:
##########
@@ -2560,10 +2560,15 @@ private void rollbackInternalNoCommit() throws 
IOException {
 
           // close all the closeables we can (but important is readerPool and 
writeLock to prevent
           // leaks)
-          IOUtils.closeWhileHandlingException(readerPool, deleter, writeLock);
-          writeLock = null;
-          closed = true;
-          closing = false;
+          try {
+            IOUtils.closeWhileHandlingException(readerPool, deleter, 
writeLock);
+          } catch (Throwable t) {

Review Comment:
   I don't think we need that, it will be handled in block below?



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