Class PriorityEnforcingDispatcher
- All Implemented Interfaces:
ExtensionPoint
QueueTaskDispatcher that enforces the Simple Queue priority ordering
when items transition from blocked to buildable.
The problem it solves: Jenkins Queue's maintain() method processes
blocked items one by one. When a blocked item's constraint clears (causeOfBlockage
becomes null), it is immediately added to the buildables list — regardless of
its priority relative to other still-blocked items. This means a lower-priority
item can start building before a higher-priority item even becomes unblocked.
This dispatcher intercepts the transition by implementing canRun(Queue.Item).
When an item is about to become buildable, it checks whether there are higher-priority
items still blocked. If so, it returns a non-null CauseOfBlockage to hold
the item back until those higher-priority items are also unblocked.
The priority check uses SimpleQueueComparator, which respects both
explicit user desires (arrow moves) and timestamp-based fallback ordering.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class hudson.model.queue.QueueTaskDispatcher
all, canTake, canTake
-
Constructor Details
-
PriorityEnforcingDispatcher
public PriorityEnforcingDispatcher()
-
-
Method Details
-
canRun
- Overrides:
canRunin classQueueTaskDispatcher
-