Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
better solr query logging to detect unnecessary sort requests for more performance profiling
Michael Peter Christena0c53174c5a7
diff --git a/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java b/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.javaindex 231f52d92..f14964390 100644--- a/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java+++ b/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java@@ -200,8 +200,9 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo// during the solr query we set the thread name to the query string to get more debugging info in thread dumpsString q = req.getParams().get("q");String fq = req.getParams().get("fq");+ String sort = req.getParams().get("sor");String threadname = Thread.currentThread().getName();- if (q != null) Thread.currentThread().setName("solr query: q = " + q + (fq == null ? "" : ", fq = " + fq));+ if (q != null) Thread.currentThread().setName("solr query: q = " + q + (fq == null ? "" : ", fq = " + fq) + (sort == null ? "" : ", sort = " + sort)); // for debugging in ThreaddumpSolrQueryResponse rsp = new SolrQueryResponse();NamedList<Object> responseHeader = new SimpleOrderedMap<Object>();@@ -332,8 +333,14 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCopublic SolrDocumentList getDocumentListByParams(ModifiableSolrParams params) throws IOException, SolrException {SolrQueryRequest req = this.request(params);SolrQueryResponse response = null;+ String q = params.get("q");+ String fq = params.get("fq");+ String sort = params.get("sort");+ String threadname = Thread.currentThread().getName();try {+ if (q != null) Thread.currentThread().setName("solr query: q = " + q + (fq == null ? "" : ", fq = " + fq) + (sort == null ? "" : ", sort = " + sort)); // for debugging in Threaddumpresponse = this.query(req);+ if (q != null) Thread.currentThread().setName(threadname);if (response == null) throw new IOException("response == null");return SolrQueryResponse2SolrDocumentList(req, response);} finally {diff --git a/source/net/yacy/cora/federate/solr/connector/SolrServerConnector.java b/source/net/yacy/cora/federate/solr/connector/SolrServerConnector.javaindex 18b6eaa7b..398fd6dbe 100644--- a/source/net/yacy/cora/federate/solr/connector/SolrServerConnector.java+++ b/source/net/yacy/cora/federate/solr/connector/SolrServerConnector.java@@ -293,26 +293,26 @@ public abstract class SolrServerConnector extends AbstractSolrConnector implemen// during the solr query we set the thread name to the query string to get more debugging info in thread dumpsString q = params.get("q");String fq = params.get("fq");+ String sort = params.get("sort");String threadname = Thread.currentThread().getName();- if (q != null) Thread.currentThread().setName("solr query: q = " + q + (fq == null ? "" : ", fq = " + fq));QueryResponse rsp;- int retry = 100;+ int retry = 0;Throwable error = null;- while (retry-- > 0) {+ while (retry++ < 60) {try {+ if (q != null) Thread.currentThread().setName("solr query: q = " + q + (fq == null ? "" : ", fq = " + fq) + (sort == null ? "" : ", sort = " + sort) + "; retry = " + retry); // for debugging in Threaddumprsp = this.server.query(params);if (q != null) Thread.currentThread().setName(threadname);if (rsp != null) if (log.isFine()) log.fine(rsp.getResults().getNumFound() + " results for q=" + q);return rsp.getResults();} catch (final SolrServerException e) {error = e;- clearCaches(); // prevent further OOM if this was caused by OOM} catch (final Throwable e) {error = e;clearCaches(); // prevent further OOM if this was caused by OOM}ConcurrentLog.severe("SolrServerConnector", "Failed to query remote Solr: " + error.getMessage() + ", query:" + q + (fq == null ? "" : ", fq = " + fq));- try {Thread.sleep(100);} catch (InterruptedException e) {}+ try {Thread.sleep(1000);} catch (InterruptedException e) {}}throw new IOException("Error executing query", error);}