Bug 489779 - [Progress] Progress dialog blocks until every message has been displayed
Summary: [Progress] Progress dialog blocks until every message has been displayed
Status: CLOSED DUPLICATE of bug 445802
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Stefan Xenos CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-16 13:59 EDT by Stefan Oehme CLA
Modified: 2016-03-30 12:05 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Oehme CLA 2016-03-16 13:59:32 EDT
Let's take this (braindead) example of a job that runs fast, but produces a lot of "subTask()" calls on it's progress monitor:

WorkspaceJob job = new WorkspaceJob("Doing stuff") {
    @Override
    public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
        monitor.beginTask("Doing stuff", 5000);
        try {
            //wait until dialog pops up
            Thread.sleep(1000);
        } catch (InterruptedException e) {
        }
        for (int i = 0; i < 5000; i++) {
            monitor.subTask("Doing step " + i);
            monitor.worked(1);
        }
        monitor.done();
        return Status.OK_STATUS;
    }
};
job.setUser(true);
job.schedule();

A progress dialog pops up (as expected since we have the 1s wait at the beginning) and starts displaying every single message. The logic inside the job has already finished executing, but the dialog stays open for a long time, catching up with all the messages.

If I click "Run in Background", it is minimized to the progress view and finishes immediately, because the progress view does not have this blocking behavior.

The real use case is importing projects in Buildship. Usually it goes very fast, so the progress logging becomes a bottleneck. Of course we could log less fine grained. But sometimes the user has a mistake in his build script which makes some subtasks take a very long time. In such a case the user wants to know where the import is hanging.

We are currently working around this with a rate limiter in our progress reporting, but I think this should be fixed in the platform.
Comment 1 Lars Vogel CLA 2016-03-30 05:53:54 EDT
Stefan (Xenos), any suggestions how we can handle that better?
Comment 2 Stefan Xenos CLA 2016-03-30 11:51:38 EDT
I believe this is would be fixed by the same fix as bug 445802. Our plan was to throttle the number of progress updates posted to the UI per unit of time for all the methods that accept strings (the ones that only update the work ticks are already throttled).

I believe that would both address the CPU usage reported in that bug and the latency reported in this one.
Comment 3 Lars Vogel CLA 2016-03-30 12:05:57 EDT
Thanks Stefan, lets mark this one as dup of Bug 445802.

*** This bug has been marked as a duplicate of bug 445802 ***