3405: Mark pipeline instances failed when they're aborted.
[arvados.git] / sdk / cli / bin / arv-run-pipeline-instance
index 8274f4c876a8828136d624182129117d35d71169..980ce83ae3a42c153d0a445d01fac4a3cf0c4dd4 100755 (executable)
@@ -724,7 +724,14 @@ class WhRunPipelineInstance
   end
 
   def abort(msg)
-    @instance.log_stderr(msg) if @instance
+    if @instance
+      if ["New", "Ready", "RunningOnClient",
+          "RunningOnServer"].include?(@instance[:state])
+        @instance[:state] = "Failed"
+        @instance.save
+      end
+      @instance.log_stderr(msg)
+    end
     Kernel::abort(msg)
   end
 end