NuGetGallery: NuGet.Server background tasks causes nuget source to misbehave (the cache index file somehow gets corrupted)
Hi,
We’ve been struggling with an issue in the NuGet.Server repo/nuget package for a while now.
We push packages to our local nuget source quite frequently and we may push packages from several machines at any given time. But, every few days or so the cache index file gets corrupted (or so it seems) making package listing/download fail. Pushing new packages still works fine but we can’t list or download any existing packages from the nuget source.
To temporarily overcome the issue we found that we could simply delete the cache index file and recycle the application pool.
To permanently overcome the issue we hacked in the NuGet.Server code-base and disabled background tasks in the ServerPackageRepository by setting _runBackgroundTasks to false at: https://github.com/NuGet/NuGet.Server/blob/master/src/NuGet.Server/Infrastructure/ServerPackageRepository.cs#L56
It won’t fix the underlying issue but we’d really like an application setting to let us disable the background tasks without hacking in the code-base and building our own dll (as we don’t need the background tasks in the first place).
If you prefer a pull-request (for the application setting) we’d welcome some advice on how to proceed.
Thanks!
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 19 (10 by maintainers)
Commits related to this issue
- Keep track of whether the cache needs rebuilding This is in addition to always rebuilding when the cache is empty Fix https://github.com/NuGet/NuGetGallery/issues/3277 — committed to NuGet/NuGet.Server by joelverhagen 8 years ago
- Keep track of whether the cache needs rebuilding (#24) This is in addition to always rebuilding when the cache is empty Fix https://github.com/NuGet/NuGetGallery/issues/3277 — committed to NuGet/NuGet.Server by joelverhagen 8 years ago
- Keep track of whether the cache needs rebuilding (#24) This is in addition to always rebuilding when the cache is empty Fix https://github.com/NuGet/NuGetGallery/issues/3277 (cherry picked from commi... — committed to NuGet/NuGet.Server by joelverhagen 8 years ago
- Refactor ExpandedPackageRepository out of ServerPackageRepository (#26) Split a lot of logic out of ServerPackageRepository into another class so concerns are easier to understand Add testing around... — committed to NuGet/NuGet.Server by joelverhagen 7 years ago
@niklaskallander, don’t worry about answering any more of my information-gathering questions above. I found the issue 😌.
Im ok with leaving it in after we fix the bug