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

changing defaults #164957

Merged
merged 4 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/plugins/data/common/search/poll_search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('pollSearch', () => {
abortSignal: abortController.signal,
}).toPromise();

await new Promise((resolve) => setTimeout(resolve, 500));
await new Promise((resolve) => setTimeout(resolve, 300));
abortController.abort();

await expect(poll).rejects.toThrow(AbortError);
Expand All @@ -99,7 +99,7 @@ describe('pollSearch', () => {
const cancelFn = jest.fn();
const subscription = pollSearch(searchFn, cancelFn).subscribe(() => {});

await new Promise((resolve) => setTimeout(resolve, 500));
await new Promise((resolve) => setTimeout(resolve, 300));
subscription.unsubscribe();
await new Promise((resolve) => setTimeout(resolve, 1000));

Expand Down
2 changes: 2 additions & 0 deletions src/plugins/data/common/search/poll_search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const pollSearch = <Response extends IKibanaSearchResponse>(
else {
// if static pollInterval is not provided, then use default back-off logic
switch (true) {
case elapsedTime < 1500:
return 300;
case elapsedTime < 5000:
return 1000;
case elapsedTime < 20000:
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/data/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const searchConfigSchema = schema.object({
* Block and wait until the search is completed up to the timeout (see es async_search's `wait_for_completion_timeout`)
* TODO: we should optimize this as 100ms is likely not optimal (https://github.com/elastic/kibana/issues/143277)
*/
waitForCompletion: schema.duration({ defaultValue: '100ms' }),
waitForCompletion: schema.duration({ defaultValue: '200ms' }),
/**
* How long the async search needs to be available after each search poll. Ongoing async searches and any saved search results are deleted after this period.
* (see es async_search's `keep_alive`)
Expand All @@ -71,7 +71,7 @@ export const searchConfigSchema = schema.object({
* How long to wait before polling the async_search after the previous poll response.
* If not provided, then default dynamic interval with backoff is used.
*/
pollInterval: schema.maybe(schema.number({ min: 1000 })),
pollInterval: schema.maybe(schema.number({ min: 200 })),
}),
aggs: schema.object({
shardDelay: schema.object({
Expand Down
Loading