Currently, tasks remove themselves from the queue when they start. That's a problem if you start "hosting tasks" repeatedly or too quickly: the tasks will not have time to bootstrap properly and clear their status before the next time you run "hosting tasks".

I would expect the tasks dispatcher to change the status of the task when forking it and not expect the task itself to do it.

Comments

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new1.31 KB

Is it enough to move this into hosting.queues.inc in hosting_tasks_queue() just before the drush_backend_fork, away from drush_hosting_hosting_task_validate() in task.hosting.inc ?

Everything seems to still work, but I may misunderstand the problem and this might not be the solution. Please review the patch or checkout my relevant git branch

anarcat’s picture

Status: Needs review » Needs work

The problem with this patch is that it stops saving the task when starting (second chunk), and will create a new revision when dispatching (first chunk).

The proper fix is to set revision= false in both places and keep the save in the second chunk.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new497 bytes

Think this is ok?

anarcat’s picture

Status: Needs review » Needs work

Not quite: that doesn't actually remove the task...

anarcat’s picture

Status: Needs work » Fixed

I implemented a fix in CVS: basically, I moved the task edition completely in the queue dispatcher.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.