Skip to content

Fix yield func in historical enqueuer, also a bug report for infinite looping frames

Administrator requested to merge insights-yield-bug into main

Created by: arussellsaw

@mrnugget and i were debugging some gitserver CPU usage issues and noticed a small bug in the yield func meaning it wouldn't yield as much as expected, eg:

we want to run at most every 100ms
do something, it takes 5ms
sleep for 5ms // the bug is here
reset interval
iterate

instead:

we want to run at most every 100ms
do something, it takes 5ms
sleep for 100ms - 5ms
reset interval
iterate

However i still think there is an unresolved bug here it seems like the enqueuer never stops re-enqueueing all frames, eg once a full 52 weeks are processed, it loops back to the beginning and starts again.

you can see this below where 2020 loops back to 2021 and we start processing frames again.

Screenshot 2021-03-12 at 09 08 41

right now this is manifesting as gitserver spawning git log & git rev-list commands in a tight loop permanently, eating a CPU core and spending a lot of time doing GC. I'll also raise this in a separate issue & ref here.

https://user-images.githubusercontent.com/5236823/110919270-f7351300-8313-11eb-8cba-db6d067534ba.mov

Merge request reports

Loading