lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject lucene-solr:master: SOLR-12412: release IndexWriter after getting tragic exception
Date Tue, 10 Jul 2018 02:25:52 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master ad01baedb -> cd08c7ef1


SOLR-12412: release IndexWriter after getting tragic exception


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/cd08c7ef
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/cd08c7ef
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/cd08c7ef

Branch: refs/heads/master
Commit: cd08c7ef13613ceb88c1caf7b25e793ed51d47af
Parents: ad01bae
Author: Cao Manh Dat <datcm@apache.org>
Authored: Tue Jul 10 09:25:38 2018 +0700
Committer: Cao Manh Dat <datcm@apache.org>
Committed: Tue Jul 10 09:25:38 2018 +0700

----------------------------------------------------------------------
 solr/core/src/java/org/apache/solr/update/SolrCoreState.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cd08c7ef/solr/core/src/java/org/apache/solr/update/SolrCoreState.java
----------------------------------------------------------------------
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 64f6bc6..665db77 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<IndexWriter> ref = getIndexWriter(null);
     if (ref == null) return null;
-    return ref.get().getTragicException();
+    try {
+      return ref.get().getTragicException();
+    } finally {
+      ref.decref();
+    }
   }
 }


Mime
View raw message