Do not perform git garbage collection after initial geo sync finds no repository
From https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/team/-/issues/4904#note_1907374735 (internal link) we found that FrameworkRepositorySyncService#sync_repository catches some "no repository" errors, but always does an execute_housekeeping
in the ensure block. This causes a Projects::GitGarbageCollectWorker
Sidekiq job to execute, which immediately fails when the repository is not there. This can cause noticeable levels of cosmetic Sidekiq job failures (over 5% observed in one example) which causes false positive alerts when using error ratio alerting.
The execute_housekeeping
function should not be called when earlier code has already positively identified that there is no repository. It may need to stay in the ensure block in case there are other un-caught exceptions that should still attempt to run housekeeping.