Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork Building Aggregate Index Capabilities Response to Management Pool (#76333) #76340

Merged
merged 1 commit into from
Aug 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ protected void doExecute(Task task, FieldCapabilitiesRequest request, final Acti
List<FieldCapabilitiesFailure> failures = indexFailures.values();
if (indexResponses.size() > 0) {
if (request.isMergeResults()) {
listener.onResponse(merge(indexResponses, request.includeUnmapped(), new ArrayList<>(failures)));
// fork off to the management pool for merging the responses as the operation can run for longer than is acceptable
// on a transport thread in case of large numbers of indices and/or fields
threadPool.executor(ThreadPool.Names.MANAGEMENT).submit(
ActionRunnable.supply(
listener,
() -> merge(indexResponses, request.includeUnmapped(), new ArrayList<>(failures)))
);
} else {
listener.onResponse(new FieldCapabilitiesResponse(indexResponses, new ArrayList<>(failures)));
}
Expand Down