Skip to content

Commit 0f73d61

Browse files
authored
Merge pull request #7296 from chaen/excBulk
[v8.0] fix (ElasticSearchDB): convert exception object to string representation and FTS3 lifetime changes
2 parents 16769a7 + 322af86 commit 0f73d61

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/DIRAC/Core/Utilities/ElasticSearchDB.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def bulk_index(self, indexPrefix, data=None, mapping=None, period="day", withTim
503503
res = bulk(client=self.client, index=indexName, actions=generateDocs(data, withTimeStamp))
504504
except (BulkIndexError, RequestError) as e:
505505
sLog.exception()
506-
return S_ERROR(e)
506+
return S_ERROR(f"Failed to index by bulk {e!r}")
507507

508508
if res[0] == len(data):
509509
# we have inserted all documents...

src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@
4848
AGENT_NAME = "DataManagement/FTS3Agent"
4949

5050
# Lifetime in seconds of the proxy we download for submission
51-
PROXY_LIFETIME = 43200 # 12 hours
51+
# Because we force the redelegation if only a third is left,
52+
# and we want to have a quiet night (~12h)
53+
# let's make the lifetime 12*3 hours
54+
PROXY_LIFETIME = 36 * 3600 # 36 hours
5255

5356
# Instead of querying many jobs at once,
5457
# which maximizes the possibility of race condition

src/DIRAC/DataManagementSystem/Client/FTS3Job.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -763,15 +763,13 @@ def generateContext(ftsServer, ucert, lifetime=25200):
763763
# decides that there is not enough timeleft.
764764
# At the moment, this is 1 hour, which effectively means that if you do
765765
# not submit a job for more than 1h, you have no valid proxy in FTS servers
766-
# anymore. In future release of FTS3, the delegation will be triggered when
766+
# anymore, and all the jobs failed. So we force it when
767767
# one third of the lifetime will be left.
768768
# Also, the proxy given as parameter might have less than "lifetime" left
769769
# since it is cached, but it does not matter, because in the FTS3Agent
770770
# we make sure that we renew it often enough
771-
# Finally, FTS3 has an issue with handling the lifetime of the proxy,
772-
# because it does not check all the chain. This is under discussion
773-
# https://its.cern.ch/jira/browse/FTS-1575
774-
fts3.delegate(context, lifetime=datetime.timedelta(seconds=lifetime))
771+
td_lifetime = datetime.timedelta(seconds=lifetime)
772+
fts3.delegate(context, lifetime=td_lifetime, delegate_when_lifetime_lt=td_lifetime // 3)
775773

776774
return S_OK(context)
777775
except FTS3ClientException as e:

src/DIRAC/DataManagementSystem/ConfigTemplate.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ Agents
155155
KickAssignedHours = 1
156156
# Max number of kicks per cycle
157157
KickLimitPerCycle = 100
158-
# Lifetime in sec of the Proxy we download to delegate to FTS3 (default 12h)
159-
ProxyLifetime = 43200
158+
# Lifetime in sec of the Proxy we download to delegate to FTS3 (default 36h)
159+
ProxyLifetime = 129600
160160
}
161161
##END FTS3Agent
162162
}

0 commit comments

Comments
 (0)