Skip to content

[Embeddable] Register ML embeddables synchronously#225110

Merged
cqliu1 merged 4 commits intoelastic:8.18from
cqliu1:embeddable/register-ml-embeddable-synchronously
Jun 24, 2025
Merged

[Embeddable] Register ML embeddables synchronously#225110
cqliu1 merged 4 commits intoelastic:8.18from
cqliu1:embeddable/register-ml-embeddable-synchronously

Conversation

@cqliu1
Copy link
Contributor

@cqliu1 cqliu1 commented Jun 24, 2025

Summary

Cherry-picked c528ca0 from #215947.

This registers the ML embeddable synchronously to avoid a racing condition where the dashboard could try to render an ML embeddable before the embeddable is available.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@cqliu1 cqliu1 marked this pull request as ready for review June 24, 2025 15:42
@cqliu1 cqliu1 requested a review from kibanamachine as a code owner June 24, 2025 15:42
@cqliu1 cqliu1 added v8.18.4 Feature:Dashboard Dashboard related features Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// backport:skip This PR does not require backporting Feature:Embeddables Relating to the Embeddable system labels Jun 24, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@cqliu1 cqliu1 added release_note:fix loe:small Small Level of Effort impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. labels Jun 24, 2025
Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

Looks like registerEmbeddables is getting called twice. You will need to remove the second call on line 299

@cqliu1
Copy link
Contributor Author

cqliu1 commented Jun 24, 2025

Looks like registerEmbeddables is getting called twice. You will need to remove the second call on line 299

Good catch! Fixed in 76e76c4

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM
code review only

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ml 4.5MB 4.5MB +31.7KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
ml 77.0KB 77.6KB +660.0B
Unknown metric groups

async chunk count

id before after diff
ml 112 115 +3

@cqliu1 cqliu1 merged commit b7f9dc6 into elastic:8.18 Jun 24, 2025
8 checks passed
@pmuellr
Copy link
Contributor

pmuellr commented Sep 10, 2025

So this wasn't backported? And won't be available in 8.19, 9.0, or 9.1? Is it not needed in those branches? We have someone expecting the fix, who upgraded from an older 8.18 to 9.1.2, and are still having this problem ...

@nreese
Copy link
Contributor

nreese commented Sep 10, 2025

So this wasn't backported? And won't be available in 8.19, 9.0, or 9.1? Is it not needed in those branches? We have someone expecting the fix, who upgraded from an older 8.18 to 9.1.2, and are still having this problem ...

This PR merged the fix into 8.18. This fix was merged into 8.19 and 9.1 in a much larger PR that could not be backported to 8.18. If you look at x-pack/platform/plugins/shared/ml/public/plugin.ts in 8.19 and 9.1, those branches have this fix applied.

8.19 branch has fixes https://github.com/elastic/kibana/blob/8.19/x-pack/platform/plugins/shared/ml/public/plugin.ts#L276
9.1 branch has fixes https://github.com/elastic/kibana/blob/9.1/x-pack/platform/plugins/shared/ml/public/plugin.ts#L287

Looks like 9.0 is the only branch missing the fix.

Maybe this is a new issue and we should open a different issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Dashboard Dashboard related features Feature:Embeddables Relating to the Embeddable system impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:small Small Level of Effort release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v8.18.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants