lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boris Petrov <>
Subject Race condition between IndexWriter.commit and IndexWriter.close
Date Thu, 29 Nov 2018 10:53:24 GMT
Hi all,

We're getting the following exception:

java.lang.IllegalStateException: cannot close: prepareCommit was already
called with no corresponding call to commit
    at org.apache.lucene.index.IndexWriter.shutdown(
    at org.apache.lucene.index.IndexWriter.close(

We are only calling "commit" on IndexWriter. By reading the code I can
see that if you call IndexWriter.commit in parallel to
IndexWriter.close, it is possible to get this exception. More
specifically, after setting "IndexWriter.pendingCommit" on line 4779
(this is using Lucene 7.5.0) and before setting it to "null" on line
4793 this problem could happen.

Is this by design or is it a bug?


Boris Petrov

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message