[hg] galaxy 1567: Like the local runner, if job preparation fail...

classic Classic list List threaded Threaded
1 message Options
| Threaded
Open this post in threaded view
|

[hg] galaxy 1567: Like the local runner, if job preparation fail...

Nate Coraor (nate@bx.psu.edu)
details:   http://www.bx.psu.edu/hg/galaxy/rev/b02b8d9196a8
changeset: 1567:b02b8d9196a8
user:      Nate Coraor <[hidden email]>
date:      Wed Oct 22 12:15:06 2008 -0400
description:
Like the local runner, if job preparation fails, catch and log.

2 file(s) affected in this change:

lib/galaxy/jobs/runners/pbs.py
lib/galaxy/jobs/runners/sge.py

diffs (42 lines):

diff -r 510ff36caaf3 -r b02b8d9196a8 lib/galaxy/jobs/runners/pbs.py
--- a/lib/galaxy/jobs/runners/pbs.py Tue Oct 21 10:40:08 2008 -0400
+++ b/lib/galaxy/jobs/runners/pbs.py Wed Oct 22 12:15:06 2008 -0400
@@ -114,8 +114,15 @@
 
     def queue_job( self, job_wrapper ):
         """Create PBS script for a job and submit it to the PBS queue"""
-        job_wrapper.prepare()
-        command_line = job_wrapper.get_command_line()
+
+        try:
+            job_wrapper.prepare()
+            command_line = job_wrapper.get_command_line()
+        except:
+            job_wrapper.fail( "failure preparing job", exception=True )
+            log.exception("failure running job %d" % job_wrapper.job_id)
+            return
+
         runner_url = job_wrapper.tool.job_runner
         
         # This is silly, why would we queue a job with no command line?
diff -r 510ff36caaf3 -r b02b8d9196a8 lib/galaxy/jobs/runners/sge.py
--- a/lib/galaxy/jobs/runners/sge.py Tue Oct 21 10:40:08 2008 -0400
+++ b/lib/galaxy/jobs/runners/sge.py Wed Oct 22 12:15:06 2008 -0400
@@ -103,8 +103,15 @@
 
     def queue_job( self, job_wrapper ):
         """Create SGE script for a job and submit it to the SGE queue"""
-        job_wrapper.prepare()
-        command_line = job_wrapper.get_command_line()
+
+        try:
+            job_wrapper.prepare()
+            command_line = job_wrapper.get_command_line()
+        except:
+            job_wrapper.fail( "failure preparing job", exception=True )
+            log.exception("failure running job %d" % job_wrapper.job_id)
+            return
+
         runner_url = job_wrapper.tool.job_runner
         
         # This is silly, why would we queue a job with no command line?