Closed rtsisyk closed 5 years ago
take() degrades to O(N^2) complexity where N is the number of expired tasks:
https://github.com/tarantool/queue/blob/3adda75efab42c8bf437cb554c81d269cfe1b27e/queue/abstract/driver/fifottl.lua#L265-L275 Affects Cloud.
I have received numerous complains about this, without exact trace to the root cause.
Let's fix asap.
-- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.org - www.twitter.com/kostja_osipov
I reproduced it under following conditions:
I put my laptop into sleep mode while it was about 50k tuples in fifottl tube and 10 fibers were constantly taking tasks from it from another instance over a net box connection.
I woke up laptop after ttl was already expired for all tasks and noticed that:
take() degrades to O(N^2) complexity where N is the number of expired tasks:
https://github.com/tarantool/queue/blob/3adda75efab42c8bf437cb554c81d269cfe1b27e/queue/abstract/driver/fifottl.lua#L265-L275
Affects Cloud.