Bug 246839 - [jobs] Semantic problems with ISchedulingRule#contains()
Summary: [jobs] Semantic problems with ISchedulingRule#contains()
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M3   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 246840
  Show dependency tree
 
Reported: 2008-09-10 05:48 EDT by Martin Oberhuber CLA
Modified: 2008-09-30 10:48 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 Martin Oberhuber CLA 2008-09-10 05:48:19 EDT
Looking at how ISchedulingRule#contains() works, there seem to be two semantic (usage) problems:

(1) When a scheduling-rule contains another one, then a call to 
    getJobManager().beginRule() for a contained rule simply has no effect.
    This means that by starting a rule that contains let's say all resources 
    (that's compliant with the API) I can bypass any locking on resources in 
    subsequent method calls.

(2) To get it right a rule should contain another rule only if it also conflicts 
    with this rule. However, because isConflicting() has to be symmetric, I
    cannot contain another rule. The only way to do that is to use MultiRule 
    (which gets special treatment in the job-manager).

We'd like to understand what was the intention behind ISchedulingRule#contains() and how to use it properly.
Comment 1 John Arthorne CLA 2008-09-30 10:48:22 EDT
I have updated the javadoc of ISchedulingRule#isConflicting with:

* This method must return true if calling {@link #contains(ISchedulingRule)} on
* the same rule also returns true. This is required because it would otherwise
* allow two threads to be running concurrently with the same rule.

Related discussion is in bug 246840.