Merge branch '45456-improve-performance-of-cicd-jobs-request' into 'master'

Resolve "Concurrent requests to api/v4/jobs/request cause DB locks on ci_builds_metadata table"

Closes #45456

See merge request gitlab-org/gitlab-ce!18428
parents 4e64c9f4 33de3319
......@@ -162,7 +162,7 @@ module Ci
build.validates_dependencies! unless Feature.enabled?('ci_disable_validates_dependencies')
end
before_transition pending: :running do |build|
after_transition pending: :running do |build|
build.ensure_metadata.update_timeout_state
end
end
......
......@@ -2140,10 +2140,6 @@ describe Ci::Build do
it "doesn't save timeout_source" do
expect { run_job_without_exception }.not_to change { job.reload.ensure_metadata.timeout_source }
end
it 'raises an exception' do
expect { job.run! }.to raise_error(StateMachines::InvalidTransition)
end
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