lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1543078 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
Date Mon, 18 Nov 2013 16:47:02 GMT
Author: markrmiller
Date: Mon Nov 18 16:47:02 2013
New Revision: 1543078

URL: http://svn.apache.org/r1543078
Log:
SOLR-5460: SolrDispatchFilter#sendError can get a SolrCore that it does not close.

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1543078&r1=1543077&r2=1543078&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Mon Nov 18 16:47:02 2013
@@ -110,6 +110,9 @@ Bug Fixes
 
 * SOLR-5452: Do not attempt to proxy internal update requests. (Mark Miller)
 
+* SOLR-5460: SolrDispatchFilter#sendError can get a SolrCore that it does not 
+  close. (Mark Miller)
+
 Other Changes
 ---------------------
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java?rev=1543078&r1=1543077&r2=1543078&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java Mon
Nov 18 16:47:02 2013
@@ -722,6 +722,7 @@ public class SolrDispatchFilter implemen
       ServletRequest request, 
       HttpServletResponse response, 
       Throwable ex) throws IOException {
+    SolrCore localCore = null;
     try {
       SolrQueryResponse solrResp = new SolrQueryResponse();
       if(ex instanceof Exception) {
@@ -731,7 +732,9 @@ public class SolrDispatchFilter implemen
         solrResp.setException(new RuntimeException(ex));
       }
       if(core==null) {
-        core = cores.getCore(""); // default core
+        localCore = cores.getCore(""); // default core
+      } else {
+        localCore = core;
       }
       if(req==null) {
         final SolrParams solrParams;
@@ -751,6 +754,10 @@ public class SolrDispatchFilter implemen
       SimpleOrderedMap info = new SimpleOrderedMap();
       int code = ResponseUtils.getErrorInfo(ex, info, log);
       response.sendError( code, info.toString() );
+    } finally {
+      if (core == null && localCore != null) {
+        localCore.close();
+      }
     }
   }
 



Mime
View raw message