You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2015/04/18 06:43:58 UTC
svn commit: r1674444 - in /lucene/dev/branches/branch_5x: ./ solr/
solr/CHANGES.txt solr/core/
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
Author: shalin
Date: Sat Apr 18 04:43:57 2015
New Revision: 1674444
URL: http://svn.apache.org/r1674444
Log:
SOLR-6087: SolrIndexSearcher makes no DelegatingCollector.finish() call when IndexSearcher throws an expected exception. This closes #57.
Modified:
lucene/dev/branches/branch_5x/ (props changed)
lucene/dev/branches/branch_5x/solr/ (props changed)
lucene/dev/branches/branch_5x/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_5x/solr/core/ (props changed)
lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1674444&r1=1674443&r2=1674444&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Sat Apr 18 04:43:57 2015
@@ -73,6 +73,9 @@ Bug Fixes
* SOLR-7412: Fixed range.facet.other parameter for distributed requests.
(Will Miller, Tomás Fernándes Löbbe)
+* SOLR-6087: SolrIndexSearcher makes no DelegatingCollector.finish() call when IndexSearcher
+ throws an expected exception. (Christine Poerschke via shalin)
+
Optimizations
----------------------
Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java?rev=1674444&r1=1674443&r2=1674444&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java Sat Apr 18 04:43:57 2015
@@ -67,13 +67,13 @@ import org.apache.lucene.uninverting.Uni
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.FixedBitSet;
-import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
-import org.apache.solr.core.DirectoryFactory.DirContext;
import org.apache.solr.core.DirectoryFactory;
+import org.apache.solr.core.DirectoryFactory.DirContext;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.core.SolrCore;
import org.apache.solr.core.SolrInfoMBean;
@@ -197,16 +197,20 @@ public class SolrIndexSearcher extends I
postFilter.setLastDelegate(collector);
collector = postFilter;
}
-
+
try {
super.search(query, collector);
- if(collector instanceof DelegatingCollector) {
- ((DelegatingCollector)collector).finish();
+ } catch (TimeLimitingCollector.TimeExceededException | ExitableDirectoryReader.ExitingReaderException x) {
+ log.warn("Query: " + query + "; " + x.getMessage());
+ qr.setPartialResults(true);
+ } catch (EarlyTerminatingCollectorException etce) {
+ if (collector instanceof DelegatingCollector) {
+ ((DelegatingCollector) collector).finish();
}
+ throw etce;
}
- catch( TimeLimitingCollector.TimeExceededException | ExitableDirectoryReader.ExitingReaderException x ) {
- log.warn( "Query: " + query + "; " + x.getMessage() );
- qr.setPartialResults(true);
+ if (collector instanceof DelegatingCollector) {
+ ((DelegatingCollector) collector).finish();
}
}