apache / apache/lucene

AssertionError triggered in IndexWriter.filesExist [LUCENE-4699]

Open
#5,764 3 comments 0 reactions 0 assignees View on GitHub
affects-version:4.0 legacy-jira-priority:Major module:core/index type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Occasionally I get this AssertionError in my unit tests:

java.lang.AssertionError: file _0_Lucene40_0.tim does not exist
at org.apache.lucene.index.IndexWriter.filesExist(IndexWriter.java:3981)
at org.apache.lucene.index.IndexWriter.startCommit(IndexWriter.java:4047)
at org.apache.lucene.index.IndexWriter.prepareCommit(IndexWriter.java:2800)
at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:2875)
at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:2855)
at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:2839)

I'm not sure what's supposed to trigger this. To fix this I just rerun my tests and the error is gone.

I believe it's probably caused by something I'm doing wrong, but I was hoping to get some kind of declared exception and not an assertion error.

---
Migrated from [LUCENE-4699](https://issues.apache.org/jira/browse/LUCENE-4699) by Raimund Merkert

Contributor guide

Open the contributing guide

Research direction

Start with IndexWriter.filesExist and the commit path shown in the stack trace; reproduce the intermittent failure in the unit tests and inspect why _0_Lucene40_0.tim is missing. Compare the observed behavior with the requested declared exception, and document a reproducible trigger and expected handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.