Merge branch 'master' into 1971-show-image-thumbnails
[arvados.git] / sdk / cli / bin / arv-run-pipeline-instance
index 090be61ba49c873ac85bdb7c9973794252a8c70a..7ddea30cf76ce1ebd27c9083e6d6ecef1a1776a8 100755 (executable)
@@ -426,6 +426,9 @@ class WhRunPipelineInstance
       moretodo = false
       @components.each do |cname, c|
         job = nil
+        # Is the job satisfying this component already known to be
+        # finished? (Already meaning "before we query API server about
+        # the job's current state")
         c_already_finished = (c[:job] &&
                               c[:job][:uuid] &&
                               !c[:job][:success].nil?)
@@ -455,7 +458,7 @@ class WhRunPipelineInstance
           if (c[:job][:running] or
               not (c[:job][:finished_at] or c[:job][:cancelled_at]))
             # Job is running so update copy of job record
-            c[:job] = JobCache.get(c[:job][:uuid])            
+            c[:job] = JobCache.get(c[:job][:uuid])
           end
 
           if c[:job][:success]
@@ -471,10 +474,12 @@ class WhRunPipelineInstance
               end
             end
             unless c_already_finished
+              # This is my first time discovering that the job
+              # succeeded. (At the top of this loop, I was still
+              # waiting for it to finish.)
               if c[:output_is_persistent]
-                # This is my first time discovering that the job
-                # succeeded. I need to make sure a resources/wants
-                # link is in place to protect the output from garbage
+                # I need to make sure a resources/wants link is in
+                # place to protect the output from garbage
                 # collection. (Normally Crunch does this for me, but
                 # here I might be reusing the output of someone else's
                 # job and I need to make sure it's understood that the
@@ -547,7 +552,7 @@ class WhRunPipelineInstance
         end
       end
     end
-    
+
     if ended == @components.length or failed > 0
       @instance[:active] = false
       @instance[:success] = (succeeded == @components.length)