Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [JobManager] Job is not executed
[JobManager] Job is not executed [message #911468] Tue, 11 September 2012 17:07 Go to next message
Svend-Anjes Pahl is currently offline Svend-Anjes PahlFriend
Messages: 1
Registered: September 2012
Junior Member
Hi eclipse community,

I've noticed a strage behavior using the UIJob on Eclipse 4.2 with RAP 1.5. There are multiple jobs containing the same SchedulingRule marking the jobs as conflicting, therefore only one job is executed at the same time. After a few jobs are executed the execution stops even though there are waiting jobs left. I've enabled tracing and added a JobListener to the JobManager logging the scheduling process. The log looks like the following:

26467 [UIThread [a9g3c9umwz091lv1fxs3xodk6]] DEBUG MapView  - done propertyChange(9)
17:58:06.338-[Thread[Worker-1,5,main]]Starting job: propertyChange(10)
26468 [Worker-1] DEBUG MapView  - aboutToRun propertyChange(10)
26468 [Worker-1] DEBUG MapView  - running propertyChange(10)
17:58:06.339-[Thread[Worker-0,5,main]]worker sleeping for: 60000ms
17:58:06.339-[Thread[Worker-1,5,main]]worker sleeping for: 60000ms


The job with id 9 finished successfully. The next job with id 10 is started, but no code is executed (There is no debug message in the log). The code scheduling the jobs looks like the following:
	@Override
	public void propertyChange(final PropertyChangeEvent evt) {
		log.debug("queue propertyChange " + evt.getPropertyName());
		scheduleJob(new UIJob("propertyChange") {
			
			@Override
			public IStatus runInUIThread(IProgressMonitor monitor) {
				log.debug("propertyChange " + evt.getPropertyName());
				checkWidget();
				//do some work here...
				return Status.OK_STATUS;
			}

			@Override
			public boolean shouldRun() {
				return MapView.this.isInitialized();
			}

			@Override
			public boolean belongsTo(Object family) {
				return MapView.this.equals(family);
			}
		});

	}

protected void scheduleJob(Job job) {
		job.setRule(new MapViewSchedulingRule());
		job.schedule();
}
private class MapViewSchedulingRule implements ISchedulingRule {

		@Override
		public boolean contains(ISchedulingRule rule) {
			return rule instanceof MapViewSchedulingRule;
		}

		@Override
		public boolean isConflicting(ISchedulingRule rule) {
			return rule instanceof MapViewSchedulingRule;
		}

	}


Has anybody an idea what's wrong or is it a bug in the JobManager?
Many thanks in advance!

[Updated on: Wed, 12 September 2012 07:35]

Report message to a moderator

Re: [JobManager] Job is not executed [message #923140 is a reply to message #911468] Tue, 25 September 2012 16:30 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Bug link: https://bugs.eclipse.org/bugs/show_bug.cgi?id=390329

PW


Previous Topic:Race conditions in AnnotationModel? Error annotations lost in Reconciler
Next Topic:How does one automatically configure the Network Connection Preference
Goto Forum:
  


Current Time: Sun Dec 21 21:05:47 GMT 2014

Powered by FUDForum. Page generated in 0.01620 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software