SOLR-12412: release IndexWriter after getting tragic exception

This commit is contained in:
Cao Manh Dat 2018-07-10 09:25:38 +07:00
parent ad01baedbf
commit cd08c7ef13
1 changed files with 5 additions and 1 deletions

View File

@ -197,6 +197,10 @@ public abstract class SolrCoreState {
public Throwable getTragicException() throws IOException {
RefCounted<IndexWriter> ref = getIndexWriter(null);
if (ref == null) return null;
return ref.get().getTragicException();
try {
return ref.get().getTragicException();
} finally {
ref.decref();
}
}
}