-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #4478 - alexcrichton:less-fds, r=matklad
Periodically gc repos in Cargo This commit is targeted at improving the long-term management of git checkouts and git repositories. Currently every time data is fetched from crates.io libgit2 will create a new pack file in the repository. These pack files accumulate over time and end up causing pathological behavior if there's lots of them, causing libgit2 to open many file descriptors all at once, possibly blowing the system's file descriptor limits. To alleviate this problem you typically run `git gc`, but libgit2 doesn't have this implemented. Instead what Cargo now does is detect this situation and run literally the command line tool `git gc` in a best-effort attempt to compact the repo. Failing that, for example when git isn't installed, Cargo will remove the entire repo and do a full checkout again. At the same time this commit also generalizes this logic, plus the existing fast path github logic, to all git repositories and not just the index. That way all git repositories can benefit from the "github fast path" as well as the compaction steps. Closes #4403
- Loading branch information
Showing
5 changed files
with
308 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.