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

Tasks ttl and ttr wrong behavior #146

Open
HejVkt opened this issue Jan 19, 2021 · 1 comment
Open

Tasks ttl and ttr wrong behavior #146

HejVkt opened this issue Jan 19, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@HejVkt
Copy link

HejVkt commented Jan 19, 2021

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
Copy link
Contributor

Yep. The bug in fifottl driver.
This can also be seen from the state diagram of the task.

@LeonidVas LeonidVas added the bug Something isn't working label Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants