Skip to content
Merged
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: 1 addition & 1 deletion queue/abstract/driver/fifottl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ local function fifottl_fiber(self)
while true do
if not box.cfg.read_only then
local stat, err = pcall(fifottl_fiber_iteration, self, processed)
if not stat and not err.code == box.error.READONLY then
if not stat and not (err.code == box.error.READONLY) then
log.error("error catched: %s", tostring(err))
log.error("exiting fiber '%s'", fiber.name())
return 1
Expand Down
19 changes: 18 additions & 1 deletion t/020-fifottl.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local fiber = require('fiber')

local test = require('tap').test()
test:plan(14)
test:plan(15)

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

-- gh-96: infinite loop after dropping a tube with a burried task
test:test('buried task in a dropped queue', function(test)
test:plan(1)

local TASK_ID = 1
local tube = queue.create_tube('test_drop_with_burried', 'fifottl',
{ttr = 0.1, if_not_exist = true})

tube:put({foo = 'bar'})
local task = tube:take(0)
tube:bury(task[TASK_ID])

tube:drop()
fiber.sleep(0.2)
test:ok(true, 'queue does not hang')
end)


tnt.finish()
os.exit(test:check() == true and 0 or -1)
Expand Down