NRT backend could hit AlreadyClosedException: this IndexReader is closed

Description

Under load this exception is possible:

1 2 3 4 5 6 7 8 9 org.apache.lucene.store.AlreadyClosedException: this IndexReader is closed at org.apache.lucene.index.IndexReader.ensureOpen(IndexReader.java:245) at org.apache.lucene.index.IndexReader.incRef(IndexReader.java:147) at org.hibernate.search.backend.impl.lucene.NRTWorkspaceImpl.openIndexReader(NRTWorkspaceImpl.java:215) at org.hibernate.search.reader.impl.MultiReaderFactory.openReader(MultiReaderFactory.java:49) at org.hibernate.search.query.engine.impl.HSQueryImpl.buildSearcher(HSQueryImpl.java:612) at org.hibernate.search.query.engine.impl.HSQueryImpl.buildSearcher(HSQueryImpl.java:511) at org.hibernate.search.query.engine.impl.HSQueryImpl.queryEntityInfos(HSQueryImpl.java:249) at org.hibernate.search.query.hibernate.impl.FullTextQueryImpl.list(FullTextQueryImpl.java:209)

Looks like a race condition in NRTWorkspaceImpl.

Environment

None

Status

Assignee

Sanne Grinovero

Reporter

Sanne Grinovero

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Priority

Major