lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Race condition between IndexWriter.commit and IndexWriter.close
Date Sat, 01 Dec 2018 16:25:29 GMT
I think if you call commit and close concurrently the results are undefined
and so this is acceptable.

Mike

On Thu, Nov 29, 2018 at 5:53 AM Boris Petrov <boris@profuzdigital.com>
wrote:

> 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(IndexWriter.java:1025)
>     at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1078)
>     ...
>
> 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?
>
> Thanks,
>
> Boris Petrov
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
> --
Mike McCandless

http://blog.mikemccandless.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message