tried to fix timeout and connection-lost problems when using an outside

solr.
pull/1/head
Michael Peter Christen 11 years ago
parent c3dcbdc8d5
commit a16534cb0a

@ -1091,7 +1091,7 @@ federated.service.solr.indexing.url = http://127.0.0.1:8983/solr
federated.service.solr.indexing.sharding = MODULO_HOST_MD5 federated.service.solr.indexing.sharding = MODULO_HOST_MD5
# the lazy attribute causes that fields containing "" or 0 are not added and not written # the lazy attribute causes that fields containing "" or 0 are not added and not written
federated.service.solr.indexing.lazy = true federated.service.solr.indexing.lazy = true
federated.service.solr.indexing.timeout = 6000 federated.service.solr.indexing.timeout = 60000
# temporary definition of backend services to use. # temporary definition of backend services to use.
# After the migration a rwi+solr combination is used, the solr contains the content of the previously used metadata-db. # After the migration a rwi+solr combination is used, the solr contains the content of the previously used metadata-db.

@ -127,6 +127,7 @@ public class RemoteInstance implements SolrInstance {
if (solraccount.length() > 0) { if (solraccount.length() > 0) {
org.apache.http.impl.conn.PoolingClientConnectionManager cm = new org.apache.http.impl.conn.PoolingClientConnectionManager(); // try also: ThreadSafeClientConnManager org.apache.http.impl.conn.PoolingClientConnectionManager cm = new org.apache.http.impl.conn.PoolingClientConnectionManager(); // try also: ThreadSafeClientConnManager
cm.setMaxTotal(100); cm.setMaxTotal(100);
cm.setDefaultMaxPerRoute(100);
this.client = new org.apache.http.impl.client.DefaultHttpClient(cm) { this.client = new org.apache.http.impl.client.DefaultHttpClient(cm) {
@Override @Override

@ -510,7 +510,7 @@ public final class Switchboard extends serverSwitch {
// set up the solr interface // set up the solr interface
final String solrurls = getConfig(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_URL, "http://127.0.0.1:8983/solr"); final String solrurls = getConfig(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_URL, "http://127.0.0.1:8983/solr");
final boolean usesolr = getConfigBool(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_ENABLED, false) & solrurls.length() > 0; final boolean usesolr = getConfigBool(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_ENABLED, false) & solrurls.length() > 0;
final int solrtimeout = getConfigInt(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_TIMEOUT, 10000); final int solrtimeout = getConfigInt(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_TIMEOUT, 60000);
if (usesolr && solrurls != null && solrurls.length() > 0) { if (usesolr && solrurls != null && solrurls.length() > 0) {
try { try {
@ -1333,7 +1333,7 @@ public final class Switchboard extends serverSwitch {
// set up the solr interface // set up the solr interface
final String solrurls = getConfig(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_URL, "http://127.0.0.1:8983/solr"); final String solrurls = getConfig(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_URL, "http://127.0.0.1:8983/solr");
final boolean usesolr = getConfigBool(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_ENABLED, false) & solrurls.length() > 0; final boolean usesolr = getConfigBool(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_ENABLED, false) & solrurls.length() > 0;
final int solrtimeout = getConfigInt(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_TIMEOUT, 10000); final int solrtimeout = getConfigInt(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_TIMEOUT, 60000);
if (usesolr && solrurls != null && solrurls.length() > 0) { if (usesolr && solrurls != null && solrurls.length() > 0) {
try { try {

Loading…
Cancel
Save