Fix reporting pollEnabled config#228707
Conversation
|
Pinging @elastic/response-ops (Team:ResponseOps) |
Considering the original issue, shouldn't this be |
| const initialCapacity = getCapacity(); | ||
| const stopTaskTimer = startTaskTimer(); | ||
|
|
||
| const taskTypes = new Set<string>(); |
There was a problem hiding this comment.
I think the problem lies in
where we're just checking for taskDefinition.maxConcurrency, so not handling the max concurrency of 0 correctly. we're already getting the limited and unlimited batches in the buildClaimPartitions function below but the capacity is returning incorrectly when the maxConcurrency is 0
There was a problem hiding this comment.
I didn't even check that part because update_by_query relies on the batches to filter out the skipped tasks, just applied the same logic here.
Thanks for pointing the above problem, moved the fix there.
I guess the same fix should be applied to worker_capacity as well. Fixed that too.
Correct, fixed it :) |
…kibana into 226506-mget-polling-enabled
ymao1
left a comment
There was a problem hiding this comment.
LGTM. Verified report tasks are not claimed when pollEnabled is false and claimed when pollEnabled is true.
We should backport this fix as far back as possible. This bug was introduced in 8.16.
| ): number { | ||
| const allAvailableCapacity = this.capacity - this.usedCapacity(tasksInPool); | ||
| if (taskDefinition && taskDefinition.maxConcurrency) { | ||
| if (taskDefinition && !isNullish(taskDefinition.maxConcurrency)) { |
There was a problem hiding this comment.
could probably add a unit test for when maxConcurrency is 0 as well
|
|
||
| const searchQueryMust = store.msearch.mock.calls[0]?.[0]?.[0].query?.bool?.must; | ||
|
|
||
| expect(Array.isArray(searchQueryMust) && searchQueryMust[1]).toEqual({ |
There was a problem hiding this comment.
maybe another expect clause that the query does not contain sampleTaskZeroMaxConcurrency?
💚 Build Succeeded
Metrics [docs]
History
|
Fixes: elastic#226506 This PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be ignored by the `mget` claim strategy. ## To verify: Set `xpack.reporting.queue.pollEnabled: false` in your kibana.yml. Then try to generate a report. The task should be successfully created but its status should remain as `pending` on the reports page. <img width="999" height="343" alt="Screenshot 2025-07-21 at 02 35 40" src="https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37" /> (cherry picked from commit 8690830)
Fixes: elastic#226506 This PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be ignored by the `mget` claim strategy. ## To verify: Set `xpack.reporting.queue.pollEnabled: false` in your kibana.yml. Then try to generate a report. The task should be successfully created but its status should remain as `pending` on the reports page. <img width="999" height="343" alt="Screenshot 2025-07-21 at 02 35 40" src="https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37" /> (cherry picked from commit 8690830) # Conflicts: # x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_mget.test.ts # x-pack/platform/plugins/shared/task_manager/server/task_pool/cost_capacity.ts # x-pack/platform/plugins/shared/task_manager/server/task_pool/worker_capacity.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Fixes: elastic#226506 This PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be ignored by the `mget` claim strategy. ## To verify: Set `xpack.reporting.queue.pollEnabled: false` in your kibana.yml. Then try to generate a report. The task should be successfully created but its status should remain as `pending` on the reports page. <img width="999" height="343" alt="Screenshot 2025-07-21 at 02 35 40" src="https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37" /> (cherry picked from commit 8690830) # Conflicts: # x-pack/platform/plugins/shared/task_manager/server/task_claimers/strategy_mget.test.ts # x-pack/platform/plugins/shared/task_manager/server/task_pool/cost_capacity.ts # x-pack/platform/plugins/shared/task_manager/server/task_pool/worker_capacity.ts
Fixes: elastic#226506 This PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be ignored by the `mget` claim strategy. ## To verify: Set `xpack.reporting.queue.pollEnabled: false` in your kibana.yml. Then try to generate a report. The task should be successfully created but its status should remain as `pending` on the reports page. <img width="999" height="343" alt="Screenshot 2025-07-21 at 02 35 40" src="https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37" /> (cherry picked from commit 8690830)
Fixes: elastic#226506 This PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be ignored by the `mget` claim strategy. ## To verify: Set `xpack.reporting.queue.pollEnabled: false` in your kibana.yml. Then try to generate a report. The task should be successfully created but its status should remain as `pending` on the reports page. <img width="999" height="343" alt="Screenshot 2025-07-21 at 02 35 40" src="https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37" />
Fixes: #226506 This PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be ignored by the `mget` claim strategy. ## To verify: Set `xpack.reporting.queue.pollEnabled: false` in your kibana.yml. Then try to generate a report. The task should be successfully created but its status should remain as `pending` on the reports page. <img width="999" height="343" alt="Screenshot 2025-07-21 at 02 35 40" src="https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37" />
# Backport This will backport the following commits from `main` to `8.18`: - [Fix reporting pollEnabled config (#228707)](#228707) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Ersin Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-22T07:23:56Z","message":"Fix reporting pollEnabled config (#228707)\n\nFixes: #226506\n\nThis PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be\nignored by the `mget` claim strategy.\n\n## To verify: \n\nSet `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.\nThen try to generate a report.\nThe task should be successfully created but its status should remain as\n`pending` on the reports page.\n\n<img width=\"999\" height=\"343\" alt=\"Screenshot 2025-07-21 at 02 35 40\"\nsrc=\"https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37\"\n/>","sha":"8690830b3e4966d9191b9d5d4ce6e573445854d3","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:skip","Team:ResponseOps","v9.2.0"],"title":"Fix reporting pollEnabled config","number":228707,"url":"https://github.com/elastic/kibana/pull/228707","mergeCommit":{"message":"Fix reporting pollEnabled config (#228707)\n\nFixes: #226506\n\nThis PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be\nignored by the `mget` claim strategy.\n\n## To verify: \n\nSet `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.\nThen try to generate a report.\nThe task should be successfully created but its status should remain as\n`pending` on the reports page.\n\n<img width=\"999\" height=\"343\" alt=\"Screenshot 2025-07-21 at 02 35 40\"\nsrc=\"https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37\"\n/>","sha":"8690830b3e4966d9191b9d5d4ce6e573445854d3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228707","number":228707,"mergeCommit":{"message":"Fix reporting pollEnabled config (#228707)\n\nFixes: #226506\n\nThis PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be\nignored by the `mget` claim strategy.\n\n## To verify: \n\nSet `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.\nThen try to generate a report.\nThe task should be successfully created but its status should remain as\n`pending` on the reports page.\n\n<img width=\"999\" height=\"343\" alt=\"Screenshot 2025-07-21 at 02 35 40\"\nsrc=\"https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37\"\n/>","sha":"8690830b3e4966d9191b9d5d4ce6e573445854d3"}}]}] BACKPORT-->
# Backport This will backport the following commits from `main` to `8.19`: - [Fix reporting pollEnabled config (#228707)](#228707) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Ersin Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-22T07:23:56Z","message":"Fix reporting pollEnabled config (#228707)\n\nFixes: #226506\n\nThis PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be\nignored by the `mget` claim strategy.\n\n## To verify: \n\nSet `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.\nThen try to generate a report.\nThe task should be successfully created but its status should remain as\n`pending` on the reports page.\n\n<img width=\"999\" height=\"343\" alt=\"Screenshot 2025-07-21 at 02 35 40\"\nsrc=\"https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37\"\n/>","sha":"8690830b3e4966d9191b9d5d4ce6e573445854d3","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:skip","Team:ResponseOps","v9.2.0"],"title":"Fix reporting pollEnabled config","number":228707,"url":"https://github.com/elastic/kibana/pull/228707","mergeCommit":{"message":"Fix reporting pollEnabled config (#228707)\n\nFixes: #226506\n\nThis PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be\nignored by the `mget` claim strategy.\n\n## To verify: \n\nSet `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.\nThen try to generate a report.\nThe task should be successfully created but its status should remain as\n`pending` on the reports page.\n\n<img width=\"999\" height=\"343\" alt=\"Screenshot 2025-07-21 at 02 35 40\"\nsrc=\"https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37\"\n/>","sha":"8690830b3e4966d9191b9d5d4ce6e573445854d3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228707","number":228707,"mergeCommit":{"message":"Fix reporting pollEnabled config (#228707)\n\nFixes: #226506\n\nThis PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be\nignored by the `mget` claim strategy.\n\n## To verify: \n\nSet `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.\nThen try to generate a report.\nThe task should be successfully created but its status should remain as\n`pending` on the reports page.\n\n<img width=\"999\" height=\"343\" alt=\"Screenshot 2025-07-21 at 02 35 40\"\nsrc=\"https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37\"\n/>","sha":"8690830b3e4966d9191b9d5d4ce6e573445854d3"}}]}] BACKPORT-->
# Backport This will backport the following commits from `main` to `9.0`: - [Fix reporting pollEnabled config (#228707)](#228707) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Ersin Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-22T07:23:56Z","message":"Fix reporting pollEnabled config (#228707)\n\nFixes: #226506\n\nThis PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be\nignored by the `mget` claim strategy.\n\n## To verify: \n\nSet `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.\nThen try to generate a report.\nThe task should be successfully created but its status should remain as\n`pending` on the reports page.\n\n<img width=\"999\" height=\"343\" alt=\"Screenshot 2025-07-21 at 02 35 40\"\nsrc=\"https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37\"\n/>","sha":"8690830b3e4966d9191b9d5d4ce6e573445854d3","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:skip","Team:ResponseOps","v9.2.0"],"title":"Fix reporting pollEnabled config","number":228707,"url":"https://github.com/elastic/kibana/pull/228707","mergeCommit":{"message":"Fix reporting pollEnabled config (#228707)\n\nFixes: #226506\n\nThis PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be\nignored by the `mget` claim strategy.\n\n## To verify: \n\nSet `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.\nThen try to generate a report.\nThe task should be successfully created but its status should remain as\n`pending` on the reports page.\n\n<img width=\"999\" height=\"343\" alt=\"Screenshot 2025-07-21 at 02 35 40\"\nsrc=\"https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37\"\n/>","sha":"8690830b3e4966d9191b9d5d4ce6e573445854d3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228707","number":228707,"mergeCommit":{"message":"Fix reporting pollEnabled config (#228707)\n\nFixes: #226506\n\nThis PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be\nignored by the `mget` claim strategy.\n\n## To verify: \n\nSet `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.\nThen try to generate a report.\nThe task should be successfully created but its status should remain as\n`pending` on the reports page.\n\n<img width=\"999\" height=\"343\" alt=\"Screenshot 2025-07-21 at 02 35 40\"\nsrc=\"https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37\"\n/>","sha":"8690830b3e4966d9191b9d5d4ce6e573445854d3"}}]}] BACKPORT-->
# Backport This will backport the following commits from `main` to `9.1`: - [Fix reporting pollEnabled config (#228707)](#228707) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Ersin Erdal","email":"92688503+ersin-erdal@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-22T07:23:56Z","message":"Fix reporting pollEnabled config (#228707)\n\nFixes: #226506\n\nThis PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be\nignored by the `mget` claim strategy.\n\n## To verify: \n\nSet `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.\nThen try to generate a report.\nThe task should be successfully created but its status should remain as\n`pending` on the reports page.\n\n<img width=\"999\" height=\"343\" alt=\"Screenshot 2025-07-21 at 02 35 40\"\nsrc=\"https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37\"\n/>","sha":"8690830b3e4966d9191b9d5d4ce6e573445854d3","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:skip","Team:ResponseOps","v9.2.0"],"title":"Fix reporting pollEnabled config","number":228707,"url":"https://github.com/elastic/kibana/pull/228707","mergeCommit":{"message":"Fix reporting pollEnabled config (#228707)\n\nFixes: #226506\n\nThis PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be\nignored by the `mget` claim strategy.\n\n## To verify: \n\nSet `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.\nThen try to generate a report.\nThe task should be successfully created but its status should remain as\n`pending` on the reports page.\n\n<img width=\"999\" height=\"343\" alt=\"Screenshot 2025-07-21 at 02 35 40\"\nsrc=\"https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37\"\n/>","sha":"8690830b3e4966d9191b9d5d4ce6e573445854d3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228707","number":228707,"mergeCommit":{"message":"Fix reporting pollEnabled config (#228707)\n\nFixes: #226506\n\nThis PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be\nignored by the `mget` claim strategy.\n\n## To verify: \n\nSet `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.\nThen try to generate a report.\nThe task should be successfully created but its status should remain as\n`pending` on the reports page.\n\n<img width=\"999\" height=\"343\" alt=\"Screenshot 2025-07-21 at 02 35 40\"\nsrc=\"https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37\"\n/>","sha":"8690830b3e4966d9191b9d5d4ce6e573445854d3"}}]}] BACKPORT-->
Fixes: elastic#226506 This PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be ignored by the `mget` claim strategy. ## To verify: Set `xpack.reporting.queue.pollEnabled: false` in your kibana.yml. Then try to generate a report. The task should be successfully created but its status should remain as `pending` on the reports page. <img width="999" height="343" alt="Screenshot 2025-07-21 at 02 35 40" src="https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37" />
Fixes: elastic#226506 This PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be ignored by the `mget` claim strategy. ## To verify: Set `xpack.reporting.queue.pollEnabled: false` in your kibana.yml. Then try to generate a report. The task should be successfully created but its status should remain as `pending` on the reports page. <img width="999" height="343" alt="Screenshot 2025-07-21 at 02 35 40" src="https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37" />
Fixes: elastic#226506 This PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be ignored by the `mget` claim strategy. ## To verify: Set `xpack.reporting.queue.pollEnabled: false` in your kibana.yml. Then try to generate a report. The task should be successfully created but its status should remain as `pending` on the reports page. <img width="999" height="343" alt="Screenshot 2025-07-21 at 02 35 40" src="https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37" />
|
Thanks for fixing this @ersin-erdal! |
Fixes: #226506
This PR fixes the bug:
xpack.reporting.queue.pollEnabledconfig to be ignored by themgetclaim strategy.To verify:
Set
xpack.reporting.queue.pollEnabled: falsein your kibana.yml.Then try to generate a report.
The task should be successfully created but its status should remain as
pendingon the reports page.