9773: If previous jobs disagree about outputs, but a new job is
authorTom Clegg <tom@curoverse.com>
Mon, 22 Aug 2016 20:25:14 +0000 (16:25 -0400)
committerTom Clegg <tom@curoverse.com>
Mon, 22 Aug 2016 20:27:34 +0000 (16:27 -0400)
already queued/running, reuse the new job (as we did before 9773).

services/api/app/controllers/arvados/v1/jobs_controller.rb

index cadc824a1e12a1da6b1d7d337e9d29fcc6cc6e81..0c68dc26c2ac9c3e32048b700d72d26fb1213bb5 100644 (file)
@@ -90,12 +90,15 @@ class Arvados::V1::JobsController < ApplicationController
         next
       end
 
-      if @object
+      if @object == false
+        # We have already decided not to reuse any completed job
+        next
+      elsif @object
         if @object.output != j.output
-          # If two matching jobs produced different outputs, just run
-          # a new job instead of choosing one arbitrarily.
-          @object = nil
-          return super
+          # If two matching jobs produced different outputs, run a new
+          # job (or use one that's already running/queued) instead of
+          # choosing one arbitrarily.
+          @object = false
         end
         # ...and that's the only thing we need to do once we've chosen
         # an @object to reuse.