Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utubettl: remove extra sleep from utubettl_fiber #234

Merged
merged 1 commit into from
May 21, 2024
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Too long timings in the `utubettl` driver (#223)

## [1.4.0] - 2024-05-20

The release introduces an experimental `storage_mode` option for the `utube`
Expand Down
11 changes: 6 additions & 5 deletions queue/abstract/driver/utubettl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,12 @@ local function utubettl_fiber(self)
elseif stat then
processed = err
end
end

if self.sync_chan:get(0.1) ~= nil then
log.info("Queue utubettl fiber was stopped")
break
else
-- When switching the master to the replica, the fiber will be stopped.
if self.sync_chan:get(0.1) ~= nil then
log.info("Queue utubettl fiber was stopped")
break
end
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions t/040-utubettl.t
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ test:test('ttr put/take', function(test)
local my_queue = queue.create_tube('trr_test', 'utubettl', { engine = engine })
test:ok(my_queue:put('ttr1', { ttr = 1 }), 'put ttr task')
test:ok(my_queue:take(0.1) ~= nil, 'take this task')
fiber.sleep(1.5)
fiber.sleep(1.1)
local task = my_queue:peek(0)
test:is(task[2], state.READY, 'Ready state returned after one second')

Expand All @@ -132,7 +132,7 @@ test:test('ttr put/take', function(test)
{ engine = engine, storage_mode = queue.driver.utubettl.STORAGE_MODE_READY_BUFFER })
test:ok(my_queue_ready:put('ttr1', { ttr = 1 }), 'put ttr task')
test:ok(my_queue_ready:take(0.1) ~= nil, 'take this task')
fiber.sleep(1.5)
fiber.sleep(1.1)
local task = my_queue_ready:peek(0)
test:is(task[2], state.READY, 'Ready state returned after one second')
end
Expand Down
Loading