We're updating the issue view to help you get more done. 

Race conditions between shutdown of ScheduledCommitPolicy and close of IndexWriter

Description

The ScheduledCommitPolicyTest occasionally fails. I suspect it's a timing issue, but it needs to be investigated further.

java.lang.IllegalStateException: cannot close: prepareCommit was already called with no corresponding call to commit
at org.apache.lucene.index.IndexWriter.shutdown(IndexWriter.java:1068)
at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1123)
at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.closeIndexWriter(IndexWriterHolder.java:169)
at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.shutDownNow(AbstractWorkspaceImpl.java:103)
at org.hibernate.search.backend.impl.lucene.LuceneBackendResources.shutdown(LuceneBackendResources.java:115)
at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueProcessor.close(LuceneBackendQueueProcessor.java:70)
at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.destroy(DirectoryBasedIndexManager.java:78)
at org.hibernate.search.indexes.impl.IndexManagerHolder.stop(IndexManagerHolder.java:197)
at org.hibernate.search.engine.impl.ImmutableSearchFactory.close(ImmutableSearchFactory.java:225)
at org.hibernate.search.engine.impl.MutableSearchFactory.close(MutableSearchFactory.java:137)
at org.hibernate.search.testsupport.junit.SearchFactoryHolder.after(SearchFactoryHolder.java:85)

Environment

None

Status

Assignee

Sanne Grinovero

Reporter

Sanne Grinovero

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

5.5.0.Final

Priority

Major