[8.19] [Response Ops][Alerting] Cannot read properties of undefined (reading 'getActiveCount') (#221799)#224881
Merged
doakalexi merged 1 commit intoelastic:8.19from Jun 23, 2025
Conversation
… 'getActiveCount') (elastic#221799) Resolves elastic#208740 ## Summary This error message comes from the code where we drop the oldest recovered alerts from being tracked in the task state when there are more than 1000 (or alert limit) recovered alerts. The flapping refactor fixed this specific error, but I noticed that the alert documents weren't being updated before the alerts were dropped. This PR just moves this logic to the function that gets all the alerts to serialize in the task state, which happens after the alert documents are updated. ### Checklist Check the PR satisfies following conditions. - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### To verify 1. Set `xpack.alerting.rules.run.alerts.max: 3` in kibana.yml 2. Start kibana and create a rule that will generate 3 alerts 3. Stop kibana and set the max alert limit to 2 in kibana.yml 4. Start kibana and update the conditions to recover the alerts. Because there are 3 alerts recovering and we can only track 2, one alert will be dropped from the task state. 5. Verify that all the alerts are marked as recovered. Let the rule run to verify that one of the alert's alert document is no longer updated. (cherry picked from commit fff8ae9)
Merged
1 task
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.19:Questions ?
Please refer to the Backport tool documentation