From 00e010a52a6a53028a3e230543340012686a75c6 Mon Sep 17 00:00:00 2001 From: kimchy Date: Sun, 12 Jun 2011 23:22:12 +0300 Subject: [PATCH] on dynamic index creation when indexing, we might raise failure on routing (for example), but then not notify the listener --- .../elasticsearch/action/index/TransportIndexAction.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/index/TransportIndexAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/index/TransportIndexAction.java index 38f87ab8e0d..9b0fd9881a0 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/index/TransportIndexAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/index/TransportIndexAction.java @@ -107,7 +107,11 @@ public class TransportIndexAction extends TransportShardReplicationOperationActi @Override public void onFailure(Throwable e) { if (ExceptionsHelper.unwrapCause(e) instanceof IndexAlreadyExistsException) { // we have the index, do it - innerExecute(request, listener); + try { + innerExecute(request, listener); + } catch (Exception e1) { + listener.onFailure(e1); + } } else { listener.onFailure(e); }