[ARVADOS] created: a276e40691a8f96b321879de2279159ef08b804f
git at public.curoverse.com
git at public.curoverse.com
Tue Jun 3 17:10:48 EDT 2014
at a276e40691a8f96b321879de2279159ef08b804f (commit)
commit a276e40691a8f96b321879de2279159ef08b804f
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Tue Jun 3 17:10:45 2014 -0400
2955: Fixed refresh_running to set finished_at on failed jobs. Increased
polling period to 30 seconds.
diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index a179887..bde9b67 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -40,6 +40,7 @@ class Dispatcher
if !@running[jobrecord.uuid]
# job is marked running, but not actually running. so fail it
jobrecord.running = false
+ jobrecord.finished_at ||= Time.now
if jobrecord.success.nil?
jobrecord.success = false
end
@@ -381,7 +382,7 @@ class Dispatcher
end
end
else
- refresh_running unless did_recently(:refresh_running, 1.0)
+ refresh_running unless did_recently(:refresh_running, 30.0)
refresh_todo unless did_recently(:refresh_todo, 1.0)
update_node_status
unless @todo.empty? or did_recently(:start_jobs, 1.0) or $signal[:term]
commit cb77d123755112d17f2e7bb2bd869d957d8a00f3
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Tue Jun 3 16:50:48 2014 -0400
2955: Periodically compare Job.running to @running and fail any jobs not in
@running.
diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index a9b7598..a179887 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -35,6 +35,19 @@ class Dispatcher
return act_as_system_user
end
+ def refresh_running
+ Job.running.each do |jobrecord|
+ if !@running[jobrecord.uuid]
+ # job is marked running, but not actually running. so fail it
+ jobrecord.running = false
+ if jobrecord.success.nil?
+ jobrecord.success = false
+ end
+ jobrecord.save!
+ end
+ end
+ end
+
def refresh_todo
@todo = Job.queue.select do |j| j.repository end
@todo_pipelines = PipelineInstance.queue
@@ -368,6 +381,7 @@ class Dispatcher
end
end
else
+ refresh_running unless did_recently(:refresh_running, 1.0)
refresh_todo unless did_recently(:refresh_todo, 1.0)
update_node_status
unless @todo.empty? or did_recently(:start_jobs, 1.0) or $signal[:term]
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list