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 2013/04/16 14:27:52 UTC
svn commit: r1468393 - in /lucene/dev/branches/branch_4x: ./ solr/
solr/core/ solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java
Author: shalin
Date: Tue Apr 16 12:27:52 2013
New Revision: 1468393
URL: http://svn.apache.org/r1468393
Log:
SOLR-3755: Reverting r1467855 because it can mask timeout related problems in ChaosMonkeyShardSplitTest. Increasing read timeouts instead.
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/solr/ (props changed)
lucene/dev/branches/branch_4x/solr/core/ (props changed)
lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java
Modified: lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java?rev=1468393&r1=1468392&r2=1468393&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ShardSplitTest.java Tue Apr 16 12:27:52 2013
@@ -19,6 +19,7 @@ package org.apache.solr.cloud;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrRequest;
+import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.apache.solr.client.solrj.request.QueryRequest;
@@ -197,29 +198,15 @@ public class ShardSplitTest extends Basi
}
protected void indexAndUpdateCount(List<DocRouter.Range> ranges, int[] docCounts, int id) throws Exception {
- boolean success = true;
- try {
- indexr("id", id);
- } catch (SolrServerException e) {
- if (!e.getMessage().startsWith("No live SolrServers available to handle this request")) {
- success = false;
- log.error("Exception while adding doc", e);
- } else {
- // Error is recoverable because the proxy node will store the request in its log and
- // it will be retried later and sent to the leader
- log.warn("Counting doc: " + id + " because error is recoverable", e);
- }
- } finally {
- if (success) {
- // todo - hook in custom hashing
- byte[] bytes = String.valueOf(id).getBytes("UTF-8");
- int hash = Hash.murmurhash3_x86_32(bytes, 0, bytes.length, 0);
- for (int i = 0; i < ranges.size(); i++) {
- DocRouter.Range range = ranges.get(i);
- if (range.includes(hash))
- docCounts[i]++;
- }
- }
+ indexr("id", id);
+
+ // todo - hook in custom hashing
+ byte[] bytes = String.valueOf(id).getBytes("UTF-8");
+ int hash = Hash.murmurhash3_x86_32(bytes, 0, bytes.length, 0);
+ for (int i = 0; i < ranges.size(); i++) {
+ DocRouter.Range range = ranges.get(i);
+ if (range.includes(hash))
+ docCounts[i]++;
}
}
@@ -255,5 +242,19 @@ public class ShardSplitTest extends Basi
}
}
}
+
+ @Override
+ protected SolrServer createNewSolrServer(String collection, String baseUrl) {
+ HttpSolrServer server = (HttpSolrServer) super.createNewSolrServer(collection, baseUrl);
+ server.setSoTimeout(5 * 60 * 1000);
+ return server;
+ }
+
+ @Override
+ protected SolrServer createNewSolrServer(int port) {
+ HttpSolrServer server = (HttpSolrServer) super.createNewSolrServer(port);
+ server.setSoTimeout(5 * 60 * 1000);
+ return server;
+ }
}