Fail a job when the finish method fails.

This commit is contained in:
Nate Coraor
2008-05-30 14:52:10 +00:00
parent 097a879588
commit d2f809f5da
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -78,7 +78,11 @@ class LocalJobRunner( object ):
log.exception("failure running job %d" % job_wrapper.job_id)
return
# Finish the job
job_wrapper.finish( stdout, stderr )
try:
job_wrapper.finish( stdout, stderr )
except:
log.exception("Job wrapper finish method failed")
job_wrapper.fail("Unable to finish job", exception=True)
def put( self, job_wrapper ):
"""Add a job to the queue (by job identifier)"""
+1
View File
@@ -351,6 +351,7 @@ class PBSJobRunner( object ):
pbs_job_state.job_wrapper.finish( stdout, stderr )
except:
log.exception("Job wrapper finish method failed")
job_wrapper.fail("Unable to finish job", exception=True)
# clean up the pbs files
self.cleanup( ( ofile, efile, job_file ) )