Skip to content

Commit

Permalink
Add try/except block for fetching PartialCopy parameter from camapign…
Browse files Browse the repository at this point in the history
… configuration.
  • Loading branch information
todor-ivanov committed Dec 7, 2022
1 parent a293975 commit 19d50d6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/python/WMCore/MicroService/MSMonitor/MSMonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,18 @@ def getCompletedWorkflows(self, transfers, campaigns):
# check completion of all transfers
statuses = []
for transfer in record['transfers']:
cdict = campaigns[transfer['campaignName']]
try:
cdict = campaigns[transfer['campaignName']]
partialCopy = cdict['PartialCopy']
except Exception as ex:
# Just log the error and stop checking any further transfers for the current request.
status = 0
statuses.append(status)
msg = "Missing or broken campaign configuration at ReqMgr for request: %s. Error: %s"
self.logger.exception(msg, reqName, str(ex))
break
# compare against the last completion number, which is from the last cycle execution
if transfer['completion'][-1] >= cdict['PartialCopy'] * 100:
if transfer['completion'][-1] >= partialCopy * 100:
status = 1
else:
status = 0
Expand Down

0 comments on commit 19d50d6

Please sign in to comment.