Skip to content

Commit

Permalink
Removed duplicate catch block.
Browse files Browse the repository at this point in the history
  • Loading branch information
henningandersen committed May 29, 2019
1 parent 5f86ea1 commit 8edda7b
Showing 1 changed file with 1 addition and 7 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 8edda7b

Please sign in to comment.