From 7c931f34faeb9cb154226318d0603dae967cea6c Mon Sep 17 00:00:00 2001 From: kimchy Date: Tue, 22 Jun 2010 10:26:44 +0300 Subject: [PATCH] ignore state exceptions when trying to flush --- .../elasticsearch/indices/IndicesMemoryCleaner.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/indices/IndicesMemoryCleaner.java b/modules/elasticsearch/src/main/java/org/elasticsearch/indices/IndicesMemoryCleaner.java index 46b0da13a8c..7362f0c8b07 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/indices/IndicesMemoryCleaner.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/indices/IndicesMemoryCleaner.java @@ -90,7 +90,15 @@ public class IndicesMemoryCleaner extends AbstractComponent { public void fullMemoryClean() { for (IndexService indexService : indicesService) { for (IndexShard indexShard : indexService) { - indexShard.flush(new Engine.Flush().full(true)); + try { + indexShard.flush(new Engine.Flush().full(true)); + } catch (FlushNotAllowedEngineException e) { + // ignore this one, its temporal + } catch (IllegalIndexShardStateException e) { + // ignore this one as well + } catch (Exception e) { + logger.warn(indexShard.shardId() + ": Failed to force flush in order to clean memory", e); + } } } }