diff --git a/htroot/gsa/searchresult.java b/htroot/gsa/searchresult.java index 9a2450260..0aa56eb0f 100644 --- a/htroot/gsa/searchresult.java +++ b/htroot/gsa/searchresult.java @@ -44,6 +44,7 @@ import net.yacy.server.serverSwitch; import org.apache.solr.common.SolrException; import org.apache.solr.common.params.CommonParams; import org.apache.solr.request.SolrQueryRequest; +import org.apache.solr.request.SolrRequestInfo; import org.apache.solr.response.ResultContext; import org.apache.solr.response.SolrQueryResponse; import org.apache.solr.util.FastWriter; @@ -189,6 +190,8 @@ public class searchresult { if (response != null) e = response.getException(); if (e != null) { Log.logException(e); + if (req != null) req.close(); + SolrRequestInfo.clearRequestInfo(); return null; } @@ -211,6 +214,7 @@ public class searchresult { } catch (IOException e1) { } finally { req.close(); + SolrRequestInfo.clearRequestInfo(); try {ow.close();} catch (IOException e1) {} } @@ -221,4 +225,4 @@ public class searchresult { } return null; } -} \ No newline at end of file +} diff --git a/htroot/solr/select.java b/htroot/solr/select.java index a753c60e7..72a06cc5c 100644 --- a/htroot/solr/select.java +++ b/htroot/solr/select.java @@ -58,6 +58,7 @@ import org.apache.solr.common.params.SolrParams; import org.apache.solr.common.util.NamedList; import org.apache.solr.core.SolrCore; import org.apache.solr.request.SolrQueryRequest; +import org.apache.solr.request.SolrRequestInfo; import org.apache.solr.response.QueryResponseWriter; import org.apache.solr.response.ResultContext; import org.apache.solr.response.SolrQueryResponse; @@ -222,6 +223,8 @@ public class select { if (response != null) e = response.getException(); if (e != null) { Log.logException(e); + if (req != null) req.close(); + SolrRequestInfo.clearRequestInfo(); return null; } @@ -233,6 +236,7 @@ public class select { } catch (IOException e1) { } finally { req.close(); + SolrRequestInfo.clearRequestInfo(); try {ow.close();} catch (IOException e1) {} }