Skip to content
  • anarcat's avatar
    do not save the task in hosting-tasks, only in hosting-task · 1d56fc98
    anarcat authored and anarcat's avatar anarcat committed
    we are already saving the task in hosting-task. the reason why we were
    saving in both places was to avoid a race condition where a task would
    be started *while* the dispatcher would restart, which is very unlikely,
    and was still possible with the existing code anyways.
    
    now the checks are done only in hosting-task. it's more possible to have
    a conflicting concurrent run of a task, but both runs would need to
    start at about the same time so that the _validate() drush hooks would
    run in parallel and both would check and save the task status at once.
    
    i consider this too unlikely to desserve the current hack.
    
    furthermore, the problem with the current code was that if the
    hosting-task command was interrupted (for example through
    provision_init() load checks) before it was able to save the status, we
    end up with zombie tasks that are marked as running but that are gone
    from the process table (because they never started properly).
    1d56fc98