Skip to content

Commit 76cfbef

Browse files
committed
fix (DMS): ReplicateAndRegister checks SE status even for FTS
1 parent ddf0ec8 commit 76cfbef

File tree

2 files changed

+30
-31
lines changed

2 files changed

+30
-31
lines changed

src/DIRAC/DataManagementSystem/Agent/FTS3Agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def getFTS3Context(self, username, group, ftsServer, threadID):
169169

170170
log.debug(f"UserDN {userDN}")
171171

172-
# Chose a meaningfull proxy name for easier debugging
172+
# Chose a meaningful proxy name for easier debugging
173173
srvName = parse.urlparse(ftsServer).netloc.split(":")[0]
174174
proxyFile = os.path.join(
175175
self.workDirectory, f"{int(time.time())}_{username}_{group}_{srvName}_{threadID}.pem"

src/DIRAC/DataManagementSystem/Agent/RequestOperations/ReplicateAndRegister.py

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,35 @@ def __call__(self):
184184
if self.rmsMonitoring:
185185
self.rmsMonitoringReporter = MonitoringReporter(monitoringType="RMSMonitoring")
186186

187+
sourceSE = self.operation.SourceSE if self.operation.SourceSE else None
188+
if sourceSE:
189+
# check sourceSE for read
190+
bannedSource = self.checkSEsRSS(sourceSE, "ReadAccess")
191+
if not bannedSource["OK"]:
192+
if self.rmsMonitoring:
193+
for status in ["Attempted", "Failed"]:
194+
self.rmsMonitoringReporter.addRecord(self.createRMSRecord(status, len(self.operation)))
195+
self.rmsMonitoringReporter.commit()
196+
return bannedSource
197+
198+
if bannedSource["Value"]:
199+
self.operation.Error = f"SourceSE {sourceSE} is banned for reading"
200+
self.log.info(self.operation.Error)
201+
return S_OK(self.operation.Error)
202+
203+
# check targetSEs for write
204+
bannedTargets = self.checkSEsRSS()
205+
if not bannedTargets["OK"]:
206+
if self.rmsMonitoring:
207+
for status in ["Attempted", "Failed"]:
208+
self.rmsMonitoringReporter.addRecord(self.createRMSRecord(status, len(self.operation)))
209+
self.rmsMonitoringReporter.commit()
210+
return bannedTargets
211+
212+
if bannedTargets["Value"]:
213+
self.operation.Error = f"{','.join(bannedTargets['Value'])} targets are banned for writing"
214+
return S_OK(self.operation.Error)
215+
187216
# # check replicas first
188217
checkReplicas = self.__checkReplicas()
189218
if not checkReplicas["OK"]:
@@ -480,36 +509,6 @@ def fts3Transfer(self):
480509

481510
def dmTransfer(self, fromFTS=False):
482511
"""replicate and register using dataManager"""
483-
# # get waiting files. If none just return
484-
# # source SE
485-
sourceSE = self.operation.SourceSE if self.operation.SourceSE else None
486-
if sourceSE:
487-
# # check source se for read
488-
bannedSource = self.checkSEsRSS(sourceSE, "ReadAccess")
489-
if not bannedSource["OK"]:
490-
if self.rmsMonitoring:
491-
for status in ["Attempted", "Failed"]:
492-
self.rmsMonitoringReporter.addRecord(self.createRMSRecord(status, len(self.operation)))
493-
self.rmsMonitoringReporter.commit()
494-
return bannedSource
495-
496-
if bannedSource["Value"]:
497-
self.operation.Error = f"SourceSE {sourceSE} is banned for reading"
498-
self.log.info(self.operation.Error)
499-
return S_OK(self.operation.Error)
500-
501-
# # check targetSEs for write
502-
bannedTargets = self.checkSEsRSS()
503-
if not bannedTargets["OK"]:
504-
if self.rmsMonitoring:
505-
for status in ["Attempted", "Failed"]:
506-
self.rmsMonitoringReporter.addRecord(self.createRMSRecord(status, len(self.operation)))
507-
self.rmsMonitoringReporter.commit()
508-
return bannedTargets
509-
510-
if bannedTargets["Value"]:
511-
self.operation.Error = f"{','.join(bannedTargets['Value'])} targets are banned for writing"
512-
return S_OK(self.operation.Error)
513512

514513
# Can continue now
515514
self.log.verbose("No targets banned for writing")

0 commit comments

Comments
 (0)