Skip to content

Commit

Permalink
Merge pull request #11387 from todor-ivanov/bugfix_MSMonitor_missingC…
Browse files Browse the repository at this point in the history
…ampaigns_fix-11386

Add try/except block for fetching PartialCopy parameter from campaign configuration.
  • Loading branch information
amaltaro authored Dec 7, 2022
2 parents f313eac + 19d50d6 commit 02b1a0c
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 02b1a0c

Please sign in to comment.