From a8cad677e57bbceb2d90fca77f2b20002c16fcbf Mon Sep 17 00:00:00 2001 From: Brandon Kobel Date: Mon, 3 Dec 2018 11:54:58 -0800 Subject: [PATCH] Specifying the timeout for the _msearch in the body (#26446) (#26534) * Specifying the timeout for the msearch in the body * Revert "Specifying the timeout for the msearch in the body" This reverts commit 7b07bfa2e63174d5c391037930be9ca95e1faa2d. * Fixing the courier and the index pattern execute script timeouts --- .../serialize_fetch_params/serialize_fetch_params.js | 6 ++++-- src/ui/public/field_editor/lib/validate_script.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ui/public/courier/fetch/request/serialize_fetch_params/serialize_fetch_params.js b/src/ui/public/courier/fetch/request/serialize_fetch_params/serialize_fetch_params.js index 60fbac7ab583..111706fb979a 100644 --- a/src/ui/public/courier/fetch/request/serialize_fetch_params/serialize_fetch_params.js +++ b/src/ui/public/courier/fetch/request/serialize_fetch_params/serialize_fetch_params.js @@ -72,7 +72,10 @@ export function serializeFetchParams( }); }) .then(function (indexList) { - let body = fetchParams.body || {}; + let body = { + timeout: `${esShardTimeout}ms`, + ...fetchParams.body || {}, + }; let index = []; // If we've reached this point and there are no indexes in the // index list at all, it means that we shouldn't expect any indexes @@ -94,7 +97,6 @@ export function serializeFetchParams( type: fetchParams.type, search_type: fetchParams.search_type, ignore_unavailable: true, - timeout: esShardTimeout, }; if (config.get('courier:setRequestPreference') === 'sessionId') { header.preference = sessionId; diff --git a/src/ui/public/field_editor/lib/validate_script.js b/src/ui/public/field_editor/lib/validate_script.js index c62e0dbdecde..f8940447abc6 100644 --- a/src/ui/public/field_editor/lib/validate_script.js +++ b/src/ui/public/field_editor/lib/validate_script.js @@ -24,7 +24,6 @@ export const executeScript = async ({ name, lang, script, indexPatternTitle, add const header = { index: indexPatternTitle, ignore_unavailable: true, - timeout: 30000 }; const search = { @@ -40,6 +39,7 @@ export const executeScript = async ({ name, lang, script, indexPatternTitle, add } }, size: 10, + timeout: '30s', }; if (additionalFields.length > 0) {