twitter-archive / kestrel

simple, distributed message queue system (inactive)
http://twitter.github.io/kestrel
Other
2.78k stars 313 forks source link

Queue age only updated when a dequeue happens #105

Closed eric closed 11 years ago

eric commented 12 years ago

I've noticed if a lot of enqueues are done with no dequeues, the queue age stat is not updated.

It would be nice if it always reflected the current age of the head of the queue instead of only on remove.

zuercher commented 12 years ago

Master has a change that partially fixes this. Instead of updating the age per remove, it now tracks the timestamp of the last removed item and computes the age when requested (by stats or otherwise).

Still doesn't reflect the true age of the head of the queue, so if you remove a very old item and then stop reading for a while it will report a larger age than is strictly true. I'll look into peeking at the head.

eric commented 12 years ago

This solution is definitely preferable — I would much rather err on the side of it being older than it really is than be newer to allow for alerting based on the age.

eric commented 12 years ago

Would it be possible to get a build with 8c95afc03f748aae948f8347723d04ab6087d84b in it?

zuercher commented 11 years ago

this is 2.3.4