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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
8eb2cef0
Commit
8eb2cef0
authored
Apr 14, 2021
by
Vladimir Shushlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update logger to be structured for pages migration
parent
63bc19ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
app/services/pages/migrate_from_legacy_storage_service.rb
app/services/pages/migrate_from_legacy_storage_service.rb
+6
-6
No files found.
app/services/pages/migrate_from_legacy_storage_service.rb
View file @
8eb2cef0
...
...
@@ -23,7 +23,7 @@ module Pages
@queue
.
close
@logger
.
info
(
"
Waiting for threads to finish..."
)
@logger
.
info
(
message:
"Pages legacy storage migration:
Waiting for threads to finish..."
)
migration_threads
.
each
(
&
:join
)
{
migrated:
@migrated
,
errored:
@errored
}
...
...
@@ -58,12 +58,12 @@ module Pages
migrate_project
(
project
)
end
@logger
.
info
(
"
#{
@migrated
}
projects are migrated successfully,
#{
@errored
}
projects failed to be migrated"
)
@logger
.
info
(
message:
"Pages legacy storage migration: batch processed"
,
migrated:
@migrated
,
errored:
@errored
)
rescue
=>
e
# This method should never raise exception otherwise all threads might be killed
# and this will result in queue starving (and deadlock)
Gitlab
::
ErrorTracking
.
track_exception
(
e
)
@logger
.
error
(
"
failed processing a batch:
#{
e
.
message
}
"
)
@logger
.
error
(
message:
"Pages legacy storage migration:
failed processing a batch:
#{
e
.
message
}
"
)
end
def
migrate_project
(
project
)
...
...
@@ -75,15 +75,15 @@ module Pages
end
if
result
[
:status
]
==
:success
@logger
.
info
(
"project_id:
#{
project
.
id
}
#{
project
.
pages_path
}
has been migrated in
#{
time
.
round
(
2
)
}
seconds:
#{
result
[
:message
]
}
"
)
@logger
.
info
(
message:
"Pages legacy storage migration: project migrated"
,
project_id:
project
.
id
,
pages_path:
project
.
pages_path
,
duration:
time
.
round
(
2
)
)
@counters_lock
.
synchronize
{
@migrated
+=
1
}
else
@logger
.
error
(
"project_id:
#{
project
.
id
}
#{
project
.
pages_path
}
failed to be migrated in
#{
time
.
round
(
2
)
}
seconds:
#{
result
[
:message
]
}
"
)
@logger
.
error
(
message:
"Pages legacy storage migration: project failed to be migrated"
,
project_id:
project
.
id
,
pages_path:
project
.
pages_path
,
duration:
time
.
round
(
2
)
)
@counters_lock
.
synchronize
{
@errored
+=
1
}
end
rescue
=>
e
@counters_lock
.
synchronize
{
@errored
+=
1
}
@logger
.
error
(
"project_id:
#{
project
&
.
id
}
#{
project
&
.
pages_path
}
failed to be migrated:
#{
e
.
message
}
"
)
@logger
.
error
(
message:
"Pages legacy storage migration: project failed to be migrated"
,
project_id:
project
&
.
id
,
pages_path:
project
&
.
pages_path
)
Gitlab
::
ErrorTracking
.
track_exception
(
e
,
project_id:
project
&
.
id
)
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