summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-07-06 13:20:02 +0000
committer🤖 GitLab Bot 🤖 <gitlab-bot@gitlab.com>2019-07-06 13:20:40 +0000
commit3cc51eda848e8a2fa78bdac85a1d1c9d748e28e8 (patch)
treeac41d8efc22c8e3c6b4f17571710ea70862f608d
parenta01c10ac4ad3087c54e43d171b2c65bc9e7328d5 (diff)
downloadgitlab-ce-12-1-auto-deploy-0011586.tar.gz
Merge branch 'sh-disable-reactive-caching-automatic-retries' into 'master'12-1-auto-deploy-0011586
Prevent amplification of ReactiveCachingWorker jobs upon failures Closes #64176 See merge request gitlab-org/gitlab-ce!30432 (cherry picked from commit 162ef51fdb49bc49d194d7f62549e6203ebb6d51) a28844ea Prevent amplification of ReactiveCachingWorker jobs upon failures
-rw-r--r--app/models/concerns/reactive_caching.rb2
-rw-r--r--changelogs/unreleased/sh-disable-reactive-caching-automatic-retries.yml5
-rw-r--r--spec/models/concerns/reactive_caching_spec.rb5
3 files changed, 9 insertions, 3 deletions
diff --git a/app/models/concerns/reactive_caching.rb b/app/models/concerns/reactive_caching.rb
index 6c3962b4c4f..5b3880f94ba 100644
--- a/app/models/concerns/reactive_caching.rb
+++ b/app/models/concerns/reactive_caching.rb
@@ -178,7 +178,7 @@ module ReactiveCaching
def enqueuing_update(*args)
yield
- ensure
+
ReactiveCachingWorker.perform_in(self.class.reactive_cache_refresh_interval, self.class, id, *args)
end
end
diff --git a/changelogs/unreleased/sh-disable-reactive-caching-automatic-retries.yml b/changelogs/unreleased/sh-disable-reactive-caching-automatic-retries.yml
new file mode 100644
index 00000000000..a0db68adb78
--- /dev/null
+++ b/changelogs/unreleased/sh-disable-reactive-caching-automatic-retries.yml
@@ -0,0 +1,5 @@
+---
+title: Prevent amplification of ReactiveCachingWorker jobs upon failures
+merge_request: 30432
+author:
+type: performance
diff --git a/spec/models/concerns/reactive_caching_spec.rb b/spec/models/concerns/reactive_caching_spec.rb
index 7faa196623f..e2ab9ddd4a5 100644
--- a/spec/models/concerns/reactive_caching_spec.rb
+++ b/spec/models/concerns/reactive_caching_spec.rb
@@ -206,8 +206,9 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do
expect(read_reactive_cache(instance)).to eq("preexisting")
end
- it 'enqueues a repeat worker' do
- expect_reactive_cache_update_queued(instance)
+ it 'does not enqueue a repeat worker' do
+ expect(ReactiveCachingWorker)
+ .not_to receive(:perform_in)
expect { go! }.to raise_error("foo")
end