Closed
Description
The LibGit2Repo pool used to create a bunch of libgit2 repos and leave them open for the entire mount process. This needed to change for the packfile maintenance step to successfully delete packfiles. However, the way we dispose of the libgit2 repos on a timer affects performance in a bad way: it can take on the order of seconds to recreate one.
Instead of disposing on a timer, instead we should dispose when the packfile maintenance starts and recreate the repo after it is done. If a request comes in during the maintenance, then we should honor it and create a repo. This may cause a stale .idx file, but we log those and clean them up the next time. Further, this isolates the slow startup to at most once a day.
Activity