gitserver: mark potential corrupt repos based on stderr
Created by: keegancsmith
There are cases were repos become corrupted, but we don't detect them since it only happens when trying to read specific objects. For a few weeks we added some stderr logging/parsing on Sourcegraph.com and investigated all errors reported. This commit contains a whitelist of error messages which could point to repository corruption.
When we believe a repository is corrupted we mark it as corrupt. The reclone janitor job will then reclone the repository. The janitor job runs regularly (every minute by default), which means we will quickly converge to a fixed uncorrupted repository. Note: we prefer cloning to expensive git gc/repack operations.
Fixes https://github.com/sourcegraph/sourcegraph/issues/6676