-
Notifications
You must be signed in to change notification settings - Fork 212
Crate owner based build backoff #1532
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
Comments
Quoting my own post:
|
I don't know the exact CPU-share config, but: we already have a hard limit of 15 minutes build-time (with some exceptions) |
Yup, this is a way of dealing with actors that use more than their fair share, without stopping them entirely. Basically, if a crate is built very fast, its CPU share will be high, and it will get through the queue quickly. However, if a build takes a long time, it eventually ends up being given lower priority (not zero priority), so it will eventually finish, but it won't slow down small & fast crates. |
@ckaran your idea only works if multiple builds are run in parallel, because cpu-share is just a percentage of CPU and has no meaning in absolute terms. But they aren't; builds are run one at a time until completion, so the CPU-share has no effect at all. |
Also, to anyone visiting this post from internals, please reread @pietroalbini's write-up of why we are not currently dedicating time to making the build queue more fair: https://internals.rust-lang.org/t/docs-rs-build-prioritization/15511/13?u=jyn514 |
My apologies! I thought the build system was run concurrently, if not, then you're right, this won't work at all... |
I second this. Because of the way cargo works, a breaking change of So if swc uses many slots in the build queue, it means a breaking change of some important upstream crate and showing docs for the old version is perfectly fine. |
Really big releases can swamp the build queue and make normal people wait hours for their crate to get built and manual de-prioritization requires human intervention, so some sort of owner-based backoff would be a good automatic solution.
The basic idea is that if over
n
crates with the same owner are present within the build queue at the same time,x0
of their crates get the-1
priority level,x1
crates get the-2
priority level, ad nausea.Basically, it gradually pushes back more and more crates based on how many an owner is currently building so that it's fair to everyone, the owner still gets some of their crates built within a timely manner and all of the normal people get pushed to the front of the line.
It also prevents the (terrifying) scenario where two or more biggies are published at the same time, so instead of the first to publish getting all of their crates built and the latter ones waiting hours for any of their crates to build, they both actually get some crates built within a reasonable time span.
Additionally, it also doesn't punish big publishers who just want to make a patch release of some sort, if
people-who-publish-50-crates-at-a-time
want to do a one-off random release for a patch or something they aren't permanently in a de-prioritized state even though they've only released one single crate (opposed to the manual de-prioritization where they are unconditionally pushed back in the queue)The text was updated successfully, but these errors were encountered: