From 8edda7b36f7009f6d01d44fabe97e94153d7d06e Mon Sep 17 00:00:00 2001 From: Henning Andersen Date: Wed, 29 May 2019 14:46:28 +0200 Subject: [PATCH] Removed duplicate catch block. --- .../main/java/org/elasticsearch/search/SearchService.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/search/SearchService.java b/server/src/main/java/org/elasticsearch/search/SearchService.java index 3f8a3bc495c3c..b931529d8905c 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchService.java +++ b/server/src/main/java/org/elasticsearch/search/SearchService.java @@ -44,7 +44,6 @@ import org.elasticsearch.common.util.concurrent.ConcurrentMapLong; import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.index.Index; -import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.engine.Engine; @@ -558,12 +557,7 @@ final SearchContext createAndPutContext(ShardSearchRequest request) throws IOExc context.indexShard().getSearchOperationListener().onNewContext(context); putContext(context); // ensure that if index is deleted concurrently, we free the context immediately, either here or in afterIndexRemoved - try { - indicesService.indexServiceSafe(request.shardId().getIndex()); - } catch (IndexNotFoundException e) { - freeContext(context.id()); - throw e; - } + indicesService.indexServiceSafe(request.shardId().getIndex()); success = true; return context; } finally {