From efc9f72c9ffaa76f966b8c162a9d184d7aa1ff18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Fri, 28 Jun 2019 10:39:08 +0000 Subject: Merge branch 'set-higher-ttl-for-trace-write' into 'master' Set higher TTL to write lock for traces See merge request gitlab-org/gitlab-ce!30064 (cherry picked from commit 5ee5b280b05f63768f359d0b82d5edd490c0e7cd) 9753a7d2 Set higher TTL to write lock for traces --- changelogs/unreleased/set-higher-ttl-for-trace-write.yml | 5 +++++ lib/gitlab/ci/trace.rb | 2 +- spec/support/shared_examples/ci_trace_shared_examples.rb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/set-higher-ttl-for-trace-write.yml 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 -- cgit v1.2.1