s1monw commented on code in PR #12751: URL: https://github.com/apache/lucene/pull/12751#discussion_r1381800115
########## 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: not sure we are talking about the same thing. maybe do it like this: ```diff --- a/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java +++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java @@ -2560,13 +2560,15 @@ public class IndexWriter // 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; - - // So any "concurrently closing" threads wake up and see that the close has now completed: - notifyAll(); + try { + IOUtils.closeWhileHandlingException(readerPool, deleter, writeLock); + } finally { + writeLock = null; + closed = true; + closing = false; + // So any "concurrently closing" threads wake up and see that the close has now completed: + notifyAll(); + } } } catch (Throwable t) { throwable.addSuppressed(t); ``` -- 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