Skip to content

Commit ddf0ec8

Browse files
committed
fix (FTS3Agent): use meaningful name for proxy paths
1 parent 51ef0b7 commit ddf0ec8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
1414
"""
1515
import errno
16+
import os
17+
from urllib import parse
1618
import time
1719

1820
# from threading import current_thread
@@ -108,6 +110,8 @@ def initialize(self):
108110
# name that will be used in DB for assignment tag
109111
self.assignmentTag = gethostname().split(".")[0]
110112

113+
self.workDirectory = self.am_getWorkDirectory()
114+
111115
res = self.__readConf()
112116

113117
# We multiply by two because of the two threadPools
@@ -165,13 +169,19 @@ def getFTS3Context(self, username, group, ftsServer, threadID):
165169

166170
log.debug(f"UserDN {userDN}")
167171

172+
# Chose a meaningfull proxy name for easier debugging
173+
srvName = parse.urlparse(ftsServer).netloc.split(":")[0]
174+
proxyFile = os.path.join(
175+
self.workDirectory, f"{int(time.time())}_{username}_{group}_{srvName}_{threadID}.pem"
176+
)
177+
168178
# We dump the proxy to a file.
169179
# It has to have a lifetime of self.proxyLifetime
170180
# Because the FTS3 servers cache it for 2/3rd of the lifetime
171181
# we should make our cache a bit less than 2/3rd of the lifetime
172182
cacheTime = int(2 * self.proxyLifetime / 3) - 600
173183
res = gProxyManager.downloadVOMSProxyToFile(
174-
userDN, group, requiredTimeLeft=self.proxyLifetime, cacheTime=cacheTime
184+
userDN, group, requiredTimeLeft=self.proxyLifetime, cacheTime=cacheTime, filePath=proxyFile
175185
)
176186
if not res["OK"]:
177187
return res

0 commit comments

Comments
 (0)