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

Reapply "[Response Ops][Task Manager] Setting task status directly to running in mget claim strategy #192303

Merged
merged 6 commits into from
Sep 9, 2024

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Sep 6, 2024

Re-doing this PR: #191669

Reverted because it was causing a flaky test. After a lot of investigation, it looks like the flakiness was caused by interference from long-running tasks scheduled as part of other tests. The task partitions test uses task IDs 1, 2 and 3 and the tasks were being short circuited when there were other tasks with UUIDs that started with 1, 2 or 3 due to the logic in the task runner that tries to prevent duplicate recurring tasks from running. That logic just used startsWith to test for duplicates where the identifier is ${task.id}::${task.executionUUID}. Updated that logic instead to check for duplicate task.id instead of just using startsWith in this commit: 1646ae9

@ymao1 ymao1 changed the title Reapply "[Response Ops][Task Manager] Setting task status directly to… Reapply "[Response Ops][Task Manager] Setting task status directly to running in mget claim strategy Sep 6, 2024
@ymao1 ymao1 self-assigned this Sep 6, 2024
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#6893

[✅] x-pack/test/task_manager_claimer_mget/config.ts: 200/200 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#6895

[❌] x-pack/test/task_manager_claimer_mget/config.ts: 174/200 tests passed.

see run history

@ymao1
Copy link
Contributor Author

ymao1 commented Sep 7, 2024

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#6897

[✅] x-pack/test/task_manager_claimer_mget/config.ts: 100/100 tests passed.

see run history

@ymao1 ymao1 added release_note:skip Skip the PR/issue when compiling release notes Feature:Task Manager Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.16.0 labels Sep 9, 2024
@ymao1 ymao1 marked this pull request as ready for review September 9, 2024 13:15
@ymao1 ymao1 requested a review from a team as a code owner September 9, 2024 13:15
@elasticmachine
Copy link
Contributor

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

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -223,7 +227,9 @@ export class TaskManagerRunner implements TaskRunner {
* @param id
*/
public isSameTask(executionId: string) {
return executionId.startsWith(this.id);
const executionIdParts = executionId.split('::');
const executionIdCompare = executionIdParts.length > 0 ? executionIdParts[0] : executionId;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think String::split() will always returns an array with at least one element, in this case, so this could be re-written as:

const executionIdCompare = executionIdParts[0];

OTOH, you'd have to know that, otherwise you might think this is buggy, and the existing code in the PR will actually work fine, so ... not sure if we should really change it :-)

@ymao1
Copy link
Contributor Author

ymao1 commented Sep 9, 2024

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @ymao1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Task Manager release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants