migrate crates-io-index handling to async using threads for the actual work #2973
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After stumbling onto some strange
request::blockingerrors 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
Indexstruct, 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
gixhas the same issues thatlibgit2had, 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 usecrates-index-diffat all. It's usingcrates-indexto 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.