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

[ML] Adding job sychronization warning to job list pages #85794

Conversation

jgowdyelastic
Copy link
Member

When loading the Overview, Anomaly Detection and Data Frame Analytics pages, a synchronization check is run to see if any jobs are missing their save objects.
A callout is then displayed with a link to the stack management page so the user can repair them,

image

image

Checklist

Delete any items that are not applicable to this PR.

@jgowdyelastic jgowdyelastic added review non-issue Indicates to automation that a pull request should not appear in the release notes Feature:Anomaly Detection ML anomaly detection v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Transforms ML transforms Feature:Data Frame Analytics ML data frame analytics features v7.11.0 labels Dec 14, 2020
@jgowdyelastic jgowdyelastic self-assigned this Dec 14, 2020
@jgowdyelastic jgowdyelastic requested a review from a team as a code owner December 14, 2020 15:24
initSavedObjects(true)
.then(({ jobs }) => {
const missingJobs = jobType === undefined || jobs.some(({ type }) => type === jobType);
setShowWarning(missingJobs);
Copy link
Contributor

Choose a reason for hiding this comment

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

this effect potentially can update the state of an unmounted component

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't this the case for all async calls that are made from a useEffect?
Normally we call an async function but do not await on it as you can't pass an async function to useEffect, here I decided to use a then rather than create a second function.
This is a pattern i've seen in plenty of places, is there a better alternative?

Copy link
Contributor

Choose a reason for hiding this comment

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

Check out this example

, I don't know if there is a better way

Copy link
Member Author

Choose a reason for hiding this comment

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

ok yeah, a lock like this is a good solution.
We have a lot of components which have this potential problem.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated in 4eedc54

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, you're right, I see a warning message from React on this issue quite often.

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@jgowdyelastic jgowdyelastic removed the Feature:Transforms ML transforms label Dec 15, 2020
@peteharverson
Copy link
Contributor

Not related to this PR, but I got this error when trying to run Synchronize.

I think you can reproduce by:

  • Create a job in a test space.
  • Delete the job in the test space.
  • Switch to the Default space
  • Try and run Synchronize

image

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested latest edits and LGTM

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

LGTM

@jgowdyelastic
Copy link
Member Author

@elasticmachine merge upstream

@jgowdyelastic
Copy link
Member Author

@elasticmachine merge upstream

@jgowdyelastic
Copy link
Member Author

retest

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

LGTM ⚡

@jgowdyelastic
Copy link
Member Author

@elasticmachine merge upstream

@jgowdyelastic
Copy link
Member Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
ml 1686 1688 +2

Async chunks

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

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

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jgowdyelastic jgowdyelastic merged commit 168782d into elastic:master Dec 16, 2020
@jgowdyelastic jgowdyelastic deleted the adding-job-synchronization-callout-to-job-list-pages branch December 16, 2020 09:31
jgowdyelastic added a commit that referenced this pull request Dec 16, 2020
…6088)

* [ML] Adding job sychronization warning to job list pages

* fixing overview page callout

* improving check logic

* adding render lock

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Anomaly Detection ML anomaly detection Feature:Data Frame Analytics ML data frame analytics features :ml non-issue Indicates to automation that a pull request should not appear in the release notes release_note:skip Skip the PR/issue when compiling release notes review v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants