Closed aleclarson closed 6 years ago
It works fine if you assume a DELAYED
task will never come before a READY
task. But what if you put a task with a small delay in the queue after putting another task with a large delay? Of course, the READY
task will need to wait for the DELAYED
task to finish.
@nekufa clarified to me how index:pairs
works, so I'll close this now.
I opened an issue for the clarification to be added to the docs: https://github.com/tarantool/doc/issues/401
The
:take
method ofutubettl
does:pairs(state.READY, {iterator = 'GE'})
, which perhaps unexpectedly matches tasks withstate.DELAYED
because apparently'~' >= 'r' == true
.But it doesn't look like
utubettl:take
accounts for that scenario:https://github.com/tarantool/queue/blob/593c9f6f949c84865bcd383d542876ebbc93520a/queue/abstract/driver/utubettl.lua#L274-L291
We'll need a
t[2] == state.DELAYED
if statement wrapped around everything else, I think.