collate_output: close the 'arv keep put' input fd before checking for output. Refs...
[arvados.git] / sdk / cli / bin / crunch-job
index e6fa9fbb1f8fafd48da2ea21bade3361a5d84dd3..2cd10022775029dd602a9a2ef57cb64304f80dd8 100755 (executable)
@@ -1075,11 +1075,12 @@ sub collate_output
       $main::success = 0;
     }
   }
+  $child_in->close;
+
   if (!defined $joboutput) {
     my $s = IO::Select->new($child_out);
     sysread($child_out, $joboutput, 64 * 1024 * 1024) if $s->can_read(5);
   }
-  $child_in->close;
   waitpid($pid, 0);
 
   if ($joboutput)