SOLR-4421: On CoreContainer shutdown, all SolrCores should publish their state as DOWN.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1444249 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2013-02-08 21:44:40 +00:00
parent e729e57a8e
commit 806ab343c6
2 changed files with 18 additions and 0 deletions

View File

@ -146,6 +146,9 @@ Other Changes
* SOLR-4384: Make post.jar report timing information (Upayavira via janhoy) * SOLR-4384: Make post.jar report timing information (Upayavira via janhoy)
* SOLR-4421: On CoreContainer shutdown, all SolrCores should publish their
state as DOWN. (Mark Miller)
================== 4.1.0 ================== ================== 4.1.0 ==================
Versions of Major Components Versions of Major Components

View File

@ -743,6 +743,7 @@ public class CoreContainer
isShutDown = true; isShutDown = true;
if (isZooKeeperAware()) { if (isZooKeeperAware()) {
publishCoresAsDown();
cancelCoreRecoveries(); cancelCoreRecoveries();
} }
try { try {
@ -783,6 +784,20 @@ public class CoreContainer
} }
} }
private void publishCoresAsDown() {
synchronized (cores) {
for (SolrCore core : cores.values()) {
try {
zkController.publish(core.getCoreDescriptor(), ZkStateReader.DOWN);
} catch (KeeperException e) {
log.error("", e);
} catch (InterruptedException e) {
log.error("", e);
}
}
}
}
public void cancelCoreRecoveries() { public void cancelCoreRecoveries() {
ArrayList<SolrCoreState> coreStates = new ArrayList<SolrCoreState>(); ArrayList<SolrCoreState> coreStates = new ArrayList<SolrCoreState>();
synchronized (cores) { synchronized (cores) {