Merge branch 'master' into 5418-brand-unclickable-anonymous
[arvados.git] / sdk / cli / bin / crunch-job
index 567b5a293f85b7f0ac131692cde5ebdc000351a2..9fb14b10d3c20e0f6e35e8c4903d2d69d55f4cc0 100755 (executable)
@@ -941,7 +941,7 @@ if (!$collated_output) {
   Log (undef, "Failed to write output collection");
 }
 else {
-  Log(undef, "output hash " . $collated_output);
+  Log(undef, "job output $collated_output");
   $Job->update_attributes('output' => $collated_output);
 }
 
@@ -1055,7 +1055,9 @@ sub reapchildren
   $Jobstep->{'arvados_task'}->{finished_at} = strftime "%Y-%m-%dT%H:%M:%SZ", gmtime($Jobstep->{finishtime});
   $Jobstep->{'arvados_task'}->save;
   process_stderr ($jobstepid, $task_success);
-  Log ($jobstepid, "output " . $Jobstep->{'arvados_task'}->{output});
+  Log ($jobstepid, sprintf("task output (%d bytes): %s",
+                           length($Jobstep->{'arvados_task'}->{output}),
+                           $Jobstep->{'arvados_task'}->{output}));
 
   close $reader{$jobstepid};
   delete $reader{$jobstepid};
@@ -1298,6 +1300,7 @@ print (arvados.api("v1").collections().
 }, retry_count());
 
   my $task_idx = -1;
+  my $manifest_size = 0;
   for (@jobstep)
   {
     ++$task_idx;
@@ -1314,6 +1317,8 @@ print (arvados.api("v1").collections().
         # There's been an error writing.  Stop the loop.
         # We'll log details about the exit code later.
         last;
+      } else {
+        $manifest_size += length($next_write);
       }
     } else {
       my $uuid = $_->{'arvados_task'}->{'uuid'};
@@ -1322,11 +1327,12 @@ print (arvados.api("v1").collections().
     }
   }
   close($child_in);
+  Log(undef, "collated output manifest text to send to API server is $manifest_size bytes with access tokens");
 
   my $joboutput;
   my $s = IO::Select->new($child_out);
   if ($s->can_read(120)) {
-    sysread($child_out, $joboutput, 64 * 1024 * 1024);
+    sysread($child_out, $joboutput, 1024 * 1024);
     waitpid($pid, 0);
     if ($?) {
       Log(undef, "output collection creation exited " . exit_status_s($?));