Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 62995 - [Progress] scheduled synchronizations stay in the progress view when terminated
Summary: [Progress] scheduled synchronizations stay in the progress view when terminated
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 RC4   Edit
Assignee: Andre Weinand CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 61668 63989 65026 68049 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-19 12:17 EDT by Jean-Michel Lemieux CLA
Modified: 2004-06-23 19:07 EDT (History)
9 users (show)

See Also:


Attachments
Patch for NewProgressViewer.java (689 bytes, patch)
2004-06-22 08:44 EDT, Andre Weinand CLA
no flags Details | Diff
a patch for org.eclipse.ui.internal.progress (3.53 KB, patch)
2004-06-23 11:03 EDT, Andre Weinand CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Michel Lemieux CLA 2004-05-19 12:17:30 EDT
I thought that the belongsTo call would get rid of all matching
synchronizations. But it appears that with scheduled syncs, they stay in the
view. Also, the timestamp isn't shown for when they terminated.
Comment 1 Jean-Michel Lemieux CLA 2004-05-19 12:18:17 EDT
Another thing is that you can't get rid of them when the remove button is pressed.
Comment 2 Jean-Michel Lemieux CLA 2004-05-20 10:06:29 EDT
I've checked our code and belongsTo is called by the progress view but for some
reason matching jobs are not really removed. The call to belongsTo is returning
true and the progress view looks like it is removing elements, but they are not
actually removed from the UI. Also, the finished tasks in the progress view can
never be removed by pressing the remove all, or the 'x' button. To reproduce:
1. create a cvs synchronization
2. from the sync view menu select Schedule...
3. schedule every minute
4. watch the jobs accumulate in the sync view
Comment 3 Tod Creasey CLA 2004-05-20 11:41:47 EDT
The problem is that the view is showing persisted groups, not jobs so when the 
code that checks for terminated jobs is running it does not clear it out - 
likewise the X does not work as it is a group.

The right answer is likely to persist the group in the view rather than the 
job but I don't want to mess with this code so close to a milestone as I am 
not familiar with it.
Comment 4 Jean-Michel Lemieux CLA 2004-05-25 21:34:51 EDT
*** Bug 63989 has been marked as a duplicate of this bug. ***
Comment 5 Michael Van Meekeren CLA 2004-06-21 09:52:21 EDT
*** Bug 65026 has been marked as a duplicate of this bug. ***
Comment 6 Michael Van Meekeren CLA 2004-06-21 09:57:45 EDT
*** Bug 61668 has been marked as a duplicate of this bug. ***
Comment 7 Randy Hudson CLA 2004-06-21 10:27:32 EDT
Whis is it that only the Bug Reporter gets CC'ed when a duplicate is resolved?  
Shouldn't everyone who was CCed get carried over?
Comment 8 Tod Creasey CLA 2004-06-21 11:56:35 EDT
Here is an easily reproducable case in RC3.

1) load ui, workbench,ide, jface and views
2) Select all
3) Synchronize with repository
4) Hit Run and Background
5) Synchronize again
6) About half of the time you will get a Finished job with no details that 
cannot be removed.
Comment 9 Tod Creasey CLA 2004-06-21 12:06:18 EDT
Note that for the case below closing and reopening the view cleared these out
Comment 10 Andre Weinand CLA 2004-06-22 08:38:57 EDT
Re #1:
Currently removing a kept job is done by removing it from the model (FinishedJobs) and letting 
notification remove it from the view.
In this PR the KEEPONE property results in a too early removal of the original job from the model. If later 
the UI is used to remove the job from the model, the model doesn't have the job (because it was already 
removed), and doesn't send out notification to the view. As consequence the job cannot be removed 
from the view.
I suggest to change the code in NewProgressView.JobItem.kill() so that the dispose and the refresh is 
always done (without going through the model). This will ensure that finished jobs can always be 
removed even if the model in FinishedJobs does not know them.
On the other hand, if the model knows them and sends out remove-notification, but the job already has 
been removed from the view, the remove event has no effect (see code in 
NewProgressViewer.remove(Object[])).
Comment 11 Andre Weinand CLA 2004-06-22 08:44:42 EDT
Created attachment 12639 [details]
Patch for NewProgressViewer.java

