[ARVADOS] created: 05e4484f5f7369ce1e7435a13aa30509ccfddecc

git at public.curoverse.com git at public.curoverse.com
Mon Nov 9 14:41:53 EST 2015


        at  05e4484f5f7369ce1e7435a13aa30509ccfddecc (commit)


commit 05e4484f5f7369ce1e7435a13aa30509ccfddecc
Author: Brett Smith <brett at curoverse.com>
Date:   Mon Nov 9 10:28:51 2015 -0500

    7123: Crunch doesn't update job log when arv-put fails.
    
    This prevents crunch-job from recording the empty collection as a
    job's log.  Most other components (Workbench, the log clenaer)
    recognize a null log as a special case; less so the empty collection.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index c2ea186..f1420f6 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -1695,20 +1695,24 @@ sub log_writer_finish()
 
   close($log_pipe_in);
 
+  my $logger_failed = 0;
   my $read_result = log_writer_read_output(120);
   if ($read_result == -1) {
+    $logger_failed = -1;
     Log (undef, "timed out reading from 'arv-put'");
   } elsif ($read_result != 0) {
+    $logger_failed = -2;
     Log(undef, "failed to read arv-put log manifest to EOF");
   }
 
   waitpid($log_pipe_pid, 0);
   if ($?) {
+    $logger_failed = $?;
     Log(undef, "log_writer_finish: arv-put exited " . exit_status_s($?))
   }
 
   close($log_pipe_out);
-  my $arv_put_output = $log_pipe_out_buf;
+  my $arv_put_output = $logger_failed ? undef : $log_pipe_out_buf;
   $log_pipe_pid = $log_pipe_in = $log_pipe_out = $log_pipe_out_buf =
       $log_pipe_out_select = undef;
 
@@ -1774,13 +1778,13 @@ sub save_meta
   my $justcheckpoint = shift; # false if this will be the last meta saved
   return if $justcheckpoint;  # checkpointing is not relevant post-Warehouse.pm
   return unless log_writer_is_active();
+  my $log_manifest = log_writer_finish();
+  return unless defined($log_manifest);
 
-  my $log_manifest = "";
   if ($Job->{log}) {
     my $prev_log_coll = api_call("collections/get", uuid => $Job->{log});
-    $log_manifest .= $prev_log_coll->{manifest_text};
+    $log_manifest = $prev_log_coll->{manifest_text} . $log_manifest;
   }
-  $log_manifest .= log_writer_finish();
 
   my $log_coll = api_call(
     "collections/create", ensure_unique_name => 1, collection => {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list