Loading lib/galaxy/jobs/runners/pulsar.py +5 −2 Original line number Diff line number Diff line Loading @@ -736,7 +736,7 @@ class PulsarJobRunner(AsynchronousJobRunner): ) return False def stop_job(self, job_wrapper): def stop_job(self, job_wrapper, soft_kill=True): job = job_wrapper.get_job() if not job.job_runner_external_id: return Loading Loading @@ -775,6 +775,9 @@ class PulsarJobRunner(AsynchronousJobRunner): job_id = job.job_runner_external_id log.debug(f"Attempt remote Pulsar kill of job with url {pulsar_url} and id {job_id}") client = self.get_client(job.destination_params, job_id) if soft_kill: client.kill(soft_kill=soft_kill) else: client.kill() def recover(self, job, job_wrapper): Loading lib/galaxy/managers/jobs.py +13 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ from galaxy.exceptions import ( ObjectNotFound, RequestParameterInvalidException, ) from galaxy.jobs import JobConfiguration, MinimalJobWrapper from galaxy.job_metrics import ( RawMetric, Safety, Loading Loading @@ -266,6 +267,18 @@ class JobManager: else: return False def finish_early(self, job): if not job.finished: try: job.mark_stopped(self.app.config.track_jobs_in_database) session = self.app.model.session with transaction(session): session.commit() self.app.job_manager.stop(job, message="") return True except Exception as e: log.error("Job Runner does not support stopping job early.") return False class JobSearch: """Search for jobs using tool inputs or other jobs""" Loading Loading
lib/galaxy/jobs/runners/pulsar.py +5 −2 Original line number Diff line number Diff line Loading @@ -736,7 +736,7 @@ class PulsarJobRunner(AsynchronousJobRunner): ) return False def stop_job(self, job_wrapper): def stop_job(self, job_wrapper, soft_kill=True): job = job_wrapper.get_job() if not job.job_runner_external_id: return Loading Loading @@ -775,6 +775,9 @@ class PulsarJobRunner(AsynchronousJobRunner): job_id = job.job_runner_external_id log.debug(f"Attempt remote Pulsar kill of job with url {pulsar_url} and id {job_id}") client = self.get_client(job.destination_params, job_id) if soft_kill: client.kill(soft_kill=soft_kill) else: client.kill() def recover(self, job, job_wrapper): Loading
lib/galaxy/managers/jobs.py +13 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ from galaxy.exceptions import ( ObjectNotFound, RequestParameterInvalidException, ) from galaxy.jobs import JobConfiguration, MinimalJobWrapper from galaxy.job_metrics import ( RawMetric, Safety, Loading Loading @@ -266,6 +267,18 @@ class JobManager: else: return False def finish_early(self, job): if not job.finished: try: job.mark_stopped(self.app.config.track_jobs_in_database) session = self.app.model.session with transaction(session): session.commit() self.app.job_manager.stop(job, message="") return True except Exception as e: log.error("Job Runner does not support stopping job early.") return False class JobSearch: """Search for jobs using tool inputs or other jobs""" Loading