AWS Thinkbox Discussion Forums

Feature Request: Remove all job errors from specific slave

Hi guys. I was thinking it would be great to have a feature that removes all errors from all jobs from a specific slave. For example, I have a list of about 5 machines that all had some sort of corrupt files that prevented Max from loading correctly, and therefore a bunch of jobs received errors from these machines. I have since fixed these machines and wish to have these errors disappear because they are no longer an issue and contribute to the loss of weight throughout the farm. As it stands now, I would have to go to each job, highlight the errors generated by these slaves and remove them manually. I think it would be great to have a feature that let’s me right-click on an error in the Job Reports panel, or right-click on a slave in the Slaves Panel, and then click on “Delete Reports” -> “Delete All Job Error Reports From Slave.” This would then go through every job and remove the errors generated from the slaves I’ve got selected.

I’ve tried going to the slaves panel and clicking on “Delete All Reports,” but the reports on the jobs themselves remain unaffected.

As a side note, if this is possible, is it also possible to do the same thing, but to remove the slave from all of the jobs’ “Bad Slaves List?”

We can add this to the wish list. However, with the way information is currently stored in the database, this would be an expensive operation. Basically, every single report in the database would have to be checked to see if it’s slave name matches, and currently there is not an index built for the slave name in the report object.

What we could probably do in the meantime is add some script API functions to delete reports. Then you could write a slave right-click script that would do this.

Cheers,
Ryan

In RC3, there will be new RepositoryUtils functions to delete reports from jobs. So a right-click slave script like this should do the trick.

Cheers,
Ryan

from System.IO import *
from Deadline.Scripting import *

from DeadlineUI.Controls.Scripting.DeadlineScriptDialog import DeadlineScriptDialog

import traceback

def __main__():
    jobsAffected = 0
    reportsDeleted = 0
    jobErrorReports = {}
    
    jobs = RepositoryUtils.GetJobs(False)
    for job in jobs:
        try:
            currJobErrorReports = RepositoryUtils.GetJobReports( job.JobId ).GetErrorReports()
            if len(currJobErrorReports) > 0:
                jobErrorReports[ job.JobId ] = currJobErrorReports
        except:
            print( "Error collecting reports for job " + job.JobId + ": " + traceback.format_exc() )
    
    # Get the selected slave infos.
    selectedSlaveInfos = MonitorUtils.GetSelectedSlaveInfos()
    for slaveInfo in selectedSlaveInfos:
        slaveName = slaveInfo.SlaveName
        for jobId in jobErrorReports:
            reportsToDelete = []
            
            for jobErrorReport in jobErrorReports[ jobId ]:
                if slaveName.lower() == jobErrorReport.ReportSlaveName.lower():
                    reportsToDelete.append( jobErrorReport )
            
            if len(reportsToDelete) > 0:
                try:
                    RepositoryUtils.DeleteJobReports( jobId, reportsToDelete )
                    jobsAffected = jobsAffected + 1
                    reportsDeleted = reportsDeleted + len(reportsToDelete)
                except:
                    print( "Error deleting reports for job " + jobId + ": " + traceback.format_exc() )
        
    scriptDialog = DeadlineScriptDialog()
    scriptDialog.ShowMessageBox("Finished deleting " + str(reportsDeleted) + " error reports from " + str(jobsAffected) + " jobs.", "Delete Slave Error Reports")
Privacy | Site terms | Cookie preferences