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

Replace task manager's runNow with runSoon #133550

Closed
mikecote opened this issue Jun 3, 2022 · 1 comment · Fixed by #134324
Closed

Replace task manager's runNow with runSoon #133550

mikecote opened this issue Jun 3, 2022 · 1 comment · Fixed by #134324
Assignees
Labels
Feature:Alerting/RulesFramework Issues related to the Alerting Rules Framework Feature:Task Manager Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@mikecote
Copy link
Contributor

mikecote commented Jun 3, 2022

TaskManager exposes the ability to run a background task immediately and wait for the task to finish running. This will no longer be feasible in all configurations when a Kibana process can be explicitly configured to no longer run background tasks.

Instead, runSoon should replace runNow and adjust the task's schedule so that it is run as soon as possible by the next available Kibana process that can run background tasks. If we need these tasks to skip the current queue, we will need to add some type of priority to task-manager's claiming algorithm; however, this should be optional as not all consumers of runSoon will want to skip the queue.

Unlike runNow, runSoon will return as soon as the schedule has been updated and before the task has completed running.

At the moment, the only consumers of runNow outside of alerting are APM. APM is using it to run their telemetry task when it's outdated. However, the results of the telemetry task are not consumed, so a transition to runSoon will be rather painless. It's worth keeping in mind the usage of runNow when updating a rule will soon transition to a new function and may have merge conflicts (#124850).

@mikecote mikecote added Feature:Task Manager Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Alerting/RulesFramework Issues related to the Alerting Rules Framework labels Jun 3, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@mikecote mikecote moved this from Awaiting Triage to Todo in AppEx: ResponseOps - Execution & Connectors Jun 3, 2022
@ersin-erdal ersin-erdal self-assigned this Jun 11, 2022
@ersin-erdal ersin-erdal moved this from In Progress to In Review in AppEx: ResponseOps - Execution & Connectors Jun 23, 2022
Repository owner moved this from In Review to Done in AppEx: ResponseOps - Execution & Connectors Jun 28, 2022
mikecote added a commit that referenced this issue Nov 9, 2022
In this PR, I'm cleaning up code within Task Manager regarding claiming
tasks by id that is no longer used. The code was previously used for
running alerting rules right away but recently `runNow` got replaced
with `runSoon` which no longer needs this code to function. For more
info on the previous change, see
#133550.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting/RulesFramework Issues related to the Alerting Rules Framework Feature:Task Manager Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants