summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/trace/chunked_io.rb
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-07-18 16:22:46 +0700
committerShinya Maeda <shinya@gitlab.com>2019-07-23 17:26:08 +0700
commitc2e0e689f355555db231ac6db40ab1b654c90233 (patch)
tree1ab8b2e6561598a61a10a0197a975019ed13f464 /lib/gitlab/ci/trace/chunked_io.rb
parent1a3fda63a5f9756cde19bc7e221651b0c33cb5dc (diff)
downloadgitlab-ce-c2e0e689f355555db231ac6db40ab1b654c90233.tar.gz
Validate the existence of archived traces before removing live tracesafe-archiving-for-traces
Often live traces are removed even though the archived trace doesn't exist. This commit checkes the existence strictly.
Diffstat (limited to 'lib/gitlab/ci/trace/chunked_io.rb')
-rw-r--r--lib/gitlab/ci/trace/chunked_io.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab/ci/trace/chunked_io.rb b/lib/gitlab/ci/trace/chunked_io.rb
index 8c6fd56493f..e99889f4a25 100644
--- a/lib/gitlab/ci/trace/chunked_io.rb
+++ b/lib/gitlab/ci/trace/chunked_io.rb
@@ -166,6 +166,13 @@ module Gitlab
end
def destroy!
+ # TODO: Remove this logging once we confirmed new live trace architecture is functional.
+ # See https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/4667.
+ unless build.has_archived_trace?
+ Sidekiq.logger.warn(message: 'The job does not have archived trace but going to be destroyed.',
+ job_id: build.id)
+ end
+
trace_chunks.fast_destroy_all
@tell = @size = 0
ensure