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

Make the mget task claimer skip the claiming phase and update the task document directly to running #184739

Closed
4 tasks
mikecote opened this issue Jun 4, 2024 · 1 comment · Fixed by #191669
Closed
4 tasks
Assignees
Labels
Feature:Task Manager Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@mikecote
Copy link
Contributor

mikecote commented Jun 4, 2024

The claiming status was added to tasks as a way to allow Kibana to fetch the documents that were updates during an update by query operation, given the operation doesn't return the updated tasks. In the mget strategy, we know which documents get successfully updated, so there is no need to update it again from claiming to running.

Here is a prototype I did for mget that bypasses the claiming phase 1c2308c. The task_runner.ts would still need to look at the status of the task before determining if it can return early or if it needs to set the task to running. The mget claim strategy should re-use some code instead of re-defining getRetryDelay.

Definition of Done

  • When using the mget strategy, tasks go directly to running status
  • mget strategy still searches for claiming tasks in case the previous code running while Kibana shut down was update by query
  • Update by query strategy still uses claiming status
  • tests
@mikecote mikecote added Feature:Task Manager Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Jun 4, 2024
@elasticmachine
Copy link
Contributor

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

ymao1 added a commit that referenced this issue Sep 3, 2024
…` in `mget` claim strategy (#191669)

Resolves #184739

## Summary

During the `mget` task claim strategy, we set the task directly to
`running` with the appropriate `retryAt` value instead of setting it to
`claiming` and letting the task runner set the task to `running`. This
removes a task update from the claiming process. Updates the task runner
to skip the `markTaskAsRunning` function if the claim strategy is `mget`
and move the task directly to "ready to run".

---------

Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Task Manager Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
3 participants