[ARVADOS] updated: f447c6158d00bdd2c5ab01983065a24670d225df

Git user git at public.curoverse.com
Mon Jan 16 16:49:18 EST 2017


Summary of changes:
 services/api/lib/crunch_dispatch.rb | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

  discards  1d82425461917af37cc6c5e1b2c87276b1a8fc8d (commit)
       via  f447c6158d00bdd2c5ab01983065a24670d225df (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (1d82425461917af37cc6c5e1b2c87276b1a8fc8d)
            \
             N -- N -- N (f447c6158d00bdd2c5ab01983065a24670d225df)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 f447c6158d00bdd2c5ab01983065a24670d225df
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Jan 16 16:38:29 2017 -0500

    10868: Log job runtime constraints and node properties when making a dispatch decision.

diff --git a/services/api/lib/crunch_dispatch.rb b/services/api/lib/crunch_dispatch.rb
index 48b0eb5..1b1df36 100644
--- a/services/api/lib/crunch_dispatch.rb
+++ b/services/api/lib/crunch_dispatch.rb
@@ -169,7 +169,25 @@ class CrunchDispatch
       end
       usable_nodes << node
       if usable_nodes.count >= min_node_count
-        return usable_nodes.map { |n| n.hostname }
+        hostnames = usable_nodes.map(&:hostname)
+        log_nodes = usable_nodes.map do |n|
+          "#{n.hostname} #{n.uuid} #{n.properties.to_json}"
+        end
+        log_job = "#{job.uuid} #{job.runtime_constraints}"
+        log_text = "dispatching job #{log_job} to #{log_nodes.join(", ")}"
+        $stderr.puts log_text
+        begin
+          act_as_system_user do
+            Log.new(object_uuid: job.uuid,
+                    event_type: 'dispatch',
+                    owner_uuid: system_user_uuid,
+                    summary: "dispatching to #{hostnames.join(", ")}",
+                    properties: {'text' => log_text}).save!
+          end
+        rescue => e
+          $stderr.puts "dispatch: log.create failed: #{e}"
+        end
+        return hostnames
       end
     end
     nil
@@ -204,8 +222,8 @@ class CrunchDispatch
               owner_uuid: job.owner_uuid,
               summary: message,
               properties: {"text" => message}).save!
-    rescue
-      $stderr.puts "dispatch: log.create failed"
+    rescue => e
+      $stderr.puts "dispatch: log.create failed: #{e}"
     end
 
     if not skip_lock and not have_job_lock?(job)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list