Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 197258

Summary: [Progress] fast finished Job cannot be removed from view
Product: [Eclipse Project] Platform Reporter: Markus Schorn <mschorn.eclipse>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED DUPLICATE QA Contact: Prakash Rangaraj <prakash>
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Schorn CLA 2007-07-20 04:16:39 EDT
I am using a job that can be done really fast. In this case almost every time the job remains visible in the Progress View and even more annoying it is shown in the status-bar, as if it was running.

In the view the job is shown as '(Finished)\n OK'.
I can select the icon showing the grey cross aside the job (tooltip 'Remove From View'), then the job is gone. Selecting 'Remove All Finished Operations' makes the job appear again. This time it is shown as '(Cancelled)\n OK'.

When I add a 'Thread.sleep(100)' in the implementation of the job before I return 'Status.OK', then the problem is gone.
Comment 1 Prakash Rangaraj CLA 2009-07-16 00:35:00 EDT
Markus,
     I'm trying with an empty job (that does nothing) on 3.5 and didn't face this problem. If you can still reproducible in 3.5, please reopen this bug with a sample job.
Comment 2 Markus Schorn CLA 2009-07-16 03:43:46 EDT
The problem still exists, however that the issue arises with a fast job is just a coincidence. Here is what really happens:

In our use case the job-monitor is updated from a different thread. 
Similar as in bug 149857 with calling IProgressMonitor.isCanceled(), updating the information on the monitor (using IProgressMonitor.subTask() and/or IProgressMonitor.worked()) after the job is done causes the job to stay in the progress view.

Comment 3 Prakash Rangaraj CLA 2009-07-27 07:19:08 EDT
(In reply to comment #2)
> The problem still exists, however that the issue arises with a fast job is just
> a coincidence. Here is what really happens:
> 
> In our use case the job-monitor is updated from a different thread. 
> Similar as in bug 149857 with calling IProgressMonitor.isCanceled(), updating
> the information on the monitor (using IProgressMonitor.subTask() and/or
> IProgressMonitor.worked()) after the job is done causes the job to stay in the
> progress view.
 
   Is it possible for you attach a sample code to reproduce the scenario?
Comment 4 Markus Schorn CLA 2009-07-27 08:21:20 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > The problem still exists, however that the issue arises with a fast job is just
> > a coincidence. Here is what really happens:
> > 
> > In our use case the job-monitor is updated from a different thread. 
> > Similar as in bug 149857 with calling IProgressMonitor.isCanceled(), updating
> > the information on the monitor (using IProgressMonitor.subTask() and/or
> > IProgressMonitor.worked()) after the job is done causes the job to stay in the
> > progress view.
>    Is it possible for you attach a sample code to reproduce the scenario?

Nope, I don't want to spend additional time on this. I am happy that we did find a workaround during the last 2 years.
Comment 5 John Arthorne CLA 2013-02-12 17:27:46 EST

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