Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
647106fe
Commit
647106fe
authored
Jul 04, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check if trace exists before process `archive!` method
parent
9bf810a9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
6 deletions
+4
-6
app/workers/archive_trace_worker.rb
app/workers/archive_trace_worker.rb
+1
-1
app/workers/ci/archive_traces_cron_worker.rb
app/workers/ci/archive_traces_cron_worker.rb
+2
-4
lib/gitlab/background_migration/archive_legacy_traces.rb
lib/gitlab/background_migration/archive_legacy_traces.rb
+1
-1
No files found.
app/workers/archive_trace_worker.rb
View file @
647106fe
...
@@ -6,7 +6,7 @@ class ArchiveTraceWorker
...
@@ -6,7 +6,7 @@ class ArchiveTraceWorker
def
perform
(
job_id
)
def
perform
(
job_id
)
Ci
::
Build
.
find_by
(
id:
job_id
).
try
do
|
job
|
Ci
::
Build
.
find_by
(
id:
job_id
).
try
do
|
job
|
job
.
trace
.
archive!
job
.
trace
.
archive!
unless
build
.
job_artifacts_trace
end
end
end
end
end
end
app/workers/ci/archive_traces_cron_worker.rb
View file @
647106fe
...
@@ -11,10 +11,8 @@ module Ci
...
@@ -11,10 +11,8 @@ module Ci
# More details in https://gitlab.com/gitlab-org/gitlab-ce/issues/36791
# More details in https://gitlab.com/gitlab-org/gitlab-ce/issues/36791
Ci
::
Build
.
finished
.
with_live_trace
.
find_each
(
batch_size:
100
)
do
|
build
|
Ci
::
Build
.
finished
.
with_live_trace
.
find_each
(
batch_size:
100
)
do
|
build
|
begin
begin
build
.
trace
.
archive!
build
.
trace
.
archive!
unless
build
.
job_artifacts_trace
rescue
ArchiveError
=>
e
rescue
=>
e
next
if
e
.
message
.
include?
(
'Already archived'
)
failed_archive_counter
.
increment
failed_archive_counter
.
increment
Rails
.
logger
.
error
"Failed to archive stale live trace. id:
#{
build
.
id
}
message:
#{
e
.
message
}
"
Rails
.
logger
.
error
"Failed to archive stale live trace. id:
#{
build
.
id
}
message:
#{
e
.
message
}
"
end
end
...
...
lib/gitlab/background_migration/archive_legacy_traces.rb
View file @
647106fe
...
@@ -13,7 +13,7 @@ module Gitlab
...
@@ -13,7 +13,7 @@ module Gitlab
::
Ci
::
Build
.
finished
.
without_archived_trace
::
Ci
::
Build
.
finished
.
without_archived_trace
.
where
(
id:
start_id
..
stop_id
).
find_each
do
|
build
|
.
where
(
id:
start_id
..
stop_id
).
find_each
do
|
build
|
begin
begin
build
.
trace
.
archive!
build
.
trace
.
archive!
unless
build
.
job_artifacts_trace
rescue
=>
e
rescue
=>
e
Rails
.
logger
.
error
"Failed to archive live trace. id:
#{
build
.
id
}
message:
#{
e
.
message
}
"
Rails
.
logger
.
error
"Failed to archive live trace. id:
#{
build
.
id
}
message:
#{
e
.
message
}
"
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment