summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-06-26 09:07:44 +0700
committerShinya Maeda <shinya@gitlab.com>2019-06-28 10:25:57 +0700
commit9753a7d2882d7c8efce7b63674f36d78ae3edafb (patch)
treeb92e0cb56c5701aead41a79734b3234ca8edc549
parentb52e3b2d57e3c1bf9905f32aeb0e5428009440da (diff)
downloadgitlab-ce-set-higher-ttl-for-trace-write.tar.gz
Set higher TTL to write lock for tracesset-higher-ttl-for-trace-write
Set higher TTL is safer option when it comes to long running archive
-rw-r--r--changelogs/unreleased/set-higher-ttl-for-trace-write.yml5
-rw-r--r--lib/gitlab/ci/trace.rb2
-rw-r--r--spec/support/shared_examples/ci_trace_shared_examples.rb2
3 files changed, 7 insertions, 2 deletions
diff --git a/changelogs/unreleased/set-higher-ttl-for-trace-write.yml b/changelogs/unreleased/set-higher-ttl-for-trace-write.yml
new file mode 100644
index 00000000000..9f17172100c
--- /dev/null
+++ b/changelogs/unreleased/set-higher-ttl-for-trace-write.yml
@@ -0,0 +1,5 @@
+---
+title: Set higher TTL for write lock of trace to prevent concurrent archiving
+merge_request: 30064
+author:
+type: fixed
diff --git a/lib/gitlab/ci/trace.rb b/lib/gitlab/ci/trace.rb
index dfae260239e..ce5857965bf 100644
--- a/lib/gitlab/ci/trace.rb
+++ b/lib/gitlab/ci/trace.rb
@@ -5,7 +5,7 @@ module Gitlab
class Trace
include ::Gitlab::ExclusiveLeaseHelpers
- LOCK_TTL = 1.minute
+ LOCK_TTL = 10.minutes
LOCK_RETRIES = 2
LOCK_SLEEP = 0.001.seconds
diff --git a/spec/support/shared_examples/ci_trace_shared_examples.rb b/spec/support/shared_examples/ci_trace_shared_examples.rb
index f985b2dcbba..ab0550e2613 100644
--- a/spec/support/shared_examples/ci_trace_shared_examples.rb
+++ b/spec/support/shared_examples/ci_trace_shared_examples.rb
@@ -270,7 +270,7 @@ shared_examples_for 'common trace features' do
include ExclusiveLeaseHelpers
before do
- stub_exclusive_lease_taken("trace:write:lock:#{trace.job.id}", timeout: 1.minute)
+ stub_exclusive_lease_taken("trace:write:lock:#{trace.job.id}", timeout: 10.minutes)
end
it 'blocks concurrent archiving' do