[ARVADOS] updated: 264ffa31bae106bb6c36643e13186289b6cd0e18

Git user git at public.curoverse.com
Wed Feb 15 15:03:21 EST 2017


Summary of changes:
 services/api/app/models/container.rb | 34 ++++++++++++----------------------
 1 file changed, 12 insertions(+), 22 deletions(-)

  discards  adf03c329338e04bc47bae7743c6af29f18af7dc (commit)
       via  264ffa31bae106bb6c36643e13186289b6cd0e18 (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 (adf03c329338e04bc47bae7743c6af29f18af7dc)
            \
             N -- N -- N (264ffa31bae106bb6c36643e13186289b6cd0e18)

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 264ffa31bae106bb6c36643e13186289b6cd0e18
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Feb 15 14:47:57 2017 -0500

    11097: Drop check for conflicting outputs when reusing completed containers.

diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb
index 7731a8d..148cf72 100644
--- a/services/api/app/models/container.rb
+++ b/services/api/app/models/container.rb
@@ -91,35 +91,19 @@ class Container < ArvadosModel
       where('mounts = ?', self.deep_sort_hash(attrs[:mounts]).to_yaml).
       where('runtime_constraints = ?', self.deep_sort_hash(attrs[:runtime_constraints]).to_yaml)
 
-    # Check for Completed candidates that had consistent outputs.
+    # Check for Completed candidates whose output and log are both readable.
     completed = candidates.where(state: Complete).where(exit_code: 0)
-    outputs = completed.select('output').group('output').limit(2)
-    if outputs.count.count != 1
-      Rails.logger.debug("Found #{outputs.count.length} different outputs")
-    elsif Collection.
-        readable_by(current_user).
-        where(portable_data_hash: outputs.first.output).
-        count < 1
-      Rails.logger.info("Found reusable container(s) " +
-                        "but output #{outputs.first} is not readable " +
-                        "by user #{current_user.uuid}")
-    else
-      # Return the oldest eligible container whose log is still
-      # present and readable by current_user.
-      readable_pdh = Collection.
-        readable_by(current_user).
-        select('portable_data_hash')
-      completed = completed.
-        where("log in (#{readable_pdh.to_sql})").
-        order('finished_at asc').
-        limit(1)
-      if completed.first
-        return completed.first
-      else
-        Rails.logger.info("Found reusable container(s) but none with a log " +
-                          "readable by user #{current_user.uuid}")
-      end
-    end
+    select_readable_pdh = Collection.
+      readable_by(current_user).
+      select(:portable_data_hash).
+      to_sql
+    usable = completed.
+      order('finished_at ASC').
+      where("log IN (#{select_readable_pdh})").
+      where("output IN (#{select_readable_pdh})").
+      limit(1).
+      first
+    return usable if usable
 
     # Check for Running candidates and return the most likely to finish sooner.
     running = candidates.where(state: Running).

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list