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
8cfb72c3
Commit
8cfb72c3
authored
May 19, 2021
by
George Koltsov
Committed by
Douglas Barbosa Alexandre
May 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not raise during archive size validation when wait thread is finished
parent
32ae1801
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
lib/gitlab/import_export/decompressed_archive_size_validator.rb
...tlab/import_export/decompressed_archive_size_validator.rb
+10
-1
spec/lib/gitlab/import_export/decompressed_archive_size_validator_spec.rb
...import_export/decompressed_archive_size_validator_spec.rb
+8
-0
No files found.
lib/gitlab/import_export/decompressed_archive_size_validator.rb
View file @
8cfb72c3
...
...
@@ -32,7 +32,16 @@ module Gitlab
Timeout
.
timeout
(
TIMEOUT_LIMIT
)
do
stdin
,
stdout
,
stderr
,
wait_thr
=
Open3
.
popen3
(
command
,
pgroup:
true
)
stdin
.
close
pgrp
=
Process
.
getpgid
(
wait_thr
[
:pid
])
# When validation is performed on a small archive (e.g. 100 bytes)
# `wait_thr` finishes before we can get process group id. Do not
# raise exception in this scenario.
pgrp
=
begin
Process
.
getpgid
(
wait_thr
[
:pid
])
rescue
Errno
::
ESRCH
nil
end
status
=
wait_thr
.
value
if
status
.
success?
...
...
spec/lib/gitlab/import_export/decompressed_archive_size_validator_spec.rb
View file @
8cfb72c3
...
...
@@ -24,6 +24,14 @@ RSpec.describe Gitlab::ImportExport::DecompressedArchiveSizeValidator do
it
'returns true'
do
expect
(
subject
.
valid?
).
to
eq
(
true
)
end
context
'when waiter thread no longer exists'
do
it
'does not raise exception'
do
allow
(
Process
).
to
receive
(
:getpgid
).
and_raise
(
Errno
::
ESRCH
)
expect
(
subject
.
valid?
).
to
eq
(
true
)
end
end
end
context
'when file exceeds allowed decompressed size'
do
...
...
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