Closed (fixed)
Project:
Hosting
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Apr 2015 at 20:27 UTC
Updated:
26 Jun 2016 at 19:44 UTC
Jump to comment: Most recent
At some point we moved to creating a new task node for each instance of a task being triggered. The 'Cancel' function doesn't work, however. The mechanism, in hosting_task_cancel(), appears to be adding a task with an error status. Presumably, this is intended to update the existing task, and thus block it from executing. This no longer works. The result of clicking the 'Cancel' button, is now to just insert a cancelled task into the queue. It does not update the existing task. So we end up with a pending task, followed by a cancelled/error task of the same type.
Comments
Comment #1
ergonlogicThis looks like it was a bug in
hosting_get_most_recent_task(), where it never returned an existing task. This appears to be why we create new task nodes every time we trigger a task now.I believe that "fixing"
hosting_get_most_recent_task()might be detrimental, as Views, among other things now assume a task node per instance of the task being run. Still, I think the previous functionality makes sense resource-wise. Having a new node, rather than just a revision, every time a task is triggered might be overkill...Comment #2
ergonlogicAfter experimenting with moving back to a single node per task (per site/platform/server), I think this is a dead-end. Essentially, with our task lists, we can either have a single entry per task per site/platform/server, or every revision, which ends up including each stage of a task (queued then completed/cancelled/...) We could try to add a Views filter to remove certain 'queued' revisions, or somehow link 'queued' revisions to their results, but that basically re-invents the node-based system we have now.
Comment #4
ergonlogicSo yeah... node per task instance makes everything much easier. This is fixed by just updating the task $node->task_status. I also took this opportunity to flag cancellations as 'warnings' rather than errors.
Comment #5
ergonlogicComment #8
helmo commentedRemoving the hosting_get_most_recent_task function led to a failure in the Hosting Site Backup Manager... #2755693: Call to undefined function hosting_get_most_recent_task
I've restored that function now. http://cgit.drupalcode.org/hosting/commit/task/hosting_task.module?id=31...