[ARVADOS] updated: ae09643622ecea00bab110f20029f01c83e1cf30

git at public.curoverse.com git at public.curoverse.com
Wed Jun 4 10:09:57 EDT 2014


Summary of changes:
 services/api/script/crunch-dispatch.rb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

       via  ae09643622ecea00bab110f20029f01c83e1cf30 (commit)
      from  2a64eae3cf8363c596feda5337ea20ce356ca11f (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 ae09643622ecea00bab110f20029f01c83e1cf30
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Jun 4 10:09:51 2014 -0400

    2955: Fixed query of log table that checks for age of last log by an orphan
    job.

diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index f49f21b..c09be81 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -44,8 +44,10 @@ class Dispatcher
   def refresh_running
     Job.running.each do |jobrecord|
       if !@running[jobrecord.uuid]
-        f = Log.filter(["object_uuid", "=", jobrecord.uuid]).limit(1).order("created_at desc").results.first
-        if (Time.now - f.created_at) > 300
+        f = Log.where("object_uuid=?", jobrecord.uuid).limit(1).order("created_at desc").first
+        age = (Time.now - f.created_at)
+        if age > 300
+          $stderr.puts "dispatch: failing orphan job #{jobrecord.uuid}, last log is #{age} seconds old"
           # job is marked running, but not known to crunch-dispatcher, and
           # hasn't produced any log entries for 5 minutes, so mark it as failed.
           jobrecord.running = false

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list