You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2012/07/17 16:09:18 UTC

svn commit: r1362501 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java

Author: markrmiller
Date: Tue Jul 17 14:09:17 2012
New Revision: 1362501

URL: http://svn.apache.org/viewvc?rev=1362501&view=rev
Log:
SOLR-3621: release writer get lock in a finally

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java?rev=1362501&r1=1362500&r2=1362501&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/update/DefaultSolrCoreState.java Tue Jul 17 14:09:17 2012
@@ -92,16 +92,18 @@ public final class DefaultSolrCoreState 
         wait();
       } catch (InterruptedException e) {}
     }
-    
-    if (indexWriter != null) {
-      indexWriter.close();
+    try {
+      if (indexWriter != null) {
+        indexWriter.close();
+      }
+      indexWriter = createMainIndexWriter(core, "DirectUpdateHandler2", false,
+          true);
+      // we need to null this so it picks up the new writer next get call
+      refCntWriter = null;
+    } finally {
+      pauseWriter = false;
+      notifyAll();
     }
-    indexWriter = createMainIndexWriter(core, "DirectUpdateHandler2",
-        false, true);
-    // we need to null this so it picks up the new writer next get call
-    refCntWriter = null;
-    pauseWriter = false;
-    notifyAll();
   }
 
   @Override