tasks should be removed from the queue when started, not bootstrapped
anarcat - October 1, 2009 - 20:58
| Project: | Hosting |
| Version: | 6.x-0.4-alpha1 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
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.

#1
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
#2
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.
#3
Think this is ok?
#4
Not quite: that doesn't actually remove the task...
#5
I implemented a fix in CVS: basically, I moved the task edition completely in the queue dispatcher.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.