提交 ba952d53 编写于 作者: K Kamil Trzciński

Merge branch 'revert-concurrent-pipeline-schedule-creation' into 'master'

Revert concurrent pipeline creation for pipeline schedules

See merge request gitlab-org/gitlab-ce!29794
...@@ -7,7 +7,18 @@ module Ci ...@@ -7,7 +7,18 @@ module Ci
# Otherwise, multiple pipelines could be created in a short interval. # Otherwise, multiple pipelines could be created in a short interval.
schedule.schedule_next_run! schedule.schedule_next_run!
RunPipelineScheduleWorker.perform_async(schedule.id, schedule.owner&.id) if Feature.enabled?(:ci_pipeline_schedule_async)
RunPipelineScheduleWorker.perform_async(schedule.id, schedule.owner&.id)
else
begin
RunPipelineScheduleWorker.new.perform(schedule.id, schedule.owner&.id)
ensure
##
# This is the temporary solution for avoiding the memory bloat.
# See more https://gitlab.com/gitlab-org/gitlab-ce/issues/61955
GC.start if Feature.enabled?(:ci_pipeline_schedule_force_gc, default_enabled: true)
end
end
end end
end end
end end
---
title: Revert concurrent pipeline creation for pipeline schedules
merge_request: 29794
author:
type: fixed
...@@ -25,6 +25,38 @@ describe Ci::PipelineScheduleService do ...@@ -25,6 +25,38 @@ describe Ci::PipelineScheduleService do
subject subject
end end
context 'when ci_pipeline_schedule_async feature flag is disabled' do
before do
stub_feature_flags(ci_pipeline_schedule_async: false)
end
it 'runs RunPipelineScheduleWorker synchronously' do
expect_next_instance_of(RunPipelineScheduleWorker) do |worker|
expect(worker).to receive(:perform).with(schedule.id, schedule.owner.id)
end
subject
end
it 'calls Garbage Collection manually' do
expect(GC).to receive(:start)
subject
end
context 'when ci_pipeline_schedule_force_gc feature flag is disabled' do
before do
stub_feature_flags(ci_pipeline_schedule_force_gc: false)
end
it 'does not call Garbage Collection manually' do
expect(GC).not_to receive(:start)
subject
end
end
end
context 'when owner is nil' do context 'when owner is nil' do
let(:schedule) { create(:ci_pipeline_schedule, project: project, owner: nil) } let(:schedule) { create(:ci_pipeline_schedule, project: project, owner: nil) }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册