From 322af86906aad80432104be76fdd02ccee723848 Mon Sep 17 00:00:00 2001 From: Christophe Haen Date: Fri, 17 Nov 2023 10:09:04 +0100 Subject: [PATCH] feat (FTS3): change the default proxy lifetime to 36h --- src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py | 5 ++++- src/DIRAC/DataManagementSystem/Client/FTS3Job.py | 4 ++-- src/DIRAC/DataManagementSystem/ConfigTemplate.cfg | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py b/src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py index 3b59495578b..4151a3fffb8 100644 --- a/src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py +++ b/src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py @@ -48,7 +48,10 @@ AGENT_NAME = "DataManagement/FTS3Agent" # Lifetime in seconds of the proxy we download for submission -PROXY_LIFETIME = 43200 # 12 hours +# Because we force the redelegation if only a third is left, +# and we want to have a quiet night (~12h) +# let's make the lifetime 12*3 hours +PROXY_LIFETIME = 36 * 3600 # 36 hours # Instead of querying many jobs at once, # which maximizes the possibility of race condition diff --git a/src/DIRAC/DataManagementSystem/Client/FTS3Job.py b/src/DIRAC/DataManagementSystem/Client/FTS3Job.py index 450b729134d..94f3e4b021a 100644 --- a/src/DIRAC/DataManagementSystem/Client/FTS3Job.py +++ b/src/DIRAC/DataManagementSystem/Client/FTS3Job.py @@ -763,13 +763,13 @@ def generateContext(ftsServer, ucert, lifetime=25200): # decides that there is not enough timeleft. # At the moment, this is 1 hour, which effectively means that if you do # not submit a job for more than 1h, you have no valid proxy in FTS servers - # anymore, and all the jobs failed.So we force it when + # anymore, and all the jobs failed. So we force it when # one third of the lifetime will be left. # Also, the proxy given as parameter might have less than "lifetime" left # since it is cached, but it does not matter, because in the FTS3Agent # we make sure that we renew it often enough td_lifetime = datetime.timedelta(seconds=lifetime) - fts3.delegate(context, lifetime=td_lifetime, delegate_when_lifetime_lt=td_lifetime / 3) + fts3.delegate(context, lifetime=td_lifetime, delegate_when_lifetime_lt=td_lifetime // 3) return S_OK(context) except FTS3ClientException as e: diff --git a/src/DIRAC/DataManagementSystem/ConfigTemplate.cfg b/src/DIRAC/DataManagementSystem/ConfigTemplate.cfg index 24c177d253d..406f9d90bc7 100644 --- a/src/DIRAC/DataManagementSystem/ConfigTemplate.cfg +++ b/src/DIRAC/DataManagementSystem/ConfigTemplate.cfg @@ -155,8 +155,8 @@ Agents KickAssignedHours = 1 # Max number of kicks per cycle KickLimitPerCycle = 100 - # Lifetime in sec of the Proxy we download to delegate to FTS3 (default 12h) - ProxyLifetime = 43200 + # Lifetime in sec of the Proxy we download to delegate to FTS3 (default 36h) + ProxyLifetime = 129600 } ##END FTS3Agent }