Skip to content

Conversation

@syphar
Copy link
Member

@syphar syphar commented Dec 5, 2025

Until there is an automation I regularly remove the local archive file cache. #2971 was a first step towards building that automated cleanup job.

But this time this cleaning actually lead to docs.rs being down.

I couldn't really reproduce it locally, but IMO the reason is likely my locking structure, most likely the .write locks queueing up when the local cache is empty.

The optimization here is: only use a lock to block for writes.
potential reads just wait until the file exists if there is already a writer downloading the index.

Also we treat broken index as "missing index", so hopefully won't have any problems.

Another optimization is that I pre-allocate the dashmap, since we know we'll add a bunch of entries.

@syphar syphar requested a review from a team as a code owner December 5, 2025 09:09
@syphar syphar self-assigned this Dec 5, 2025
@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Dec 5, 2025
@syphar
Copy link
Member Author

syphar commented Dec 5, 2025

( CI failures because cloudflare is down)

@syphar syphar merged commit 2dad36b into rust-lang:main Dec 5, 2025
15 of 24 checks passed
@syphar syphar deleted the storage-lock branch December 5, 2025 11:23
@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 Dec 5, 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 Dec 5, 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