Skip to content
Snippets Groups Projects

Retry CI trace archive if left in incomplete state

Merged Sean Arnold requested to merge 296616-continue-trace-archive-if-not-complete into master
All threads resolved!
+ 2
5
@@ -188,11 +188,7 @@ def unsafe_write!(mode, &blk)
@@ -188,11 +188,7 @@ def unsafe_write!(mode, &blk)
def unsafe_archive!
def unsafe_archive!
raise ArchiveError, 'Job is not finished yet' unless job.complete?
raise ArchiveError, 'Job is not finished yet' unless job.complete?
if trace_artifact
unsafe_trace_cleanup!
unsafe_trace_cleanup!
raise AlreadyArchivedError, 'Could not archive again' if already_archived?
end
if job.trace_chunks.any?
if job.trace_chunks.any?
Gitlab::Ci::Trace::ChunkedIO.new(job) do |stream|
Gitlab::Ci::Trace::ChunkedIO.new(job) do |stream|
@@ -224,6 +220,7 @@ def unsafe_trace_cleanup!
@@ -224,6 +220,7 @@ def unsafe_trace_cleanup!
if already_archived?
if already_archived?
# An archive already exists, so make sure to remove the trace chunks
# An archive already exists, so make sure to remove the trace chunks
erase_trace_chunks!
erase_trace_chunks!
 
raise AlreadyArchivedError, 'Could not archive again'
else
else
# An archive already exists, but its associated file is not complete, so remove it
# An archive already exists, but its associated file is not complete, so remove it
trace_artifact.destroy!
trace_artifact.destroy!
Loading