Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Super Catchup Async Loop #10237

Merged
merged 1 commit into from
Feb 14, 2022
Merged

Conversation

nholland94
Copy link
Member

In my thread timing work. I found that a particular async loop in the super catchup downloader was starving other jobs in the scheduler. The loop checks for a condition, waits for a signals related to events that may make that condition true, and then restarts. The issue was that the signals it was using to wait before checking again were based on pipes having messages. This is buggy because a pipe having a message is not the same as an event firing on the reader side of the message, which is what the code was assuming.

I added a Bvar.t to the module to use as a proper event signaling primitive. This took the CPU usage of catchup down from 90%+ all the time (even when no catchup jobs were queued) to nearly 0% while no catchup jobs are running. Catchup still takes nearly 100% CPU during the initial catchup after bootstrap, but almost all of this time is spent building breadcrumbs instead of in the downloader module.

@nholland94 nholland94 requested a review from a team as a code owner February 14, 2022 16:44
@nholland94 nholland94 added the ci-build-me Add this label to trigger a circle+buildkite build for this branch label Feb 14, 2022
Copy link
Member

@imeckler imeckler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

@nholland94 nholland94 merged commit 60fabf0 into compatible Feb 14, 2022
@nholland94 nholland94 deleted the fix/super-catchup-async-loop branch February 14, 2022 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants