-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Search] Search Sessions Monitoring Task #85253
Conversation
Save IDs only in monitoring loop
…o sessions/retry-logic
…o sessions/monitor-task
Code lgtm, tested following things:
I took a sample dashboard and added a single slow viz with 60s shard delay agg. I expected to see in dev tools session completed in around 60s and it was the case once.
Session also errored out as the result. |
x-pack/plugins/data_enhanced/server/search/session/check_running_sessions.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested & functionality seems to be working as expected.
This seems like additional features targeted after 7.11.0 FF? 28 files changed (I didn't look but I'm sure some are tests) seems like a change we wouldn't put in after feature freeze. |
x-pack/plugins/data_enhanced/server/search/session/check_running_sessions.ts
Outdated
Show resolved
Hide resolved
@Dosant what you saw is the fact that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't re-test since the last review considering #85253 (comment) is expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than a couple of naming/typing notes, the Alerting & TaskManager changes look good to me 👍
Thanks for doing this 🙏
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
* Monitor ids * import fix * solve circular dep * eslint * mock circular dep * max retries test * mock circular dep * test * jest <(-:C * jestttttt * [data.search] Move search method inside session service and add tests * merge * Move background session service to data_enhanced plugin * Better logs Save IDs only in monitoring loop * Fix types * Space aware session service * ts * initial * initial * Fix session service saving * merge fix * stable stringify * INMEM_MAX_SESSIONS * INMEM_MAX_SESSIONS * use the status API * Move task scheduling behind a feature flag * Update x-pack/plugins/data_enhanced/server/search/session/session_service.ts Co-authored-by: Anton Dosov <[email protected]> * Add unit tests * Update x-pack/plugins/data_enhanced/server/search/session/session_service.ts Co-authored-by: Anton Dosov <[email protected]> * Use setTimeout to schedule monitoring steps * Update request_utils.ts * settimeout * tiny cleanup * Core review + use client.asyncSearch.status * update ts * fix unit test * code review fixes * Save individual search errors on SO * Don't re-fetch completed or errored searches * Rename Background Sessions to Search Sessions (with a send to background action) * doc * doc * jest fun * rename rfc * translations * merge fix * merge fix * code review * update so name in features * Move deleteTaskIfItExists to task manager * task_manager to ts project * Move deleteTaskIfItExists to public contract * mock * use task store * ts * code review * code review + jest * Alerting code review Co-authored-by: Lukas Olson <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Anton Dosov <[email protected]> Co-authored-by: restrry <[email protected]>
* Monitor ids * import fix * solve circular dep * eslint * mock circular dep * max retries test * mock circular dep * test * jest <(-:C * jestttttt * [data.search] Move search method inside session service and add tests * merge * Move background session service to data_enhanced plugin * Better logs Save IDs only in monitoring loop * Fix types * Space aware session service * ts * initial * initial * Fix session service saving * merge fix * stable stringify * INMEM_MAX_SESSIONS * INMEM_MAX_SESSIONS * use the status API * Move task scheduling behind a feature flag * Update x-pack/plugins/data_enhanced/server/search/session/session_service.ts Co-authored-by: Anton Dosov <[email protected]> * Add unit tests * Update x-pack/plugins/data_enhanced/server/search/session/session_service.ts Co-authored-by: Anton Dosov <[email protected]> * Use setTimeout to schedule monitoring steps * Update request_utils.ts * settimeout * tiny cleanup * Core review + use client.asyncSearch.status * update ts * fix unit test * code review fixes * Save individual search errors on SO * Don't re-fetch completed or errored searches * Rename Background Sessions to Search Sessions (with a send to background action) * doc * doc * jest fun * rename rfc * translations * merge fix * merge fix * code review * update so name in features * Move deleteTaskIfItExists to task manager * task_manager to ts project * Move deleteTaskIfItExists to public contract * mock * use task store * ts * code review * code review + jest * Alerting code review Co-authored-by: Lukas Olson <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Anton Dosov <[email protected]> Co-authored-by: restrry <[email protected]> Co-authored-by: Lukas Olson <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Anton Dosov <[email protected]> Co-authored-by: restrry <[email protected]>
Summary
Contains #85253 (will be rebased on top)
This PR implements the Search Sessions monitoring task, as specified in the Search Sessions (formerly known as Background Sessions RFC).
The
Search Session
service is responsible for tracking sessions in memory and storing them, if the user chooses to do so, but after sessions are saved, the responsibility for tracking them is passed down to the monitoring task.This task is responsible for checking up on
in_progress
search sessions, fetching the status of each search request and updating the search session's status (so it's correctly reflected in the Management UI for example).Once available, this task would probably also be integrated with the push notification service, to provide more immediate completion notifications to the user.
Checklist
Delete any items that are not applicable to this PR.
For maintainers