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] Jobs list should handle 502s and 504s gracefully #23427

Conversation

philrenaud
Copy link
Contributor

@philrenaud philrenaud commented Jun 24, 2024

Previously, our jobs index page would handle handle all errors when fetching jobs by resetting state and trying again (with 5-second backoff).

This PR makes it so that proxy-timeout specific errors instead throw a notification, but keep the cached jobs shown on the page.

The user is then presented with two options to move forward:

  • pause fetch attempts (for this session or until they click "Manually fetch jobs")
  • Immediately try again (in case they extended their proxy settings in the background and want to immediately cancel pending requests and try again, or restart previously-paused attempts)

Resolves #23228
image

Copy link

github-actions bot commented Jun 24, 2024

Ember Test Audit comparison

main 35abc45 change
passes 1572 1573 +1
failures 0 0 0
flaky 0 0 0
duration 11m 33s 151ms 11m 30s 355ms -02s 796ms

{{/if}}
<A.Button @text="Manually fetch jobs" @color="secondary" {{on "click" this.restartJobList}} />
</Hds::Alert>
{{/if}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Hide whitespace during review; I corrected an old indentation issue here)

this.watchJobs.cancelAll();
}

@action restartJobList() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I let the user click "Try fetching again" before they've paused here even though the current retry on failure is 5sec with an eye to the future: we might extend that timeout beyond 5sec, or more likely add something like exponential backoff.

For now, though, it's an "I want to see the network request fire immediately to see if my new proxy config settings work" button.

* @param {Error} e
*/
notifyFetchError(e) {
const firstError = e.errors[0];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I could .any() this, but ¯_(ツ)_/¯

yield timeout(throttle);
} else {
if (Ember.testing) {
break;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A small change to my behaviour for testing purposes: I want to break out of a test on error now, too, which hadn't come up before. Without these lines, my test will be caught in a terrible loop.

normalizeQueryResponse(
store,
primaryModelClass,
payload = [],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only notable change here is a default of payload to [] so I don't have to do a bunch of conditional guards with elvis operators later

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@philrenaud philrenaud force-pushed the 23228-ui-the-jobs-page-shows-no-jobs-found-after-being-idle-for-two-minutes branch from cc4938d to 35abc45 Compare June 26, 2024 17:47
@philrenaud philrenaud added the backport/1.8.x backport to 1.8.x release line label Jun 27, 2024
@philrenaud philrenaud merged commit 54aafa5 into main Jun 27, 2024
17 checks passed
@philrenaud philrenaud deleted the 23228-ui-the-jobs-page-shows-no-jobs-found-after-being-idle-for-two-minutes branch June 27, 2024 01:51
Copy link

github-actions bot commented Jan 2, 2025

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/1.8.x backport to 1.8.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UI] The Jobs page shows "No jobs found" after being idle for two minutes.
3 participants