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

Most upvoted comments

@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