-
Bug
-
Resolution: Unresolved
-
Minor
-
None
The QueueListener.onLeft listener callback sounds useful, except when it is called you cannot use LeftItem.getExecutable()—it is always null (even for a build which was not canceled).
Queue.onStartExecuting is called, which triggers the listener. Immediately afterward, WorkUnit.setExecutable is called, but that is too late for the listener.
The fix would presumably be to have onStartExecuting return its LeftItem, and make Executor.run be responsible for calling QueueListener.onLeft in this case. (The other case is Queue.cancel.)
Or perhaps it suffices to call Queue.onStartExecuting after WorkUnit.setExecutable. Unclear if that is safe; onStartExecuting also removes the BuildableItem from pendings, and is synchronized, so maybe that would introduce a race condition.