[ARVADOS] created: 75be7487c2bbd83aa5116aa5f8ade5ddf31501da

git at public.curoverse.com git at public.curoverse.com
Wed Oct 1 17:27:57 EDT 2014


        at  75be7487c2bbd83aa5116aa5f8ade5ddf31501da (commit)


commit 75be7487c2bbd83aa5116aa5f8ade5ddf31501da
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Sep 30 23:49:11 2014 -0400

    3775: Fix crunch-job exit status: exit non-zero after "freeze"
    path (which includes task failure, INT, TERM, etc.)
    
    Also fix wrong todo list (and therefore todo count in progress stats)
    after permanent task failure.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index f56099d..9c32d8e 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -877,15 +877,15 @@ Log (undef, "finish");
 
 save_meta();
 
-if ($job_has_uuid) {
-  if ($collated_output && $main::success) {
-    $Job->update_attributes('state' => 'Complete')
-  } else {
-    $Job->update_attributes('state' => 'Failed')
-  }
+my $final_state;
+if ($collated_output && $main::success) {
+  $final_state = 'Complete';
+} else {
+  $final_state = 'Failed';
 }
+$Job->update_attributes('state' => $final_state)
 
-exit ($Job->{'state'} != 'Complete' ? 1 : 0);
+exit (($final_state eq 'Complete') ? 0 : 1);
 
 
 
@@ -972,10 +972,8 @@ sub reapchildren
       $main::success = 0;
       $main::please_freeze = 1;
     }
-    else {
-      # Put this task back on the todo queue
-      push @jobstep_todo, $jobstepid;
-    }
+    # Put this task back on the todo queue
+    push @jobstep_todo, $jobstepid;
     $Job->{'tasks_summary'}->{'failed'}++;
   }
   else
@@ -1396,7 +1394,7 @@ sub freeze_if_want_freeze
     collate_output();
     cleanup();
     save_meta();
-    exit 0;
+    exit 1;
   }
 }
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list