From bcd7d97c5802148011669c710bfb80898f93b11a Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Sat, 3 Sep 2011 20:24:55 +0300 Subject: [PATCH] only log async refresh / merge failure if the engine is not closed --- .../index/shard/service/InternalIndexShard.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/service/InternalIndexShard.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/service/InternalIndexShard.java index 211bf17f970..4978bd9aa95 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/service/InternalIndexShard.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/service/InternalIndexShard.java @@ -659,10 +659,14 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I } else if (e.getCause() instanceof ThreadInterruptedException) { // ignore, we are being shutdown } else { - logger.warn("Failed to perform scheduled engine refresh", e); + if (state != IndexShardState.CLOSED) { + logger.warn("Failed to perform scheduled engine refresh", e); + } } } catch (Exception e) { - logger.warn("Failed to perform scheduled engine refresh", e); + if (state != IndexShardState.CLOSED) { + logger.warn("Failed to perform scheduled engine refresh", e); + } } synchronized (mutex) { if (state != IndexShardState.CLOSED) { @@ -700,10 +704,14 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I } else if (e.getCause() instanceof ThreadInterruptedException) { // ignore, we are being shutdown } else { - logger.warn("Failed to perform scheduled engine optimize/merge", e); + if (state != IndexShardState.CLOSED) { + logger.warn("Failed to perform scheduled engine optimize/merge", e); + } } } catch (Exception e) { - logger.warn("Failed to perform scheduled engine optimize/merge", e); + if (state != IndexShardState.CLOSED) { + logger.warn("Failed to perform scheduled engine optimize/merge", e); + } } synchronized (mutex) { if (state != IndexShardState.CLOSED) {