From e0d20af743f66f4891881e66af29f7a7c40e71df Mon Sep 17 00:00:00 2001 From: kimchy Date: Mon, 14 Jun 2010 13:25:18 +0300 Subject: [PATCH] ignore when flush can't be done --- .../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 621e687915b..9df6daca435 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/indices/IndicesMemoryCleaner.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/indices/IndicesMemoryCleaner.java @@ -99,7 +99,15 @@ public class IndicesMemoryCleaner extends AbstractComponent { for (IndexService indexService : indicesService) { for (IndexShard indexShard : indexService) { if (!shardsToIgnore.contains(indexShard.shardId())) { - indexShard.flush(new Engine.Flush().full(false)); + try { + indexShard.flush(new Engine.Flush().full(false)); + } 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); + } } } }