Community
Participate
Working Groups
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.
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.