diff --git a/solr/core/src/java/org/apache/solr/update/SolrCoreState.java b/solr/core/src/java/org/apache/solr/update/SolrCoreState.java index 64f6bc6b76b..665db776913 100644 --- a/solr/core/src/java/org/apache/solr/update/SolrCoreState.java +++ b/solr/core/src/java/org/apache/solr/update/SolrCoreState.java @@ -197,6 +197,10 @@ public abstract class SolrCoreState { public Throwable getTragicException() throws IOException { RefCounted ref = getIndexWriter(null); if (ref == null) return null; - return ref.get().getTragicException(); + try { + return ref.get().getTragicException(); + } finally { + ref.decref(); + } } }