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


##########
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:
   As commented above, it'll be called even if something happens. I didn't want 
to move that notify out of the synchronized block because this would mean the 
need to re-acquire the lock?



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