Skip to content

Commit

Permalink
Rename notifyLargeData method. Minor text message changes
Browse files Browse the repository at this point in the history
  • Loading branch information
khurtado committed Feb 15, 2022
1 parent 1cd9eb1 commit f8407e4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/python/WMCore/MicroService/MSTransferor/MSTransferor.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def execute(self, reqStatus):
except Exception as ex:
success = False
self.alertUnknownTransferError(wflow.getName())
msg = "Unknown exception while making transfer request for %s " % wflow.getName()
msg = "\tError: %s" % str(ex)
self.logger.exception(msg)
if success:
Expand Down Expand Up @@ -729,7 +730,7 @@ def makeTransferRucio(self, wflow, dataIn, subLevel, blocks, dataSize, nodes, no
self.logger.info("Rules successful created for %s : %s", dataIn['name'], res)
transferId.update(res)
# send an alert, if needed
self.notifyLargeData(aboveWarningThreshold, transferId, wflow.getName(), dataSize, dataIn)
self.alertLargeInputData(aboveWarningThreshold, transferId, wflow.getName(), dataSize, dataIn)
else:
self.logger.error("Failed to create rule for %s, will retry later", dids)
success = False
Expand Down Expand Up @@ -770,18 +771,16 @@ def alertUnknownTransferError(self, workflowName):
alertName = "{}: Transfer request error. Workflow: {}".format(self.alertServiceName,
workflowName)
alertSeverity = "high"
alertSummary = "[MSTransferor] Unknown exception while making Transfer Request."
alertSummary = "[MSTransferor] Unknown exception while making transfer request."
alertDescription = "Unknown exception while making Transfer request for workflow: {}".format(workflowName)
self.sendAlert(alertName, alertSeverity, alertSummary, alertDescription,
self.alertServiceName)
msg = "Unknown exception while making Transfer Request for %s " % wflow.getName()
self.logger.exception(alertDescription)

def alertTransferCouchDBError(self, workflowName):
"""
Send alert to Prometheus with CouchDB transfer error
"""
alertName = "{}: Transfer document error posting to CouchDB. Workflow: {}".format(self.alertServiceName,
alertName = "{}: Failed to create a transfer document in CouchDB for workflow: {}".format(self.alertServiceName,
workflowName)
alertSeverity = "high"
alertSummary = "[MSTransferor] Transfer document could not be created in CouchDB."
Expand All @@ -791,7 +790,7 @@ def alertTransferCouchDBError(self, workflowName):
self.logger.warning(alertDescription)


def notifyLargeData(self, aboveWarningThreshold, transferId, wflowName, dataSize, dataIn):
def alertLargeInputData(self, aboveWarningThreshold, transferId, wflowName, dataSize, dataIn):
"""
Evaluates whether the amount of data placed is too big, if so, send an alert
notification to a few persons
Expand Down

0 comments on commit f8407e4

Please sign in to comment.