diff options
Diffstat (limited to 'app/workers/projects/git_garbage_collect_worker.rb')
-rw-r--r-- | app/workers/projects/git_garbage_collect_worker.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/workers/projects/git_garbage_collect_worker.rb b/app/workers/projects/git_garbage_collect_worker.rb index cf236f8b660..d16583975fc 100644 --- a/app/workers/projects/git_garbage_collect_worker.rb +++ b/app/workers/projects/git_garbage_collect_worker.rb @@ -16,7 +16,15 @@ module Projects def before_gitaly_call(task, resource) return unless gc?(task) - ::Projects::GitDeduplicationService.new(resource).execute + # Don't block garbage collection if we can't fetch into an object pool + # due to some gRPC error because we don't want to accumulate cruft. + # See https://gitlab.com/gitlab-org/gitaly/-/issues/4022. + begin + ::Projects::GitDeduplicationService.new(resource).execute + rescue Gitlab::Git::CommandTimedOut, GRPC::Internal => e + Gitlab::ErrorTracking.track_exception(e) + end + cleanup_orphan_lfs_file_references(resource) end |