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

[ResponseOps][Rules] Race condition in ESQuery rule data view selector #198502

Closed
umbopepato opened this issue Oct 31, 2024 · 1 comment · Fixed by #203654
Closed

[ResponseOps][Rules] Race condition in ESQuery rule data view selector #198502

umbopepato opened this issue Oct 31, 2024 · 1 comment · Fixed by #203654
Labels
bug Fixes for quality problems that affect the customer experience Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@umbopepato
Copy link
Member

umbopepato commented Oct 31, 2024

The ESQuery rule's data view selector shows an empty list if the data views service hasn't finished refreshing the saved objects cache before the component is rendered.

To reproduce

  1. Add a delay after this call
    const so = await this.savedObjectsClient.find({
    await new Promise((r) => setTimeout(r, 5000));
  2. Reload the Kibana tab
  3. Navigate to Observability > Alerts > Manage rules > Create rule
  4. Select Elasticsearch Query
  5. Select KQL as query type
  6. Open the Data View selector, it should be empty

Image

@botelastic botelastic bot added the needs-team Issues missing a team label label Oct 31, 2024
@umbopepato umbopepato added the Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) label Oct 31, 2024
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label Oct 31, 2024
@umbopepato umbopepato added bug Fixes for quality problems that affect the customer experience needs-team Issues missing a team label labels Oct 31, 2024
@botelastic botelastic bot removed the needs-team Issues missing a team label label Oct 31, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Dec 16, 2024
…ctor (elastic#203654)

## Summary

Introduces a loading state in the data views select popover and renders
a loading indicator when DVs are not available yet. This makes sure that
even if the `savedObjectsClient.find` call of the data views service
takes a long time, we don't show an empty popover in the meantime.

https://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1

## References

Fixes elastic#198502

## Release note

Fix race condition in alerting rules data view selector

(cherry picked from commit 713d4bb)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Dec 16, 2024
…ctor (elastic#203654)

## Summary

Introduces a loading state in the data views select popover and renders
a loading indicator when DVs are not available yet. This makes sure that
even if the `savedObjectsClient.find` call of the data views service
takes a long time, we don't show an empty popover in the meantime.

https://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1

## References

Fixes elastic#198502

## Release note

Fix race condition in alerting rules data view selector

(cherry picked from commit 713d4bb)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Dec 16, 2024
…ctor (elastic#203654)

## Summary

Introduces a loading state in the data views select popover and renders
a loading indicator when DVs are not available yet. This makes sure that
even if the `savedObjectsClient.find` call of the data views service
takes a long time, we don't show an empty popover in the meantime.

https://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1

## References

Fixes elastic#198502

## Release note

Fix race condition in alerting rules data view selector

(cherry picked from commit 713d4bb)
kibanamachine added a commit that referenced this issue Dec 16, 2024
…ws selector (#203654) (#204422)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[ResponseOps][Rules] Add loading state to rule params data views
selector (#203654)](#203654)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Umberto
Pepato","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-16T15:43:13Z","message":"[ResponseOps][Rules]
Add loading state to rule params data views selector (#203654)\n\n##
Summary\r\n\r\nIntroduces a loading state in the data views select
popover and renders\r\na loading indicator when DVs are not available
yet. This makes sure that\r\neven if the `savedObjectsClient.find` call
of the data views service\r\ntakes a long time, we don't show an empty
popover in the
meantime.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1\r\n\r\n##
References\r\n\r\nFixes #198502 \r\n\r\n## Release note\r\n\r\nFix race
condition in alerting rules data view
selector","sha":"713d4bbcb2d9f5e707d06c1d298287edd3e694d0","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:ResponseOps","v9.0.0","backport:all-open"],"title":"[ResponseOps][Rules]
Add loading state to rule params data views
selector","number":203654,"url":"https://github.com/elastic/kibana/pull/203654","mergeCommit":{"message":"[ResponseOps][Rules]
Add loading state to rule params data views selector (#203654)\n\n##
Summary\r\n\r\nIntroduces a loading state in the data views select
popover and renders\r\na loading indicator when DVs are not available
yet. This makes sure that\r\neven if the `savedObjectsClient.find` call
of the data views service\r\ntakes a long time, we don't show an empty
popover in the
meantime.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1\r\n\r\n##
References\r\n\r\nFixes #198502 \r\n\r\n## Release note\r\n\r\nFix race
condition in alerting rules data view
selector","sha":"713d4bbcb2d9f5e707d06c1d298287edd3e694d0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203654","number":203654,"mergeCommit":{"message":"[ResponseOps][Rules]
Add loading state to rule params data views selector (#203654)\n\n##
Summary\r\n\r\nIntroduces a loading state in the data views select
popover and renders\r\na loading indicator when DVs are not available
yet. This makes sure that\r\neven if the `savedObjectsClient.find` call
of the data views service\r\ntakes a long time, we don't show an empty
popover in the
meantime.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1\r\n\r\n##
References\r\n\r\nFixes #198502 \r\n\r\n## Release note\r\n\r\nFix race
condition in alerting rules data view
selector","sha":"713d4bbcb2d9f5e707d06c1d298287edd3e694d0"}}]}]
BACKPORT-->

Co-authored-by: Umberto Pepato <[email protected]>
kibanamachine added a commit that referenced this issue Dec 16, 2024
…ws selector (#203654) (#204423)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[ResponseOps][Rules] Add loading state to rule params data views
selector (#203654)](#203654)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Umberto
Pepato","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-16T15:43:13Z","message":"[ResponseOps][Rules]
Add loading state to rule params data views selector (#203654)\n\n##
Summary\r\n\r\nIntroduces a loading state in the data views select
popover and renders\r\na loading indicator when DVs are not available
yet. This makes sure that\r\neven if the `savedObjectsClient.find` call
of the data views service\r\ntakes a long time, we don't show an empty
popover in the
meantime.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1\r\n\r\n##
References\r\n\r\nFixes #198502 \r\n\r\n## Release note\r\n\r\nFix race
condition in alerting rules data view
selector","sha":"713d4bbcb2d9f5e707d06c1d298287edd3e694d0","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:ResponseOps","v9.0.0","backport:all-open"],"title":"[ResponseOps][Rules]
Add loading state to rule params data views
selector","number":203654,"url":"https://github.com/elastic/kibana/pull/203654","mergeCommit":{"message":"[ResponseOps][Rules]
Add loading state to rule params data views selector (#203654)\n\n##
Summary\r\n\r\nIntroduces a loading state in the data views select
popover and renders\r\na loading indicator when DVs are not available
yet. This makes sure that\r\neven if the `savedObjectsClient.find` call
of the data views service\r\ntakes a long time, we don't show an empty
popover in the
meantime.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1\r\n\r\n##
References\r\n\r\nFixes #198502 \r\n\r\n## Release note\r\n\r\nFix race
condition in alerting rules data view
selector","sha":"713d4bbcb2d9f5e707d06c1d298287edd3e694d0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203654","number":203654,"mergeCommit":{"message":"[ResponseOps][Rules]
Add loading state to rule params data views selector (#203654)\n\n##
Summary\r\n\r\nIntroduces a loading state in the data views select
popover and renders\r\na loading indicator when DVs are not available
yet. This makes sure that\r\neven if the `savedObjectsClient.find` call
of the data views service\r\ntakes a long time, we don't show an empty
popover in the
meantime.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1\r\n\r\n##
References\r\n\r\nFixes #198502 \r\n\r\n## Release note\r\n\r\nFix race
condition in alerting rules data view
selector","sha":"713d4bbcb2d9f5e707d06c1d298287edd3e694d0"}}]}]
BACKPORT-->

Co-authored-by: Umberto Pepato <[email protected]>
kibanamachine added a commit that referenced this issue Dec 16, 2024
…s selector (#203654) (#204424)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ResponseOps][Rules] Add loading state to rule params data views
selector (#203654)](#203654)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Umberto
Pepato","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-16T15:43:13Z","message":"[ResponseOps][Rules]
Add loading state to rule params data views selector (#203654)\n\n##
Summary\r\n\r\nIntroduces a loading state in the data views select
popover and renders\r\na loading indicator when DVs are not available
yet. This makes sure that\r\neven if the `savedObjectsClient.find` call
of the data views service\r\ntakes a long time, we don't show an empty
popover in the
meantime.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1\r\n\r\n##
References\r\n\r\nFixes #198502 \r\n\r\n## Release note\r\n\r\nFix race
condition in alerting rules data view
selector","sha":"713d4bbcb2d9f5e707d06c1d298287edd3e694d0","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:ResponseOps","v9.0.0","backport:all-open"],"title":"[ResponseOps][Rules]
Add loading state to rule params data views
selector","number":203654,"url":"https://github.com/elastic/kibana/pull/203654","mergeCommit":{"message":"[ResponseOps][Rules]
Add loading state to rule params data views selector (#203654)\n\n##
Summary\r\n\r\nIntroduces a loading state in the data views select
popover and renders\r\na loading indicator when DVs are not available
yet. This makes sure that\r\neven if the `savedObjectsClient.find` call
of the data views service\r\ntakes a long time, we don't show an empty
popover in the
meantime.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1\r\n\r\n##
References\r\n\r\nFixes #198502 \r\n\r\n## Release note\r\n\r\nFix race
condition in alerting rules data view
selector","sha":"713d4bbcb2d9f5e707d06c1d298287edd3e694d0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203654","number":203654,"mergeCommit":{"message":"[ResponseOps][Rules]
Add loading state to rule params data views selector (#203654)\n\n##
Summary\r\n\r\nIntroduces a loading state in the data views select
popover and renders\r\na loading indicator when DVs are not available
yet. This makes sure that\r\neven if the `savedObjectsClient.find` call
of the data views service\r\ntakes a long time, we don't show an empty
popover in the
meantime.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1\r\n\r\n##
References\r\n\r\nFixes #198502 \r\n\r\n## Release note\r\n\r\nFix race
condition in alerting rules data view
selector","sha":"713d4bbcb2d9f5e707d06c1d298287edd3e694d0"}}]}]
BACKPORT-->

Co-authored-by: Umberto Pepato <[email protected]>
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this issue Dec 19, 2024
…ctor (elastic#203654)

## Summary

Introduces a loading state in the data views select popover and renders
a loading indicator when DVs are not available yet. This makes sure that
even if the `savedObjectsClient.find` call of the data views service
takes a long time, we don't show an empty popover in the meantime.


https://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1

## References

Fixes elastic#198502 

## Release note

Fix race condition in alerting rules data view selector
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this issue Jan 13, 2025
…ctor (elastic#203654)

## Summary

Introduces a loading state in the data views select popover and renders
a loading indicator when DVs are not available yet. This makes sure that
even if the `savedObjectsClient.find` call of the data views service
takes a long time, we don't show an empty popover in the meantime.


https://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1

## References

Fixes elastic#198502 

## Release note

Fix race condition in alerting rules data view selector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants