Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fts3
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Louis Regnier
fts3
Commits
d96b8e6a
Commit
d96b8e6a
authored
4 months ago
by
Louis Regnier
Browse files
Options
Downloads
Patches
Plain Diff
url_copy_split: review
parent
54779878
No related branches found
No related tags found
No related merge requests found
Pipeline
#8028955
failed with stages
Stage: build
Stage: test
in 6 minutes and 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/url-copy/UrlCopyProcess.cpp
+21
-20
21 additions, 20 deletions
src/url-copy/UrlCopyProcess.cpp
with
21 additions
and
20 deletions
src/url-copy/UrlCopyProcess.cpp
+
21
−
20
View file @
d96b8e6a
...
...
@@ -521,15 +521,15 @@ void UrlCopyProcess::runTransfer(Transfer &transfer, Gfal2TransferParams ¶ms
if
(
!
opts
.
strictCopy
&&
(
transfer
.
checksumMode
&
Transfer
::
CHECKSUM_SOURCE
))
{
try
{
src_checksum
=
gfal2
.
getChecksum
(
transfer
.
source
,
transfer
.
checksumAlgorithm
);
}
catch
(
const
Gfal2E
xception
&
ex
)
{
if
(
ex
.
code
()
!=
ENOSYS
&&
ex
.
code
()
!=
ENOTSUP
)
{
throw
UrlCopyError
(
TRANSFER
,
TRANSFER_PREPARATION
,
ex
);
}
}
catch
(
const
std
::
e
xception
&
ex
)
{
//
if (ex.code() != ENOSYS && ex.code() != ENOTSUP) {
//
throw UrlCopyError(TRANSFER, TRANSFER_PREPARATION, ex);
//
}
FTS3_COMMON_LOGGER_NEWLOG
(
WARNING
)
<<
"Checksum type "
<<
transfer
.
checksumAlgorithm
<<
" not supported by source.
Skip source check
."
<<
commit
;
src_checksum
.
clear
();
}
catch
(
const
std
::
exception
&
ex
)
{
<<
" not supported by source.
Aborting transfer..
."
<<
commit
;
//
src_checksum.clear();
//
} catch (const std::exception &ex) {
throw
UrlCopyError
(
TRANSFER
,
TRANSFER_PREPARATION
,
EINVAL
,
ex
.
what
());
};
...
...
@@ -550,8 +550,7 @@ void UrlCopyProcess::runTransfer(Transfer &transfer, Gfal2TransferParams ¶ms
if
(
ex
.
code
()
!=
ENOENT
)
throw
UrlCopyError
(
DESTINATION
,
TRANSFER_PREPARATION
,
ex
);
FTS3_COMMON_LOGGER_NEWLOG
(
DEBUG
)
<<
"Destination
\"
"
<<
transfer
.
destination
<<
"
\"
does not exist"
<<
commit
;
FTS3_COMMON_LOGGER_NEWLOG
(
INFO
)
<<
"Destination file does not exist!"
<<
commit
;
destination_exist
=
false
;
}
...
...
@@ -565,15 +564,17 @@ void UrlCopyProcess::runTransfer(Transfer &transfer, Gfal2TransferParams ¶ms
FTS3_COMMON_LOGGER_NEWLOG
(
DEBUG
)
<<
"File "
<<
transfer
.
destination
<<
" deleted with success (overwrite set)"
<<
commit
;
}
else
{
throw
UrlCopyError
(
TRANSFER
,
TRANSFER_PREPARATION
,
EEXIST
,
"The destination file exists"
" and overwrite is not enabled"
);
throw
UrlCopyError
(
TRANSFER
,
TRANSFER_PREPARATION
,
EEXIST
,
"
Destination file exists
and overwrite is not enabled"
);
}
}
else
{
auto
parent_path
=
std
::
filesystem
::
path
(
transfer
.
destination
.
fullUri
).
parent_path
().
string
();
gfal2
.
mkdir_recursive
(
params
,
parent_path
,
false
);
FTS3_COMMON_LOGGER_NEWLOG
(
DEBUG
)
<<
"Destination does not exist, checking if the parent "
"directory exists..."
<<
commit
;
}
const
std
::
filesystem
::
path
dest_path
=
std
::
filesystem
::
path
(
transfer
.
destination
.
fullUri
);
/*
const std::filesystem::path dest_path = std::filesystem::path(transfer.destination.fullUri);
if (!dest_path.has_parent_path()) {
throw UrlCopyError(TRANSFER, TRANSFER_PREPARATION, EINVAL, "Could not get the parent "
"directory of " + transfer.destination.fullUri);
...
...
@@ -598,7 +599,7 @@ void UrlCopyProcess::runTransfer(Transfer &transfer, Gfal2TransferParams ¶ms
};
FTS3_COMMON_LOGGER_NEWLOG(DEBUG) << "Created parent directory : "
<< dest_path.parent_path() << commit;
}
}
*/
// Transfer
FTS3_COMMON_LOGGER_NEWLOG
(
DEBUG
)
<<
"Starting transfer"
<<
commit
;
...
...
@@ -620,17 +621,16 @@ void UrlCopyProcess::runTransfer(Transfer &transfer, Gfal2TransferParams ¶ms
FTS3_COMMON_LOGGER_NEWLOG
(
DEBUG
)
<<
"Destination file removed"
<<
commit
;
}
else
{
FTS3_COMMON_LOGGER_NEWLOG
(
DEBUG
)
<<
"The transfer clean-up has been "
"manully disabled"
<<
commit
;
"manu
a
lly disabled"
<<
commit
;
}
}
else
{
// Should only get here due to a race condition at the storage level
FTS3_COMMON_LOGGER_NEWLOG
(
DEBUG
)
<<
"The transfer failed because the file exists."
<<
" Do not clean!"
<<
commit
;
}
if
(
timeoutExpired
)
{
throw
UrlCopyError
(
TRANSFER
,
TRANSFER
,
ETIMEDOUT
,
ex
.
what
());
}
throw
UrlCopyError
(
TRANSFER
,
TRANSFER
,
ex
);
int
errc
=
(
timeoutExpired
?
ETIMEDOUT
:
ex
.
code
());
throw
UrlCopyError
(
TRANSFER
,
TRANSFER
,
errc
,
ex
.
what
());
}
catch
(
const
std
::
exception
&
ex
)
{
throw
UrlCopyError
(
TRANSFER
,
TRANSFER
,
EINVAL
,
ex
.
what
());
}
...
...
@@ -646,13 +646,14 @@ void UrlCopyProcess::runTransfer(Transfer &transfer, Gfal2TransferParams ¶ms
throw
UrlCopyError
(
TRANSFER
,
TRANSFER_PREPARATION
,
EINVAL
,
ex
.
what
());
};
if
(
!
src_checksum
.
empty
())
{
//
if (!src_checksum.empty()) {
if
(
!
compare_checksum
(
src_checksum
,
dst_checksum
))
{
throw
UrlCopyError
(
TRANSFER
,
TRANSFER_FINALIZATION
,
EIO
,
"Source and destination "
+
transfer
.
checksumAlgorithm
+
" checksum do not match "
+
"("
+
src_checksum
+
" != "
+
dst_checksum
+
")"
);
}
}
else
if
(
!
user_checksum
.
empty
())
{
// } else
if
(
!
user_checksum
.
empty
())
{
if
(
!
compare_checksum
(
transfer
.
checksumValue
,
dst_checksum
))
{
throw
UrlCopyError
(
TRANSFER
,
TRANSFER_FINALIZATION
,
EIO
,
"User-defined and destination "
+
transfer
.
checksumAlgorithm
+
" checksum do not match "
+
"("
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment