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

Bug 138848

Summary: [Progress] Using Progress-Group for Jobs is not showing any progress-bar
Product: [Eclipse Project] Platform Reporter: Benjamin Pasero <bpasero>
Component: UIAssignee: Tod Creasey <Tod_Creasey>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 88496, 139103    
Bug Blocks:    
Attachments:
Description Flags
Action running the Jobs
none
One Task-Label appearing behind Progress none

Description Benjamin Pasero CLA 2006-04-27 03:18:31 EDT
Version: 3.2.0
Build id: I20060413-1718

I am setting a Progress-Group to a bunch of Jobs that run concurrently. In these, I call "monitor.worked()". I expect the Progress-View to show a Progress-Bar with increasing Progress. However, I dont see _any_ Progress-Bar at all.

Ben
Comment 1 Tod Creasey CLA 2006-04-27 10:20:16 EDT
Did you begin a task or not?
Comment 2 Benjamin Pasero CLA 2006-04-27 10:37:46 EDT
Yes, directly after creating the ProgressGroup via the JobManager, I begin the Task. Then I create a number of Jobs that I apply the Group to. From within the jobs I tried various combinations of monitor#beginTask, monitior#worked and monitor#done, but I dont see any progress bar.

Interestingly, when pressing the cancel button in the Progress View, the Bar is appearing for a short time.

Ben
Comment 3 Tod Creasey CLA 2006-04-27 10:46:13 EDT
Is it possible for you to post some code to show this ? We have an example plug-in org.eclipse.ui.examples.jobs and it is working fine there - you can play around with that.

Also is this only an issue self hosting or in general?
Comment 4 Benjamin Pasero CLA 2006-04-27 10:48:59 EDT
Great, I will checkout the examples! Will post some code once I am back at home later.

This is an issue in my RCP application (Target 3.2 RC1) running out of Eclipse.

Ben
Comment 5 Tod Creasey CLA 2006-04-27 10:59:00 EDT
Ben just so you know the reason I ask about self hosting is that we have had problems in the past with the self hosted workspace not showing the first job (whereas it is fine in the product).

Try running one of the examples first and then your job and see if it still happens. Also try without the group and see if it is a group issue.

Is there anything in your .log?
Comment 6 Benjamin Pasero CLA 2006-04-27 13:42:53 EDT
I think I nailed the problem down to a single line of code on my side. I set a SchedulingRule that makes sure at any time only N Jobs of the kind are to be run. The Progress Bar is actually showing up, but only after a short while. And I can see some strange cheese where a task-name is drawn behind the progress bar (see next picture I attach).

I wrote an Action that triggers what I see, find it attached.

Ben
Comment 7 Benjamin Pasero CLA 2006-04-27 13:43:14 EDT
Created attachment 39696 [details]
Action running the Jobs
Comment 8 Benjamin Pasero CLA 2006-04-27 13:43:59 EDT
Created attachment 39697 [details]
One Task-Label appearing behind Progress
Comment 9 Benjamin Pasero CLA 2006-04-27 13:45:17 EDT
Btw there is nothing in the Log, and it does not make a difference wether I run it as first Job or subsequent job. However, not setting the Scheduling Rule at all, makes the Progress look normal.

Ben
Comment 10 Tod Creasey CLA 2006-04-27 20:50:57 EDT
I have an example plug-in that takes Benjamins example and increases the number of updates. When there are a lot of updates they happen no problem. This is another case of Bug 88496.

I cannot attach it right now due to Bug 139103 but I will when I can
Comment 11 Tod Creasey CLA 2006-05-01 08:29:28 EDT
Part of the issue is a timing one. ProgressInfoItem#isRunning() is getting confused by Groups where some jobs have run and some are waiting (like yours).

if (info.isJobInfo()) {
			return ((JobInfo) info).getJob().getState() == Job.RUNNING;
		}
		
		//It's a group
		JobInfo[] infos = getJobInfos();
		for (int i = 0; i < infos.length; i++) {
			int state = infos[i].getJob().getState();
			if (state != Job.NONE) {
				return true;
			}
		}
		// Only completed if there are any jobs
		return false;

is a possible different implementation but it is still updating strangely.
Comment 12 Tod Creasey CLA 2007-06-22 08:32:46 EDT
In 3.3 we have fixed this issue.