mirror of https://github.com/apache/lucene.git
SOLR-10365: Handle a SolrCoreInitializationException while publishing core state during SolrCore creation
This commit is contained in:
parent
acbe2a5981
commit
1d550b8b35
|
@ -164,6 +164,9 @@ Other Changes
|
||||||
|
|
||||||
* SOLR-10343: Update Solr default/example and test configs to use SynonymGraphFilterFactory. (Steve Rowe)
|
* SOLR-10343: Update Solr default/example and test configs to use SynonymGraphFilterFactory. (Steve Rowe)
|
||||||
|
|
||||||
|
* SOLR-10365: Handle a SolrCoreInitializationException while publishing core state during SolrCore creation
|
||||||
|
(Ishan Chattopadhyaya)
|
||||||
|
|
||||||
================== 6.5.0 ==================
|
================== 6.5.0 ==================
|
||||||
|
|
||||||
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
|
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
|
||||||
|
|
|
@ -85,6 +85,7 @@ import org.apache.solr.core.CloudConfig;
|
||||||
import org.apache.solr.core.CoreContainer;
|
import org.apache.solr.core.CoreContainer;
|
||||||
import org.apache.solr.core.CoreDescriptor;
|
import org.apache.solr.core.CoreDescriptor;
|
||||||
import org.apache.solr.core.SolrCore;
|
import org.apache.solr.core.SolrCore;
|
||||||
|
import org.apache.solr.core.SolrCoreInitializationException;
|
||||||
import org.apache.solr.logging.MDCLoggingContext;
|
import org.apache.solr.logging.MDCLoggingContext;
|
||||||
import org.apache.solr.update.UpdateLog;
|
import org.apache.solr.update.UpdateLog;
|
||||||
import org.apache.zookeeper.CreateMode;
|
import org.apache.zookeeper.CreateMode;
|
||||||
|
@ -1233,6 +1234,9 @@ public class ZkController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (SolrCoreInitializationException ex) {
|
||||||
|
// The core had failed to initialize (in a previous request, not this one), hence nothing to do here.
|
||||||
|
log.info("The core '{}' had failed to initialize before.", cd.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
ZkNodeProps m = new ZkNodeProps(props);
|
ZkNodeProps m = new ZkNodeProps(props);
|
||||||
|
|
|
@ -1294,7 +1294,7 @@ public class CoreContainer {
|
||||||
* @see SolrCore#close()
|
* @see SolrCore#close()
|
||||||
* @param name the core name
|
* @param name the core name
|
||||||
* @return the core if found, null if a SolrCore by this name does not exist
|
* @return the core if found, null if a SolrCore by this name does not exist
|
||||||
* @exception SolrException if a SolrCore with this name failed to be initialized
|
* @exception SolrCoreInitializationException if a SolrCore with this name failed to be initialized
|
||||||
*/
|
*/
|
||||||
public SolrCore getCore(String name) {
|
public SolrCore getCore(String name) {
|
||||||
|
|
||||||
|
@ -1313,9 +1313,7 @@ public class CoreContainer {
|
||||||
// error with the details for clients attempting to access it.
|
// error with the details for clients attempting to access it.
|
||||||
CoreLoadFailure loadFailure = getCoreInitFailures().get(name);
|
CoreLoadFailure loadFailure = getCoreInitFailures().get(name);
|
||||||
if (null != loadFailure) {
|
if (null != loadFailure) {
|
||||||
throw new SolrException(ErrorCode.SERVER_ERROR, "SolrCore '" + name +
|
throw new SolrCoreInitializationException(name, loadFailure.exception);
|
||||||
"' is not available due to init failure: " +
|
|
||||||
loadFailure.exception.getMessage(), loadFailure.exception);
|
|
||||||
}
|
}
|
||||||
// otherwise the user is simply asking for something that doesn't exist.
|
// otherwise the user is simply asking for something that doesn't exist.
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership.
|
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
* (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.solr.core;
|
||||||
|
|
||||||
|
import org.apache.solr.common.SolrException;
|
||||||
|
|
||||||
|
public class SolrCoreInitializationException extends SolrException {
|
||||||
|
|
||||||
|
public SolrCoreInitializationException(ErrorCode code, String msg) {
|
||||||
|
super(code, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SolrCoreInitializationException(String coreName, Exception loadException) {
|
||||||
|
super(ErrorCode.SERVER_ERROR, "SolrCore '" + coreName +
|
||||||
|
"' is not available due to init failure: " +
|
||||||
|
loadException.getMessage(), loadException);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue