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

mig5 - October 18, 2009 - 01:11
Status:active» needs review

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

AttachmentSize
593536_task_queue_removal.patch 1.31 KB

#2

anarcat - October 22, 2009 - 23:43
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.

#3

mig5 - October 23, 2009 - 00:31
Status:needs work» needs review

Think this is ok?

AttachmentSize
593536_task_queue_removal_1.patch 497 bytes

#4

anarcat - October 24, 2009 - 02:47
Status:needs review» needs work

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

#5

anarcat - October 24, 2009 - 02:55
Status:needs work» fixed

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

#6

System Message - November 7, 2009 - 03:00
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.