Tasks ttl and ttr wrong behavior
HejVkt opened this issue · 1 comments
HejVkt commented
When we put a task with ttl and ttr set, it behaves incorrectly.
Example:
queue = require 'queue'
queue.create_tube('test_ttr', 'fifottl')
queue.tube.test_ttr:put('foobar', {ttr=100, ttl=5})
queue.tube.test_ttr:take(0)
----- Wait six seconds
queue.tube.test_ttr:ack(0)
- error: Task was not taken in the session
I think this behavior is due to the fact that the task was removed from the queue after ttl = 5 seconds.
But in my opinion, when the task was taken, it should has a new ttl in the queue = remaining time + ttr
Something like that 3+100 and it should ack() correctly without error within 103 seconds
LeonidVas commented
Yep. The bug in fifottl driver.
This can also be seen from the state diagram of the task.