mirror of https://github.com/apache/lucene.git
SOLR-10196: ElectionContext#runLeaderProcess can hit NPE on core close.
This commit is contained in:
parent
ed0f0f45ce
commit
04ba9968c0
|
@ -186,6 +186,8 @@ Bug Fixes
|
|||
* SOLR-10055: Linux installer now renames existing bin/solr.in.* as bin/solr.in.*.orig to make the installed config in
|
||||
/etc/defaults be the one found by default when launching solr manually. (janhoy)
|
||||
|
||||
* SOLR-10196: ElectionContext#runLeaderProcess can hit NPE on core close. (Mark Miller)
|
||||
|
||||
Optimizations
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -423,8 +423,12 @@ final class ShardLeaderElectionContext extends ShardLeaderElectionContextBase {
|
|||
|
||||
super.runLeaderProcess(weAreReplacement, 0);
|
||||
try (SolrCore core = cc.getCore(coreName)) {
|
||||
core.getCoreDescriptor().getCloudDescriptor().setLeader(true);
|
||||
publishActiveIfRegisteredAndNotActive(core);
|
||||
if (core != null) {
|
||||
core.getCoreDescriptor().getCloudDescriptor().setLeader(true);
|
||||
publishActiveIfRegisteredAndNotActive(core);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
log.info("I am the new leader: " + ZkCoreNodeProps.getCoreUrl(leaderProps) + " " + shardId);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class CleanupOldIndexTest extends SolrCloudTestCase {
|
|||
}
|
||||
|
||||
@AfterClass
|
||||
public static void teardownTestCases() throws Exception {
|
||||
public static void afterClass() throws Exception {
|
||||
|
||||
if (suiteFailureMarker.wasSuccessful()) {
|
||||
zkClient().printLayoutToStdOut();
|
||||
|
|
Loading…
Reference in New Issue