Skip to content

Commit

Permalink
Fix noisy logging from HealthNodeTaskExecutor (elastic#105695)
Browse files Browse the repository at this point in the history
No need to log more than debug here on node shutdown. This causes an incredibly amount of log
spam in some tests that frequently restart nodes.
  • Loading branch information
original-brownbear authored Feb 22, 2024
1 parent 8fd6e30 commit 89c61cd
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.features.FeatureService;
import org.elasticsearch.health.HealthFeatures;
import org.elasticsearch.node.NodeClosedException;
import org.elasticsearch.persistent.AllocatedPersistentTask;
import org.elasticsearch.persistent.PersistentTaskParams;
import org.elasticsearch.persistent.PersistentTaskState;
Expand Down Expand Up @@ -166,6 +167,10 @@ void startTask(ClusterChangedEvent event) {
new HealthNodeTaskParams(),
null,
ActionListener.wrap(r -> logger.debug("Created the health node task"), e -> {
if (e instanceof NodeClosedException) {
logger.debug("Failed to create health node task because node is shutting down", e);
return;
}
Throwable t = e instanceof RemoteTransportException ? e.getCause() : e;
if (t instanceof ResourceAlreadyExistsException == false) {
logger.error("Failed to create the health node task", e);
Expand Down

0 comments on commit 89c61cd

Please sign in to comment.