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

[UI] Fix bug where UI endlessly spins on attempting to view a metric from the runs page #1978

Merged
merged 4 commits into from
Oct 25, 2019

Conversation

smurching
Copy link
Collaborator

@smurching smurching commented Oct 23, 2019

What changes are proposed in this pull request?

Fix bug in MetricPlotPanel component, which uses RequestStateWrapper with the intention of rendering a spinner if the user selects additional metrics to view/compare after the initial page load (i.e. makes additional metric history requests after the initial page load). However, on the initial page load there are no such additional metric history requests, so the Spinner continues to display. We mitigate this by passing the shouldOptimisticallyRender prop so that the panel always renders (including in this case).

How is this patch tested?

Manual testing of existing pages + added a JS regression test

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

Fixes bug (which never shipped to users) introduced by #1943 that broke the metrics page

What component(s) does this PR affect?

  • UI
  • CLI
  • API
  • REST-API
  • Examples
  • Docs
  • Tracking
  • Projects
  • Artifacts
  • Models
  • Scoring
  • Serving
  • R
  • Java
  • Python

How should the PR be classified in the release notes? Choose one:

  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

@smurching smurching added the rn/bug-fix Mention under Bug Fixes in Changelogs. label Oct 23, 2019
@smurching smurching added the area/uiux Front-end, user experience, plotting, JavaScript, JavaScript dev server label Oct 23, 2019
@@ -34,9 +34,9 @@ export class RequestStateWrapper extends Component {
}

static getDerivedStateFromProps(nextProps) {
const shouldRender = nextProps.requests.length ? nextProps.requests.every((r) => {
const shouldRender = nextProps.requests.every((r) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding the check of nextProps.requests.length is to support initial loading from componentDidMount. This will likely break model registry pages which make initial loads in component did mount. We should probably try using shouldOptimisticallyRender on the special case?

Copy link
Collaborator Author

@smurching smurching Oct 23, 2019

Choose a reason for hiding this comment

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

@Zangr thanks for the comment! I'm not entirely sure I follow as the model registry components all seem to pass non-empty arrays of request IDs to RequestStateWrapper, (i.e. the empty length case never applies to them), and it seems if there are no requests passed to RequestStateWrapper, we should not spin endlessly. But using shouldOptimisticallyRender here does work, so I'll switch to that instead :)

Copy link
Contributor

Choose a reason for hiding this comment

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

As React triggers componentDidMount in "post order traversal", the initial render of RequestStateWrapper will not find any requests. However[].every(...) returns true when the base array is empty. That will make the component show before data is ready, which can cause a flash of semi-ready content or NPE.

Copy link
Contributor

@Zangr Zangr left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@dbczumar dbczumar left a comment

Choose a reason for hiding this comment

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

LGTM. Confirmed that this fix works by testing the metrics plot view in the MLflow UI.

@smurching smurching added rn/none List under Small Changes in Changelogs. and removed rn/bug-fix Mention under Bug Fixes in Changelogs. labels Oct 25, 2019
@smurching smurching merged commit e449a57 into mlflow:master Oct 25, 2019
avflor pushed a commit to avflor/mlflow that referenced this pull request Aug 22, 2020
…from the runs page (mlflow#1978)

Fixes bug (which never shipped to users) introduced by mlflow#1943 that broke the metrics page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/uiux Front-end, user experience, plotting, JavaScript, JavaScript dev server rn/none List under Small Changes in Changelogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants