queue icon indicating copy to clipboard operation
queue copied to clipboard

utubettl: possible bug with on_task_change?

Open iskandarov-egor opened this issue 6 years ago • 0 comments

When releasing/deleting a task in utubettl, the code finds a "neighbour" task - a task with the same utube field that is in READY state. It then notifies the framework that this neighbour task is now available for taking, by calling on_task_change.

local function process_neighbour(self, task, operation)
    self:on_task_change(task, operation)
    if task ~= nil then
        local neighbour = self.space.index.utube:min{state.READY, task[i_utube]}
        if neighbour ~= nil and neighbour[i_status] == state.READY then
            self:on_task_change(neighbour)
        end
    end
    return task
end

A possible bug is that this neighbour task may not be the one with the lowest priority, because the priority field not in the "utube" index. Currently, the framework wakes up a consumer fiber, but does not look at the particular task being passed to on_task_change, so it doesn't matter.

Is this a bug?

iskandarov-egor avatar Sep 19 '19 16:09 iskandarov-egor