Skip to content

Commit

Permalink
Do not emit deprecation warning in the shared context [7.17] (#93190)
Browse files Browse the repository at this point in the history
  • Loading branch information
idegtiarenko committed Jan 26, 2023
1 parent 5548c9d commit a7452b2
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions server/src/main/java/org/elasticsearch/indices/IndicesService.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.elasticsearch.common.util.concurrent.EsExecutors;
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
import org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor;
import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.common.util.iterable.Iterables;
import org.elasticsearch.common.util.set.Sets;
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
Expand Down Expand Up @@ -606,14 +607,17 @@ public void onStoreClosed(ShardId shardId) {
};
finalListeners.add(onStoreClose);
finalListeners.add(oldShardsStats);
final IndexService indexService = createIndexService(
CREATE_INDEX,
indexMetadata,
indicesQueryCache,
indicesFieldDataCache,
finalListeners,
indexingMemoryController
);
IndexService indexService;
try (ThreadContext.StoredContext ignored = threadPool.getThreadContext().newStoredContext(false)) {
indexService = createIndexService(
CREATE_INDEX,
indexMetadata,
indicesQueryCache,
indicesFieldDataCache,
finalListeners,
indexingMemoryController
);
}
boolean success = false;
try {
if (writeDanglingIndices && nodeWriteDanglingIndicesInfo) {
Expand Down

0 comments on commit a7452b2

Please sign in to comment.