[ARVADOS] updated: e6e94ca43f788b28d61c03f81b15ab5647f22d4c
git at public.curoverse.com
git at public.curoverse.com
Tue May 13 14:46:01 EDT 2014
Summary of changes:
services/api/script/crunch-dispatch.rb | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
via e6e94ca43f788b28d61c03f81b15ab5647f22d4c (commit)
from acef63e2e3e629da8b6825f33e6de7bf6bcc4fc2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit e6e94ca43f788b28d61c03f81b15ab5647f22d4c
Author: Tom Clegg <tom at curoverse.com>
Date: Tue May 13 14:45:42 2014 -0400
Fix job state cleanup in crunch-job failure case.
diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index f15258d..43a527a 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -314,11 +314,21 @@ class Dispatcher
j_done[:wait_thr].value
jobrecord = Job.find_by_uuid(job_done.uuid)
- jobrecord.running = false
- jobrecord.finished_at ||= Time.now
- # Don't set 'jobrecord.success = false' because if the job failed to run due to an
- # issue with crunch-job or slurm, we want the job to stay in the queue.
- jobrecord.save!
+ if jobrecord.started_at
+ # Clean up state fields in case crunch-job exited without
+ # putting the job in a suitable "finished" state.
+ jobrecord.running = false
+ jobrecord.finished_at ||= Time.now
+ if jobrecord.success.nil?
+ jobrecord.success = false
+ end
+ jobrecord.save!
+ else
+ # Don't fail the job if crunch-job didn't even get as far as
+ # starting it. If the job failed to run due to an infrastructure
+ # issue with crunch-job or slurm, we want the job to stay in the
+ # queue.
+ end
# Invalidate the per-job auth token
j_done[:job_auth].update_attributes expires_at: Time.now
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list