lucene-commits mailing list archives

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


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/0dc6ef99
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0dc6ef99
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0dc6ef99

Branch: refs/heads/branch_7x
Commit: 0dc6ef996eab378bdd8329153bdecddbf89af9ee
Parents: fa6a334
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:26:17 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/0dc6ef99/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