[Streams 🌊] Prevent routing simulation timeout and improve cancellations#226374
[Streams 🌊] Prevent routing simulation timeout and improve cancellations#226374tonyghiani merged 20 commits intoelastic:mainfrom
Conversation
| conditionUpdateDebounceTime: 500, | ||
| }, | ||
| }).createMachine({ | ||
| /** @xstate-layout N4IgpgJg5mDOIC5QCcD2BXALgSwHZQGUBDAWwAcAbOAYjSz0NMrgDpkwAzd2ACwG0ADAF1EoMqljYcqXKJAAPRADYAjCwDsAJiUCBSgJwqAHAGYVAViXqlAGhABPRABZLLc9aUmr6rSpMBffzs6HHxicipYWgxQxgjWdDIIIkwwAGEZCClsGUERJBBxSWlZAsUEL3MWIxUVJ2N9ARV9cxVbB2cTExYdXU16vyNzIydA4JiGcOZYFggwACMMXABjBgzcLJLqeVhMFLAWIg5U5AAKZczsmQBVJP2AEQWl5bAAFWwSMABKaPowpkisye6BWa0uJTyciKV1KoHKJnUVTq6hMTicAjM6IEljsjgQnm6mi0NRM+nq5j0+jGIBCkwBrA4YEwyx4DFmqGW6E+uEwMwoqCIWXw1AgMgOeAAbqgANYHC4UKjLTD3DlcsA82CQgrQkpycrmExGFhOKxGAyIymafS4xD6O0sO0Y7HqCwYlTU2n-eIzRnM1n4dmc7m8lj8wUMahgZBoZAsSgpDioZAkFjyxXK1XBzXCKESGF6xAG-QsPzuQxE-RKE02hBGdRG8zmJx2pxGTReTzqD0TL3TFi+lls0VB9WYDIgkNhoVQEViliSmVy1AKsBKlUjjXjnlasR53VlQtoh3qASNJ31EbWjoIPwqdRuUwmPpafp+bt-OJ9gf+qCBtU8rdJwFadI2jJM4woBMkxTNNVwzDdeUAndCj3HJYQUQ8qk8Iw22MLo-HUK88RUTQBE0Y1zErAR1CcDxdHMQIghAXBUDmeACk9T9IlzYo0ILBAsMNUxhhwusTRUGtNCMAQS10AR0TvTRtBcd9YimQE5kWEFVnwdZNj47VUJkfj0WLZsVGomjaKaPQa0sGS2jLEZsUbRtVLpb1+yZQd8B4-MDwE7psOE0SxNUGsT26RtzOaC9K00dze0Bb8h0zUd2N3XjjICizyJRFp9FMQihn0JSIsMFhsWbA1DSJQiqSYzj1IZbyfz-LNQ2Ahg-P3OFEFdDRSUoorCsosrryMfR70aVtRpafCGMansuJav1UoQmZRVwMAeoMvrayaB1SMRA1NAsk0TBrSajXrCxrFPWp9BMBKlo-ZqfVa9b-zHJZeV27L9ostRgpMEScJo8Lr1qDFjS8JSDWk9xnsSlaPrWgNh2+wC+S63zDKy9DyjqYsQbBsKa0emSntUIlaZcFoUferz0d-THg2x9ltv+wnEGk7oyIsO8alIswJKhs7yOpto2wNJGXsCIA */ |
|
Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs) |
|
@flash1293 I could replicate the issue and simulate longer and more complex requests to handle this scenario. The type lies when it comes to partial results, but we can specify to always get partial results to get it right, and then handle the search correctly. Screen.Recording.2025-07-07.at.11.49.33.mov |
Kerry350
left a comment
There was a problem hiding this comment.
Conversion to the state machine etc looks good to me barring the ongoing discussion about partial results.
The type lies when it comes to partial results, but we can specify to always get partial results to get it right, and then handle the search correctly.
This is interesting. So I can't remember the specifics as I did the original code ages ago, but there were caveats around aggregations and using partial results. If you're always able to specify this now, that sounds good 👌
...app/public/components/data_management/stream_detail_enrichment/processor_outcome_preview.tsx
Show resolved
Hide resolved
...shared/streams_app/public/components/data_management/stream_detail_routing/preview_panel.tsx
Outdated
Show resolved
Hide resolved
|
@flash1293 @Kerry350 thanks for your first reviews, this should be ready for another look |
Yeah good catch, I missed a check in the response filtering, fixed! |
flash1293
left a comment
There was a problem hiding this comment.
Tested and works fine for me now! I'll leave a detailed review of the fetching logic to Kerry, but it looks fine to me.
One note: During testing I noticed that we reset the data grid state when refreshing which is quite annoying:
But I guess we are touching this table anyway soon as part of the routing improvements, we can probably fix there
Kerry350
left a comment
There was a problem hiding this comment.
Thanks for the changes, LGTM 👌
|
Starting backport for target branches: 9.1 https://github.com/elastic/kibana/actions/runs/16166971911 |
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
|
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
|
Starting backport for target branches: 9.1 https://github.com/elastic/kibana/actions/runs/16169591225 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…ons (elastic#226374) ## 📓 Summary Closes elastic#219494 Refactor the samples fetching logic and address the following issues: - Add a timeout (10 seconds) to avoid requests on incomplete or unmatching conditions to keep running with no feedback. - Update cancellation logic, previously was not catching correctly the request abortions. - Sample data fetching performed on the creation form only. (cherry picked from commit 00333f2) # Conflicts: # x-pack/platform/plugins/shared/streams_app/public/components/data_management/stream_detail_enrichment/processor_outcome_preview.tsx
…ellations (#226374) (#227246) # Backport This will backport the following commits from `main` to `9.1`: - [[Streams 🌊] Prevent routing simulation timeout and improve cancellations (#226374)](#226374) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Marco Antonio Ghiani","email":"marcoantonio.ghiani01@gmail.com"},"sourceCommit":{"committedDate":"2025-07-09T10:31:52Z","message":"[Streams 🌊] Prevent routing simulation timeout and improve cancellations (#226374)\n\n## 📓 Summary\n\nCloses #219494 \n\nRefactor the samples fetching logic and address the following issues:\n- Add a timeout (10 seconds) to avoid requests on incomplete or\nunmatching conditions to keep running with no feedback.\n- Update cancellation logic, previously was not catching correctly the\nrequest abortions.\n- Sample data fetching performed on the creation form only.","sha":"00333f2c8adf96c1ef823ab4db6755d54f4a8925","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:obs-ux-logs","backport:version","Feature:Streams","v9.1.0","v9.2.0"],"title":"[Streams 🌊] Prevent routing simulation timeout and improve cancellations","number":226374,"url":"https://github.com/elastic/kibana/pull/226374","mergeCommit":{"message":"[Streams 🌊] Prevent routing simulation timeout and improve cancellations (#226374)\n\n## 📓 Summary\n\nCloses #219494 \n\nRefactor the samples fetching logic and address the following issues:\n- Add a timeout (10 seconds) to avoid requests on incomplete or\nunmatching conditions to keep running with no feedback.\n- Update cancellation logic, previously was not catching correctly the\nrequest abortions.\n- Sample data fetching performed on the creation form only.","sha":"00333f2c8adf96c1ef823ab4db6755d54f4a8925"}},"sourceBranch":"main","suggestedTargetBranches":["9.1"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226374","number":226374,"mergeCommit":{"message":"[Streams 🌊] Prevent routing simulation timeout and improve cancellations (#226374)\n\n## 📓 Summary\n\nCloses #219494 \n\nRefactor the samples fetching logic and address the following issues:\n- Add a timeout (10 seconds) to avoid requests on incomplete or\nunmatching conditions to keep running with no feedback.\n- Update cancellation logic, previously was not catching correctly the\nrequest abortions.\n- Sample data fetching performed on the creation form only.","sha":"00333f2c8adf96c1ef823ab4db6755d54f4a8925"}}]}] BACKPORT-->
…ons (elastic#226374) ## 📓 Summary Closes elastic#219494 Refactor the samples fetching logic and address the following issues: - Add a timeout (10 seconds) to avoid requests on incomplete or unmatching conditions to keep running with no feedback. - Update cancellation logic, previously was not catching correctly the request abortions. - Sample data fetching performed on the creation form only.




📓 Summary
Closes #219494
Refactor the samples fetching logic and address the following issues: