Commit 07a584da authored by David Fernandez's avatar David Fernandez

Merge branch '341377-enable-idempotency-for-expire-job-cache-worker' into 'master'

Enable deduplication for ExpireJobCacheWorker

See merge request gitlab-org/gitlab!71199
parents 0335e0c4 43bbe885
...@@ -1427,7 +1427,7 @@ ...@@ -1427,7 +1427,7 @@
:urgency: :high :urgency: :high
:resource_boundary: :unknown :resource_boundary: :unknown
:weight: 3 :weight: 3
:idempotent: :idempotent: true
:tags: [] :tags: []
- :name: pipeline_cache:expire_pipeline_cache - :name: pipeline_cache:expire_pipeline_cache
:worker_name: ExpirePipelineCacheWorker :worker_name: ExpirePipelineCacheWorker
......
...@@ -10,11 +10,9 @@ class ExpireJobCacheWorker # rubocop:disable Scalability/IdempotentWorker ...@@ -10,11 +10,9 @@ class ExpireJobCacheWorker # rubocop:disable Scalability/IdempotentWorker
queue_namespace :pipeline_cache queue_namespace :pipeline_cache
urgency :high urgency :high
# This worker should be idempotent, but we're switching to data_consistency
# :sticky and there is an ongoing incompatibility, so it needs to be disabled for deduplicate :until_executing, including_scheduled: true
# now. The following line can be uncommented and this comment removed once idempotent!
# https://gitlab.com/gitlab-org/gitlab/-/issues/325291 is resolved.
# idempotent!
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def perform(job_id) def perform(job_id)
......
...@@ -13,6 +13,8 @@ RSpec.describe ExpireJobCacheWorker do ...@@ -13,6 +13,8 @@ RSpec.describe ExpireJobCacheWorker do
let(:job_args) { job.id } let(:job_args) { job.id }
it_behaves_like 'an idempotent worker'
it_behaves_like 'worker with data consistency', it_behaves_like 'worker with data consistency',
described_class, described_class,
data_consistency: :delayed data_consistency: :delayed
......
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