Skip to content

Defer short-running jobs from the progress view#4131

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:worktree-progress-grace-period
Jul 4, 2026
Merged

Defer short-running jobs from the progress view#4131
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:worktree-progress-grace-period

Conversation

@vogella

@vogella vogella commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The progress view added a job the moment it was scheduled and removed it when it finished, so jobs that complete within a few hundred milliseconds flashed in and out and could not be read (very noticeable with system jobs enabled).

This adds a per-job grace period before a job is announced to the progress listeners. Jobs that finish, sleep or are cancelled before the grace period elapses are never shown, which removes the flicker for refresh, validation and decoration bursts. The grace period defaults to half of getLongOperationTime() with a 200ms floor and can be overridden through the org.eclipse.ui.progress.viewGracePeriod system property. Jobs kept after completion (KEEP_PROPERTY or an error result) are still captured, and running jobs remain queryable through getJobInfos().

Fixes #4126

}
};
pendingJobAdditions.put(job, graceTimer);
display.asyncExec(() -> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can flood UI thread with asyncExec / timerExec tasks for short living jobs. I would not misuse UI thread to dispatch tasks just to make sure progress view don't show jobs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reworked to avoid per-job UI dispatch: pendingJobAdditions is now a Map<Job, Long> of grace deadlines instead of per-job timers. Scheduling only puts the deadline in the map; notifyListeners() (the throttler's coalesced UI pass) drains and announces the expired entries, re-arming once via throttledAsyncExec() while any remain. Cancelling is a plain ConcurrentHashMap.remove, no dispatch.

return false;
}
if (display != null && !display.isDisposed()) {
display.asyncExec(() -> display.timerExec(-1, pending));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same fix: cancelling is now just pendingJobAdditions.remove(job), no asyncExec/timerExec.

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Test Results

   855 files  ±0     855 suites  ±0   49m 54s ⏱️ + 2m 51s
 8 102 tests +2   7 859 ✅ +2  243 💤 ±0  0 ❌ ±0 
20 208 runs  +6  19 554 ✅ +6  654 💤 ±0  0 ❌ ±0 

Results for commit 3528265. ± Comparison against base commit fa1a384.

♻️ This comment has been updated with latest results.

@vogella vogella force-pushed the worktree-progress-grace-period branch from 7f66863 to 382bc50 Compare June 22, 2026 14:28
@vogella vogella force-pushed the worktree-progress-grace-period branch from 382bc50 to 65fabb6 Compare July 4, 2026 04:02
@vogella vogella marked this pull request as ready for review July 4, 2026 04:03
@vogella vogella force-pushed the worktree-progress-grace-period branch from 65fabb6 to b04f881 Compare July 4, 2026 04:14
@vogella

vogella commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

@iloveeclipse any additional feedback?

@merks merks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks okay. Just nit questions.

@vogella

vogella commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

@merks I assume M1 is already out or at least finished. Please let me know if that is wrong.

@vogella vogella force-pushed the worktree-progress-grace-period branch from b04f881 to 24b81ed Compare July 4, 2026 13:29
Non-system jobs were shown in the progress view the moment they were
scheduled and removed when they finished, so jobs that complete within a
few hundred milliseconds flashed in and out and could not be read.

Add a per-job grace period before a job is announced to the progress
listeners. Jobs that finish, sleep or are cancelled before the grace period
elapses are never shown, which removes the flicker for refresh, validation
and decoration bursts. The grace period defaults to half of
getLongOperationTime() with a lower bound of 200ms and can be overridden
through the org.eclipse.ui.progress.viewGracePeriod system property. Jobs
kept after completion (KEEP_PROPERTY or an error result) are still captured.

Fixes eclipse-platform#4126
@vogella vogella force-pushed the worktree-progress-grace-period branch from 24b81ed to 3528265 Compare July 4, 2026 13:33
@merks

merks commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Yes, the Platform has contributed M1 so M2 is started and we have some breathing room again. Thanks for asking.

Speaking of which, the following issue is why I wanted to complete the Platform target platform removals for M1 because I was pretty sure this problem would happen:

eclipse-simrel/simrel.build#1432

Doing this for M1 gives much more runway for projects to address it., so I'm glad about that.

@vogella vogella merged commit 8603a98 into eclipse-platform:master Jul 4, 2026
18 checks passed
@vogella vogella deleted the worktree-progress-grace-period branch July 4, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Progress monitor should not flash frequently with short term entries which cannot be read

3 participants