From 11fe79e50b58f1d0e88b9aa1f295abf57ab8dd3e Mon Sep 17 00:00:00 2001 From: Christophe Haen Date: Thu, 11 Dec 2025 12:41:13 +0100 Subject: [PATCH] feat (gfal2): set global timeout --- src/DIRAC/Resources/Storage/GFAL2_StorageBase.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/DIRAC/Resources/Storage/GFAL2_StorageBase.py b/src/DIRAC/Resources/Storage/GFAL2_StorageBase.py index 16fa7819095..f1137048330 100644 --- a/src/DIRAC/Resources/Storage/GFAL2_StorageBase.py +++ b/src/DIRAC/Resources/Storage/GFAL2_StorageBase.py @@ -53,6 +53,9 @@ MAX_SINGLE_STREAM_SIZE = 1024 * 1024 * 10 # 10MB MIN_BANDWIDTH = 0.5 * (1024 * 1024) # 0.5 MB/s +# Default timeout for any stat like call +DEFAULT_OPERATION_TIMEOUT = 10 + @contextmanager def setGfalSetting( @@ -169,6 +172,12 @@ def __init__(self, storageName: str, parameters: dict[str, str]): # It is only useful for TPC self.ctx.set_opt_boolean("HTTP PLUGIN", "RETRIEVE_BEARER_TOKEN", False) + # Set a global timeout for the operations + self.ctx.set_opt_integer("CORE", "NAMESPACE_TIMEOUT", DEFAULT_OPERATION_TIMEOUT) + # Because HTTP Plugin does not read the CORE:NAMESPACE_TIMEOUT as it should + # I also specify it here + self.ctx.set_opt_integer("HTTP PLUGIN", "OPERATION_TIMEOUT", DEFAULT_OPERATION_TIMEOUT) + # spaceToken used for copying from and to the storage element self.spaceToken = parameters.get("SpaceToken", "") # stageTimeout, default timeout to try and stage/pin a file