Skip to content

Commit 399dd7d

Browse files
DerekBumoleg-jukovec
authored andcommitted
utubettl: remove extra sleep from utubettl_fiber
Also restored sleep timeout in tests to its previous value: https://github.com/tarantool/queue/blob/f900aeb0cfb29eae496f98158f6e3a681d3497eb/t/040-utubettl.t#L94 Closes #233
1 parent f6c0770 commit 399dd7d

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Fixed
11+
12+
- Too long timings in the `utubettl` driver (#223)
13+
814
## [1.4.0] - 2024-05-20
915

1016
The release introduces an experimental `storage_mode` option for the `utube`

queue/abstract/driver/utubettl.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,12 @@ local function utubettl_fiber(self)
305305
elseif stat then
306306
processed = err
307307
end
308-
end
309-
310-
if self.sync_chan:get(0.1) ~= nil then
311-
log.info("Queue utubettl fiber was stopped")
312-
break
308+
else
309+
-- When switching the master to the replica, the fiber will be stopped.
310+
if self.sync_chan:get(0.1) ~= nil then
311+
log.info("Queue utubettl fiber was stopped")
312+
break
313+
end
313314
end
314315
end
315316
end

t/040-utubettl.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ test:test('ttr put/take', function(test)
123123
local my_queue = queue.create_tube('trr_test', 'utubettl', { engine = engine })
124124
test:ok(my_queue:put('ttr1', { ttr = 1 }), 'put ttr task')
125125
test:ok(my_queue:take(0.1) ~= nil, 'take this task')
126-
fiber.sleep(1.5)
126+
fiber.sleep(1.1)
127127
local task = my_queue:peek(0)
128128
test:is(task[2], state.READY, 'Ready state returned after one second')
129129

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

0 commit comments

Comments
 (0)