Skip to content
Snippets Groups Projects

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

Merged Warren Gifford 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
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Created by: sourcegraph-bot

    Notifying subscribers in CODENOTIFY files for diff 137900d6616006edd67098001ff315f94bee29c0...648aa210d09039afe12312c30c0a98e1f294590c.

    Notify File(s)
    @felixfbecker enterprise/internal/insights/background/historical_enqueuer.go
    enterprise/internal/insights/background/historical_enqueuer_test.go
    @slimsag enterprise/internal/insights/background/historical_enqueuer.go
    enterprise/internal/insights/background/historical_enqueuer_test.go
Please register or sign in to reply
Loading