On 26/03/13 09:02, Adam Murdoch wrote:

On 26/03/2013, at 7:34 PM, Adam Murdoch <[email protected] <mailto:[email protected]>> wrote:


On 22/03/2013, at 12:32 PM, Marcin Erdmann <[email protected] <mailto:[email protected]>> wrote: - I have no idea on how to achieve skipping dependencies of a finalising task when the finalising task should be skipped - it gets really tricky as those dependencies might be made mandatory by making the finalising task mandatory after being added to the graph…

Add them all as finalisers of the target task when you're traversing the graph down from a finaliser task - that is, a dependency of a finaliser of task A is itself a finaliser of A.

Actually, this doesn't work for shared dependencies, as there's also an ordering constraint on a finaliser. We can tweak it so that we split finaliser relationships up into 2 parts: the ordering part which is the same as a soft dependency, and the triggering part that switches the task state to `must run`. The dependencies of a finaliser don't pick up the ordering part, but they do pick up the triggering part.



- Modify DefaultTaskExecutionPlan to go into "finaliser task mode only" after a task failure not handled by failureHandler; if in that mode then getNextReadyAndMatching() would use a Spec that only allows finaliser tasks, and (I don't know how to achieve that) finaliser task dependencies

I would split the `ready` state into several: `should run` and `must run` and `should not run`. The entry tasks and any task with an incoming hard dependency will be in `should run`. A finaliser task starts off as `should not run` and is switched to `must run` once any of the tasks that it finalises is executed. Before the first failure, the execution plan runs tasks in `should run` and `must run` state. Following a failure, it runs only tasks in `must run` state and continues until there are no such tasks left.
This should be easy to achieve. The only trick here will be how to put all finaliser dependencies that are not in the graph already to `should not run` and to mark all finaliser dependencies as finalisers. With that it should be easy to mark all tasks that are finalisers for the executed task that did any work from `should not run` to `must run`. Currently if there is a failure all tasks in `ready` state are set to `skipped`, the only change will be to now skip all in `should run` and `should not run` states.

Reply via email to