Skip to content

Commit

Permalink
[ML] Fixing blocked jobs polling interval (elastic#171878)
Browse files Browse the repository at this point in the history
There is a bug with the way we check whether or not to start polling for
blocked jobs. We should only start polling there isn't an existing poll
running.
This causes the polling to run as possible and to refresh the full jobs
list on every check.
Now the blocked jobs polling correctly runs at the interval of 2s and
the full jobs list is only updated when there is a change in the list of
blocked jobs.

Partially fixes elastic#171626

A more in-depth change as specified in the issue can be done in follow
up work. It's good to get this change in for the next release just in
case we run out of time for the larger change.
  • Loading branch information
jgowdyelastic authored Nov 23, 2023
1 parent 73576c9 commit e7c793e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,10 @@ export class JobsListView extends Component {
});

this.isDoneRefreshing();
if (jobsSummaryList.some((j) => j.blocked !== undefined)) {
if (
blockingJobsRefreshTimeout === null &&
jobsSummaryList.some((j) => j.blocked !== undefined)
) {
// if there are some jobs in a deleting state, start polling for
// deleting jobs so we can update the jobs list once the
// deleting tasks are over
Expand Down

0 comments on commit e7c793e

Please sign in to comment.