mirror of https://github.com/apache/lucene.git
SOLR-9365: Reduce noise in solr logs during graceful shutdown
This commit is contained in:
parent
b39fcc1202
commit
3fe1486683
|
@ -158,6 +158,7 @@ Other Changes
|
|||
|
||||
* SOLR-9498: Remove HDFS properties from DIH solrconfig.xml, as started in SOLR-6943 (Alexandre Rafalovitch)
|
||||
|
||||
* SOLR-9365: Reduce noise in solr logs during graceful shutdown. (Cao Manh Dat via shalin)
|
||||
|
||||
================== 6.2.1 ==================
|
||||
|
||||
|
|
|
@ -289,8 +289,12 @@ final class ShardLeaderElectionContext extends ShardLeaderElectionContextBase {
|
|||
ActionThrottle lt;
|
||||
try (SolrCore core = cc.getCore(coreName)) {
|
||||
if (core == null ) {
|
||||
if (cc.isShutDown()) {
|
||||
return;
|
||||
} else {
|
||||
throw new SolrException(ErrorCode.SERVER_ERROR, "SolrCore not found:" + coreName + " in " + cc.getCoreNames());
|
||||
}
|
||||
}
|
||||
MDCLoggingContext.setCore(core);
|
||||
lt = core.getUpdateHandler().getSolrCoreState().getLeaderThrottle();
|
||||
}
|
||||
|
@ -325,9 +329,13 @@ final class ShardLeaderElectionContext extends ShardLeaderElectionContextBase {
|
|||
try (SolrCore core = cc.getCore(coreName)) {
|
||||
|
||||
if (core == null) {
|
||||
if (!zkController.getCoreContainer().isShutDown()) {
|
||||
cancelElection();
|
||||
throw new SolrException(ErrorCode.SERVER_ERROR,
|
||||
"SolrCore not found:" + coreName + " in " + cc.getCoreNames());
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// should I be leader?
|
||||
|
|
|
@ -347,10 +347,12 @@ public class LeaderElector {
|
|||
// am I the next leader?
|
||||
checkIfIamLeader(context, true);
|
||||
} catch (Exception e) {
|
||||
if (!zkClient.isClosed()) {
|
||||
log.warn("", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up any ZooKeeper nodes needed for leader election.
|
||||
|
|
|
@ -176,8 +176,10 @@ public class OverseerTaskProcessor implements Runnable, Closeable {
|
|||
try {
|
||||
prioritizer.prioritizeOverseerNodes(myId);
|
||||
} catch (Exception e) {
|
||||
if (!zkStateReader.getZkClient().isClosed()) {
|
||||
log.error("Unable to prioritize overseer ", e);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Make maxThreads configurable.
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ import java.nio.charset.StandardCharsets;
|
|||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
@ -263,7 +264,14 @@ public class SolrZkClient implements Closeable {
|
|||
@Override
|
||||
public void process(final WatchedEvent event) {
|
||||
log.debug("Submitting job to respond to event " + event);
|
||||
try {
|
||||
zkCallbackExecutor.submit(() -> watcher.process(event));
|
||||
} catch (RejectedExecutionException e) {
|
||||
// If not a graceful shutdown
|
||||
if (!isClosed()) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue