Skip to content

Conversation

@syphar
Copy link
Member

@syphar syphar commented Nov 2, 2025

After stumbling onto some strange request::blocking errors while working on #2972 I felt like I want to be safer here. I think this is somehow related to #2937, or some update? In any case it is broken on master, so this fix blocks me deploying.

So I feel much more comfortable when we would just provide an Index struct, with only async methods, that internally uses separate threads instead of tokio's main worker or blocking threads. Neither is built for CPU load.

We're only doing the index-check every minute or so, and only once at a time, so it would probably ok-ish to use the blocking worker pool. But: then I could define the thread-name.

Also I want to see if gix has the same issues that libgit2 had, I assume it doesn't (See #847), so I migrated to keeping the repo object.

On top of that, I also moved the crates() method, which doesn't use crates-index-diff at all. It's using crates-index to get the full list of crates, and is only used in the consistency check. So I moved it there.

note

From the last all-hands there is some pending discussion / some pending changes around how we receive these events, for now we keep the git index.

@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Nov 2, 2025
@syphar syphar self-assigned this Nov 2, 2025
@syphar syphar marked this pull request as ready for review November 2, 2025 15:23
@syphar syphar requested a review from a team as a code owner November 2, 2025 15:23
@syphar
Copy link
Member Author

syphar commented Nov 3, 2025

Thinking again about this, I assume gix stuff is rather CPU bound, so using the tokio threadpools is not so good.

@syphar syphar marked this pull request as draft November 3, 2025 06:28
@syphar syphar changed the title migrate crates-io-index handling to async with spawn_blocking migrate crates-io-index handling to async using threads for the actual work Nov 3, 2025
@syphar syphar marked this pull request as ready for review November 4, 2025 08:42
@GuillaumeGomez
Copy link
Member

Thanks!

@GuillaumeGomez GuillaumeGomez merged commit fb84acf into rust-lang:master Nov 4, 2025
10 checks passed
@GuillaumeGomez GuillaumeGomez deleted the rewrite-index branch November 4, 2025 09:54
@github-actions github-actions bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Nov 4, 2025
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants