Skip to content

Commit

Permalink
Preserve response headers on index creation listener
Browse files Browse the repository at this point in the history
  • Loading branch information
ywelsch committed Jun 19, 2018
1 parent 4be2f3e commit 87eadaf
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
import java.util.function.Predicate;
import java.util.stream.IntStream;

import static org.elasticsearch.action.support.ContextPreservingActionListener.wrapPreservingContext;
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS;
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_CREATION_DATE;
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_INDEX_UUID;
Expand All @@ -114,6 +115,7 @@ public class MetaDataCreateIndexService extends AbstractComponent {
private final AliasValidator aliasValidator;
private final Environment env;
private final IndexScopedSettings indexScopedSettings;
private final ThreadPool threadPool;
private final ActiveShardsObserver activeShardsObserver;
private final NamedXContentRegistry xContentRegistry;

Expand All @@ -130,6 +132,7 @@ public MetaDataCreateIndexService(Settings settings, ClusterService clusterServi
this.aliasValidator = aliasValidator;
this.env = env;
this.indexScopedSettings = indexScopedSettings;
this.threadPool = threadPool;
this.activeShardsObserver = new ActiveShardsObserver(settings, clusterService, threadPool);
this.xContentRegistry = xContentRegistry;
}
Expand Down Expand Up @@ -229,7 +232,7 @@ private void onlyCreateIndex(final CreateIndexClusterStateUpdateRequest request,
logger,
allocationService,
request,
listener,
wrapPreservingContext(listener, threadPool.getThreadContext()),
indicesService,
aliasValidator,
xContentRegistry,
Expand Down

0 comments on commit 87eadaf

Please sign in to comment.