From 32483596603d55666e29de78b695ad5cb533b5bc Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Fri, 4 Apr 2014 13:06:01 -0600 Subject: [PATCH] log full exception in InternalClusterInfoService unless it's a ClusterBlockException --- .../cluster/InternalClusterInfoService.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/elasticsearch/cluster/InternalClusterInfoService.java b/src/main/java/org/elasticsearch/cluster/InternalClusterInfoService.java index 37e1f3a4781..82f8475be7a 100644 --- a/src/main/java/org/elasticsearch/cluster/InternalClusterInfoService.java +++ b/src/main/java/org/elasticsearch/cluster/InternalClusterInfoService.java @@ -29,6 +29,7 @@ import org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; import org.elasticsearch.action.admin.indices.stats.ShardStats; import org.elasticsearch.action.admin.indices.stats.TransportIndicesStatsAction; +import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider; @@ -283,9 +284,12 @@ public final class InternalClusterInfoService extends AbstractComponent implemen @Override public void onFailure(Throwable e) { - logger.warn("Failed to execute NodeStatsAction for ClusterInfoUpdateJob: " + e.getMessage()); - if (logger.isTraceEnabled()) { - logger.trace("NodeStatsAction failure", e); + if (e instanceof ClusterBlockException) { + if (logger.isTraceEnabled()) { + logger.trace("Failed to execute NodeStatsAction for ClusterInfoUpdateJob", e); + } + } else { + logger.warn("Failed to execute NodeStatsAction for ClusterInfoUpdateJob", e); } } }); @@ -311,9 +315,12 @@ public final class InternalClusterInfoService extends AbstractComponent implemen @Override public void onFailure(Throwable e) { - logger.warn("Failed to execute IndicesStatsAction for ClusterInfoUpdateJob: " + e.getMessage()); - if (logger.isTraceEnabled()) { - logger.trace("IndicesStatsAction failure", e); + if (e instanceof ClusterBlockException) { + if (logger.isTraceEnabled()) { + logger.trace("Failed to execute IndicesStatsAction for ClusterInfoUpdateJob", e); + } + } else { + logger.warn("Failed to execute IndicesStatsAction for ClusterInfoUpdateJob", e); } } });