Skip to content

error in tube_release_all_tasks() #121

Closed
@iskandarov-egor

Description

@iskandarov-egor

a question about the following function from abstract.lua:

local function tube_release_all_tasks(tube)
    local prefix = ('queue: [tube "%s"] '):format(tube.name)

    -- We lean on stable iterators in this function.
    -- https://github.com/tarantool/tarantool/issues/1796
    if not qc.check_version({1, 7, 5}) then
        log.error(prefix .. 'no stable iterator support: skip task releasing')
        log.error(prefix .. 'some tasks may stuck in taken state perpetually')
        log.error(prefix .. 'update tarantool to >= 1.7.5 or take the risk')
    end

    log.info(prefix .. 'releasing all taken task (may take a while)')
    local released = 0
    for _, task in tube.raw:tasks_by_state(state.TAKEN) do
        tube.raw:release(task[1])
        released = released + 1
    end
    log.info(prefix .. ('released %d tasks'):format(released))
end

this line tube.raw:release(task[1]) leads to an error:
queue/abstract/driver/fifottl.lua:306: attempt to index local 'opts' (a nil value)
because the call to release() is missing the opts argument.

also, it seems that the version check branch is missing a return statement.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions