1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/aba101adc4a7/ changeset: aba101adc4a7 user: smcmanus date: 2012-11-06 21:18:42 summary: The job's external metadata is returned from the model. The Task class had included a get_external_output_metadata method that was missing from the Job class, and this was the result of trying to merge the two interfaces. This caused problems in cancelling jobs (i.e., the jobs would run to completion) when the jobs were scheduled for the local runner. affected #: 3 files diff -r 8fb2a905f2492a388799ac4d861e52bda9365300 -r aba101adc4a7012f6c959c23ea5f1b8701667649 lib/galaxy/jobs/__init__.py --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -400,7 +400,6 @@ # the state or whether the tool used exit codes and regular # expressions to do so. So we use # job.state == job.states.ERROR to replace this same test. - #elif not self.external_output_metadata.external_metadata_set_successfully( dataset, self.sa_session ) and not context['stderr']: elif not self.external_output_metadata.external_metadata_set_successfully( dataset, self.sa_session ) and job.states.ERROR != job.state: dataset._state = model.Dataset.states.FAILED_METADATA else: diff -r 8fb2a905f2492a388799ac4d861e52bda9365300 -r aba101adc4a7012f6c959c23ea5f1b8701667649 lib/galaxy/jobs/runners/local.py --- a/lib/galaxy/jobs/runners/local.py +++ b/lib/galaxy/jobs/runners/local.py @@ -183,8 +183,9 @@ def stop_job( self, job ): #if our local job has JobExternalOutputMetadata associated, then our primary job has to have already finished - if job.get_external_output_metadata(): - pid = job.get_external_output_metadata()[0].job_runner_external_pid #every JobExternalOutputMetadata has a pid set, we just need to take from one of them + job_ext_output_metadata = job.get_external_output_metadata() + if job_ext_output_metadata: + pid = job_ext_output_metadata[0].job_runner_external_pid #every JobExternalOutputMetadata has a pid set, we just need to take from one of them else: pid = job.get_job_runner_external_id() if pid in [ None, '' ]: diff -r 8fb2a905f2492a388799ac4d861e52bda9365300 -r aba101adc4a7012f6c959c23ea5f1b8701667649 lib/galaxy/model/__init__.py --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -18,7 +18,7 @@ from galaxy.model.item_attrs import UsesAnnotations, APIItem from sqlalchemy.orm import object_session from sqlalchemy.sql.expression import func -import sys, os.path, os, errno, codecs, operator, socket, pexpect, logging, time, shutil +import os.path, os, errno, codecs, operator, socket, pexpect, logging, time, shutil if sys.version_info[:2] < ( 2, 5 ): from sets import Set as set @@ -138,6 +138,12 @@ # TODO: Add accessors for members defined in SQL Alchemy for the Job table and # for the mapper defined to the Job table. + def get_external_output_metadata( self ): + """ + The external_output_metadata is currently a reference from Job to + JobExternalOutputMetadata. It exists for a job but not a task. + """ + return self.external_output_metadata def get_session_id( self ): return self.session_id def get_user_id( self ): @@ -370,6 +376,13 @@ # (e.g., for a session) or never use the member (e.g., external output # metdata). These can be filled in as needed. def get_external_output_metadata( self ): + """ + The external_output_metadata is currently a backref to + JobExternalOutputMetadata. It exists for a job but not a task, + and when a task is cancelled its corresponding parent Job will + be cancelled. So None is returned now, but that could be changed + to self.get_job().get_external_output_metadata(). + """ return None def get_job_runner_name( self ): """ 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.