apache / apache/lucene

DirectoryReader#close can throw AlreadyClosedException if it's and NRT reader [LUCENE-5351]

Open
#6,415 10 comments 0 reactions 1 assignee Claimed by @s1monw View on GitHub
affects-version:4.6 legacy-jira-fix-version:4.9 legacy-jira-fix-version:6.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

in StandartDirectoryReader#doClose we do this:

```
if (writer != null) {
// Since we just closed, writer may now be able to
// delete unused files:
writer.deletePendingFiles();
}
```

which can throw AlreadyClosedException from the directory if the Direcotory has already closed. To me this looks like a bug and we should catch this exception from the directory.

---
Migrated from [LUCENE-5351](https://issues.apache.org/jira/browse/LUCENE-5351) by Simon Willnauer (@s1monw), updated May 09 2016
Attachments: [LUCENE-5351.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-5351/LUCENE-5351.patch)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.