Skip to content

Commit 3f4ea28

Browse files
committed
fix (DMS): workaround for gfal2 not respecting parameter timeout when downloading a file with HTTPs
1 parent 607214f commit 3f4ea28

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/DIRAC/Resources/Storage/GFAL2_StorageBase.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,13 @@ def _getSingleFile(self, src_url: str, dest_file: str, disableChecksum: bool = F
473473
# gfal2 needs a protocol to copy local which is 'file:'
474474
if not dest_file.startswith("file://"):
475475
dest = f"file://{os.path.abspath(dest_file)}"
476-
self.ctx.filecopy(params, src_url, dest)
476+
477+
# We can remove the context manager when https://its.cern.ch/jira/browse/DMC-1371
478+
# is solved
479+
# The problem is gfal2 not respecting the parameter timeout
480+
with setGfalSetting(self.ctx, "HTTP PLUGIN", "OPERATION_TIMEOUT", params.timeout):
481+
self.ctx.filecopy(params, src_url, dest)
482+
477483
if useChecksum:
478484
# gfal2 did a checksum check, so we should be good
479485
return sourceSize

0 commit comments

Comments
 (0)