You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2016/03/10 20:20:07 UTC
lucene-solr git commit: SOLR-8135:
SolrCloudExampleTest.testLoadDocsIntoGettingStartedCollection reproducible
failure
Repository: lucene-solr
Updated Branches:
refs/heads/master d35d5694d -> 8cc978b53
SOLR-8135: SolrCloudExampleTest.testLoadDocsIntoGettingStartedCollection reproducible failure
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/8cc978b5
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8cc978b5
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8cc978b5
Branch: refs/heads/master
Commit: 8cc978b53b1299a27de492d7114cd2d4e353b6cb
Parents: d35d569
Author: Noble Paul <no...@apache.org>
Authored: Fri Mar 11 00:49:49 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Fri Mar 11 00:49:49 2016 +0530
----------------------------------------------------------------------
.../core/src/java/org/apache/solr/core/CoreContainer.java | 6 ++++--
solr/core/src/java/org/apache/solr/core/SolrCore.java | 10 +++++++---
.../src/java/org/apache/solr/update/SolrCoreState.java | 8 +++++++-
.../test/org/apache/solr/cloud/SolrCloudExampleTest.java | 1 -
4 files changed, 18 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8cc978b5/solr/core/src/java/org/apache/solr/core/CoreContainer.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
index 1d614e3..c140fb4 100644
--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java
+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
@@ -62,6 +62,7 @@ import org.apache.solr.security.AuthorizationPlugin;
import org.apache.solr.security.HttpClientInterceptorPlugin;
import org.apache.solr.security.PKIAuthenticationPlugin;
import org.apache.solr.security.SecurityPluginHolder;
+import org.apache.solr.update.SolrCoreState;
import org.apache.solr.update.UpdateShardHandler;
import org.apache.solr.util.DefaultSolrThreadFactory;
import org.apache.zookeeper.KeeperException;
@@ -916,8 +917,9 @@ public class CoreContainer {
log.info("Reloading SolrCore '{}' using configuration from {}", cd.getName(), coreConfig.getName());
SolrCore newCore = core.reload(coreConfig);
registerCore(name, newCore, false);
- }
- catch (Exception e) {
+ } catch (SolrCoreState.CoreIsClosedException e) {
+ throw e;
+ } catch (Exception e) {
coreInitFailures.put(cd.getName(), new CoreLoadFailure(cd, e));
throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to reload core [" + cd.getName() + "]", e);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8cc978b5/solr/core/src/java/org/apache/solr/core/SolrCore.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java
index cde878a..7a65a72 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java
@@ -534,8 +534,8 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
// Create the index if it doesn't exist.
if(!indexExists) {
- log.warn(logid+"Solr index directory '" + new File(indexDir) + "' doesn't exist."
- + " Creating new index...");
+ log.warn(logid + "Solr index directory '" + new File(indexDir) + "' doesn't exist."
+ + " Creating new index...");
SolrIndexWriter writer = SolrIndexWriter.create(this, "SolrCore.initIndex", indexDir, getDirectoryFactory(), true,
getLatestSchema(), solrConfig.indexConfig, solrDelPolicy, codec);
@@ -2501,7 +2501,11 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
checkStale(zkClient, solrConfigPath, overlayVersion) ||
checkStale(zkClient, managedSchmaResourcePath, managedSchemaVersion)) {
log.info("core reload {}", coreName);
- cc.reload(coreName);
+ try {
+ cc.reload(coreName);
+ } catch (SolrCoreState.CoreIsClosedException e) {
+ /*no problem this core is already closed*/
+ }
return;
}
//some files in conf directory may have other than managedschema, overlay, params
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8cc978b5/solr/core/src/java/org/apache/solr/update/SolrCoreState.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/SolrCoreState.java b/solr/core/src/java/org/apache/solr/update/SolrCoreState.java
index 42727b4..fc0bca8 100644
--- a/solr/core/src/java/org/apache/solr/update/SolrCoreState.java
+++ b/solr/core/src/java/org/apache/solr/update/SolrCoreState.java
@@ -51,7 +51,7 @@ public abstract class SolrCoreState {
public void increfSolrCoreState() {
synchronized (this) {
if (solrCoreStateRefCnt == 0) {
- throw new IllegalStateException("IndexWriter has been closed");
+ throw new CoreIsClosedException("IndexWriter has been closed");
}
solrCoreStateRefCnt++;
}
@@ -157,4 +157,10 @@ public abstract class SolrCoreState {
public abstract boolean getLastReplicateIndexSuccess();
public abstract void setLastReplicateIndexSuccess(boolean success);
+
+ public static class CoreIsClosedException extends IllegalStateException {
+ public CoreIsClosedException(String s) {
+ super(s);
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8cc978b5/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java b/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
index e889d90..f084c20 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SolrCloudExampleTest.java
@@ -43,7 +43,6 @@ import org.slf4j.LoggerFactory;
* this test is useful for catching regressions in indexing the example docs in collections that
* use data-driven schema and managed schema features provided by configsets/data_driven_schema_configs.
*/
-@LuceneTestCase.BadApple(bugUrl = "https://issues.apache.org/jira/browse/SOLR-8135")
public class SolrCloudExampleTest extends AbstractFullDistribZkTestBase {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());