tarantool / tarantool/queue

utubettl: possible bug with on_task_change?

Open
#100 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
244
Forks
56
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with process_neighbour in utubettl and trace the utube index lookup and on_task_change calls. Inspect how the framework uses the notified task and how priority is represented; done means determining whether the selected neighbour must be the lowest-priority READY task and recording the required behavior or change.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.