Commit 9f985393 authored by Stan Hu's avatar Stan Hu

Fix exception handling when a concurrent backup fails

If a concurrent backup encounters an exception, we should allow the
current threads to run to completion instead of aborting the whole
backup. This was causing threads to leak outside of the tests in
https://gitlab.com/gitlab-org/gitlab/-/issues/241251 and causing the
query cache to be enabled.

This also reverts the quarantined spec in
f47a2f17.

Closes https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40451
parent b86db507
---
title: Fix exception handling when a concurrent backup fails
merge_request: 40451
author:
type: fixed
...@@ -182,12 +182,12 @@ module Backup ...@@ -182,12 +182,12 @@ module Backup
queue.push(project) queue.push(project)
end end
raise errors.pop unless errors.empty?
ensure
queue.close queue.close
ActiveSupport::Dependencies.interlock.permit_concurrent_loads do ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
threads.each(&:join) threads.each(&:join)
end end
raise errors.pop unless errors.empty?
end end
def dump_project(project) def dump_project(project)
......
...@@ -19,7 +19,7 @@ RSpec.describe Backup::Repository do ...@@ -19,7 +19,7 @@ RSpec.describe Backup::Repository do
end end
end end
describe '#dump', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/241251' do describe '#dump' do
before do before do
allow(Gitlab.config.repositories.storages).to receive(:keys).and_return(storage_keys) allow(Gitlab.config.repositories.storages).to receive(:keys).and_return(storage_keys)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment