anchor.diff:      % Backtrack through the task dependency graph and get the runnable
       % tasks from all the tasks that need to be re-run.
       {TaskIdsToRun, S1} = collect_runnable_deps(GenTaskId, FailingHosts, S),
  -    do_submit_tasks(re_run, TaskIdsToRun, S1).
  +    do_submit_tasks(re_run, TaskIdsToRun, S1, ?FAILURES_ALLOWED).
   
   -spec task_complete(task_id(), host(), [task_output()], state()) -> state().
   task_complete(TaskId, Host, Outputs, #state{tasks      = Tasks,
  
positive.code: -include("pipeline.hrl").
  -include("job_coordinator.hrl").
  
  -define(TASK_SUBMIT_TIMEOUT, 30000).
  -define(DISCO_SERVER_TIMEOUT, 30000).
  
  % In theory we could keep the HTTP connection pending until the job
  % finishes but in practice long-living HTTP connections are a bad
  
negative.code: handle_cast({stage_done, Stage}, S) ->
      {noreply, do_stage_done(Stage, S)};
  handle_cast({submit_tasks, Mode, Tasks}, S) ->
      {noreply, do_submit_tasks(Mode, Tasks, S, ?FAILURES_ALLOWED)};
  handle_cast({submit_tasks, Mode, Tasks, NFailuresAllowed}, S) ->
      {noreply, do_submit_tasks(Mode, Tasks, S, NFailuresAllowed)};
  handle_cast({task_done, TaskId, Host, Results}, S) ->
      {noreply, do_task_done(TaskId, Host, Results, S)};
  handle_cast(pipeline_done, #state{jobinfo = #jobinfo{jobname = JobName}} = S) ->
  