commit/galaxy-central: smcmanus: Cleanup
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/7b3a7a3ea9af/ changeset: 7b3a7a3ea9af user: smcmanus date: 2012-10-03 00:30:08 summary: Cleanup affected #: 3 files diff -r 3d07a7800f9af46e46c1f3ad3f0fe432949f3b51 -r 7b3a7a3ea9afc3de218c7c5f2c52cdfa717ee5c5 lib/galaxy/jobs/__init__.py --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -321,31 +321,23 @@ log.exception( '(%s) Failed to change ownership of %s, failing' % ( job.id, self.working_directory ) ) return self.fail( job.info, stdout=stdout, stderr=stderr, exit_code=tool_exit_code ) - log.debug( "############## JobWrapper.finish: %s exit code" - % ( "None" if None == tool_exit_code else str(tool_exit_code))) # if the job was deleted, don't finish it if job.state == job.states.DELETED or job.state == job.states.ERROR: - # ERROR at this point means the job was deleted by an administrator. # SM: Note that, at this point, the exit code must be saved in case # there was an error. Errors caught here could mean that the job # was deleted by an administrator (based on old comments), but it # could also mean that a job was broken up into tasks and one of - # the tasks failed. So + # the tasks failed. So include the stderr, stdout, and exit code: return self.fail( job.info, stderr=stderr, stdout=stdout, exit_code=tool_exit_code ) # Check the tool's stdout, stderr, and exit code for errors, but only # if the job has not already been marked as having an error. # The job's stdout and stderr will be set accordingly. - log.debug( "############## JobWrapper.finish: Post-check exit code: %s/%s" - % ( ( "None" if None == tool_exit_code else str(tool_exit_code) ), - ( "None" if None == job.exit_code else str(job.exit_code) ) ) ) if job.states.ERROR != job.state: if ( self.check_tool_output( stdout, stderr, tool_exit_code, job )): job.state = job.states.OK else: job.state = job.states.ERROR - log.debug( "############## JobWrapper.finish: Post-check exit code: %s" - % ( "None" if None == tool_exit_code else str(tool_exit_code))) if self.version_string_cmd: version_filename = self.get_version_string_path() @@ -471,8 +463,6 @@ # is either incorrect or has the wrong semantics. if None != tool_exit_code: job.exit_code = tool_exit_code - log.debug( "############## JobWrapper.finish: storing %s exit code" - % ( "None" if None == job.exit_code else str(job.exit_code))) # custom post process setup inp_data = dict( [ ( da.name, da.dataset ) for da in job.input_datasets ] ) out_data = dict( [ ( da.name, da.dataset ) for da in job.output_datasets ] ) diff -r 3d07a7800f9af46e46c1f3ad3f0fe432949f3b51 -r 7b3a7a3ea9afc3de218c7c5f2c52cdfa717ee5c5 lib/galaxy/jobs/runners/local.py --- a/lib/galaxy/jobs/runners/local.py +++ b/lib/galaxy/jobs/runners/local.py @@ -143,10 +143,7 @@ # Finish the job! try: - #job_wrapper.finish( stdout, stderr, exit_code ) - # DELETEME: This is for testing how null exit codes are handled: - log.debug( "############## Finishing job - None exit code" ) - job_wrapper.finish( stdout, stderr, None ) + job_wrapper.finish( stdout, stderr, exit_code ) except: log.exception("Job wrapper finish method failed") job_wrapper.fail("Unable to finish job", exception=True) diff -r 3d07a7800f9af46e46c1f3ad3f0fe432949f3b51 -r 7b3a7a3ea9afc3de218c7c5f2c52cdfa717ee5c5 lib/galaxy/jobs/runners/tasks.py --- a/lib/galaxy/jobs/runners/tasks.py +++ b/lib/galaxy/jobs/runners/tasks.py @@ -64,7 +64,7 @@ # thing as the last task to complete, which could be added later. # o if a task fails, then the job will fail and the failing task's # exit code will become the job's exit code. - job_exit_code = "" + job_exit_code = None # If we were able to get a command line, run the job. ( must be passed to tasks ) if command_line: @@ -112,17 +112,14 @@ # Deleted tasks are not included right now. # while tasks_complete is False: - log.debug( "************ Rechecking tasks" ) count_complete = 0 tasks_complete = True for tw in task_wrappers: task_state = tw.get_state() - log.debug( "***** Checking task %d: state %s" - % (tw.task_id, task_state) ) if ( model.Task.states.ERROR == task_state ): job_exit_code = tw.get_exit_code() - log.debug( "Canceling job %d: Task %s returned an error (exit code %d)" - % ( tw.job_id, tw.task_id, job_exit_code ) ) + log.debug( "Canceling job %d: Task %s returned an error" + % ( tw.job_id, tw.task_id ) ) self.cancel_job( job_wrapper, task_wrappers ) tasks_complete = True break @@ -136,8 +133,6 @@ if sleep_time < 8: sleep_time *= 2 import time - log.debug( "####################### Finished with tasks; job exit code: %d" % job_exit_code ) - job_wrapper.reclaim_ownership() # if running as the actual user, change ownership before merging. log.debug('execution finished - beginning merge: %s' % command_line) stdout, stderr = splitter.do_merge(job_wrapper, task_wrappers) @@ -164,7 +159,6 @@ # Finish the job try: - log.debug( "$$$$$$$$$$$$$$ job_exit_code before finish: %d" % job_exit_code ) job_wrapper.finish( stdout, stderr, job_exit_code ) except: log.exception("Job wrapper finish method failed") Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket