Skip to content

Commit

Permalink
Reaper : Introduce configurable timeout for deletion : Closes #4908
Browse files Browse the repository at this point in the history
  • Loading branch information
cserf authored and bari12 committed Oct 18, 2021
1 parent 9e36e46 commit 7deecd1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/rucio/rse/protocols/gfal.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
if os.environ['RUCIO_CLIENT_MODE']:
raise exception.MissingDependency('Missing dependency : gfal2')

TIMEOUT = config.config_get('deletion', 'timeout', False, None)


class Default(protocol.RSEProtocol):
""" Implementing access to RSEs using the srm protocol."""
Expand Down Expand Up @@ -207,6 +209,14 @@ def connect(self):
self.__ctx.set_opt_boolean("XROOTD PLUGIN", "NORMALIZE_PATH", False)
if self.auth_token:
self.__ctx.set_opt_string("BEARER", "TOKEN", self.auth_token)
if TIMEOUT:
try:
timeout = int(TIMEOUT)
self.__ctx.set_opt_integer("HTTP PLUGIN", "OPERATION_TIMEOUT", timeout)
self.__ctx.set_opt_integer("SRM PLUGIN", "OPERATION_TIMEOUT", timeout)
self.__ctx.set_opt_integer("GSIFTP PLUGIN", "OPERATION_TIMEOUT", timeout)
except ValueError:
self.logger(logging.ERROR, 'wrong timeout value %s', TIMEOUT)

def get(self, path, dest, transfer_timeout=None):
"""
Expand Down

0 comments on commit 7deecd1

Please sign in to comment.