Patch enables to remove finished jobs without relying on model notification.
Comment 12 Jean-Michel Lemieux CLA 2004-06-22 10:49:03 EDT
*** Bug 68049 has been marked as a duplicate of this bug. ***
Comment 13 Tod Creasey CLA 2004-06-22 11:34:25 EDT
There is still a case where this patch fails:

1) Load ui,views,workbench, jface and ide
2) Sync
3) Run in background
4) Do a couple of more synchs before the first one is done
Dead groups still around
Comment 14 Andre Weinand CLA 2004-06-22 11:56:14 EDT
The patch does not fix the original problem,
but should allow to remove jobs in any situation (see comment #1).

I'm still working on the real problem, but the patch should go into RC4 in any case.

Are you saying in comment #13 that you couldn't remove the stale jobs from the ProgressView?
Comment 15 Tod Creasey CLA 2004-06-22 12:13:48 EDT
Yes - the stale groups were still hanging around but I will retest with just 
this patch,
Comment 16 Andre Weinand CLA 2004-06-23 06:42:38 EDT
Tod, I'm bitten by the following problem with JobInfos:
Whenever a Job that belongs to a group is rescheduled,  the newly generated JobInfos 
have their parent initialized to null (instead of the original GroupInfo). As a consequence 
the new JobItem is no longer associated with the original group and it gets a new entry in 
the ProgressViewer. 
You can verify this by creating a rescheduled group with the KEEP flag set.
The first time it appears in the ProgressView as a Group, and when rescheduled it 
appears as a TestJob.
Can you please look into this problem? Without the correct groupinfo I have a hard time 
fixing this problem.
Comment 17 Tod Creasey CLA 2004-06-23 08:23:25 EDT
Stale groups are a consequence of the API -from setProgressGroup()

	 * The progress group must be set before the job is scheduled.
	 * The group will be used only for a single invocation of the job's 
	 * <tt>run</tt> method, after which any association of this job to the 
	 * group will be lost.
	 
So there will always be a risk of stale groups here.
Comment 18 Andre Weinand CLA 2004-06-23 08:27:08 EDT
Which means that I cannot really fix the real problem, but only cure the symptoms:
make removal of stale stuff reliable.

Right? 
Comment 19 Tod Creasey CLA 2004-06-23 08:51:44 EDT
Correct. I think the best solution is to nver have a group in the FinishedJobs 
but only ever show a finished job. Group info is not useful after the jobs is 
done anyways.
Comment 20 Andre Weinand CLA 2004-06-23 11:03:38 EDT
Created attachment 12715 [details]
a patch for org.eclipse.ui.internal.progress

This patch fixes
- a problem where the KEEPONE flag would actually remove all jobs of a family
  from the model because it would perform the belongsTo check even on itself.
  As a consequence it was hard to remove those items from the view, because
  it was waiting for remove-notification from the model, which would never
come.

- adds a reliable way to remove stale items from the ProgressView and the
  FinishedJobs model (press the Remove All Finished Tasks button).

It does not tackle other issues because that would larger code changes
and would be high risk.

Tod, could you give it a try please?
Thanks.
Comment 21 Tod Creasey CLA 2004-06-23 11:44:41 EDT
Released the patch with updated copyrights. Reviewed with JM and MVM. The 
problem with not clearing elements when you click the X persists but at least 
you can clear all.

I think this is all we should do for 3.0 and revisit the rest of the issues in 
3.0.1. We should enter a seperate problem report for the remaining issues and 
close this one.
Comment 22 Tod Creasey CLA 2004-06-23 19:07:15 EDT
I have entered the remaining issues in Bug 68434 which we can revisit post 3.0.
 

Marking this as fixed as it is now possible to clear these values.
Comment 23 Tod Creasey CLA 2004-06-23 19:07:38 EDT
Verified in 20040623-1600