Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
(#256).
- `kick()` left a transaction open when the `utube` tube had no buried tasks
(#256).
- The `utubettl` driver could accumulate tasks in the status `READY` without
deleting (#261).

## [1.5.0] - 2026-07-10

Expand Down
2 changes: 1 addition & 1 deletion queue/abstract/driver/utubettl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ function method.release(self, id, opts)
else
task = self.space:update(id, {
{ '=', i_status, state.READY },
{ '=', i_next_event, util.time(task[i_created] + task[i_ttl]) }
{ '=', i_next_event, task[i_created] + task[i_ttl] }
})

if self.ready_space_mode and task ~= nil then
Expand Down
17 changes: 16 additions & 1 deletion t/040-utubettl.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local yaml = require('yaml')
local fiber = require('fiber')

local test = (require('tap')).test()
test:plan(18)
test:plan(19)

local queue = require('queue')
local state = require('queue.abstract.state')
Expand Down Expand Up @@ -394,6 +394,21 @@ test:test('ttl after delay test', function(test)
test:is(task.ttr, TTR * 1000000, 'check TTR after release')
end)

test:test('test task deleted after release and ttl', function(test)
local TTL = 1
test:plan(2)
box.cfg{}
local tube = queue.create_tube('test_delete_after_release', 'utubettl', { if_not_exists = true })
tube:put({'test_task'}, {ttl = TTL, ttr = 10})
local task = tube:take(.1)
test:ok(task ~= nil, 'task was taken')
if task == nil then return end
tube:release(task[1]) -- No delay.

fiber.sleep(TTL + 0.3)
test:is(tube:take(.1), nil, 'task must be deleted by TTL after release without delay')
end)
Comment thread
oleg-jukovec marked this conversation as resolved.

test:test('Get tasks by state test', function(test)
test:plan(2)
local tube = queue.create_tube('test_task_it', 'utubettl')
Expand Down
Loading