-S + --timeout did not repect --timeout.

This commit is contained in:
Ole Tange 2011-12-11 00:16:41 +01:00
parent 8a7f45c6a2
commit 637f5391af
3 changed files with 13 additions and 0 deletions

View file

@ -101,6 +101,7 @@ if($::opt_nonall or $::opt_onall) {
((defined $::opt_g) ? "-g" : ""), ((defined $::opt_g) ? "-g" : ""),
((defined @::opt_v) ? "-vv" : ""), ((defined @::opt_v) ? "-vv" : ""),
((defined $::opt_D) ? "-D" : ""), ((defined $::opt_D) ? "-D" : ""),
((defined $::opt_timeout) ? "--timeout ".$::opt_timeout : ""),
); );
::debug("| parallel"); ::debug("| parallel");
open(PARALLEL,"| $0 $options") || open(PARALLEL,"| $0 $options") ||
@ -113,6 +114,8 @@ if($::opt_nonall or $::opt_onall) {
shell_quote_scalar($command)." :::: @argfiles\n"; shell_quote_scalar($command)." :::: @argfiles\n";
} }
close PARALLEL; close PARALLEL;
$Global::exitstatus = $? >> 8;
debug("--onall exitvalue ",$?);
if(@::opt_basefile) { cleanup_basefile(); } if(@::opt_basefile) { cleanup_basefile(); }
unlink(@argfiles); unlink(@argfiles);
wait_and_exit(min(undef_as_zero($Global::exitstatus),254)); wait_and_exit(min(undef_as_zero($Global::exitstatus),254));

View file

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
cat <<'EOF' | parallel -j0 -k
echo '### Test of --eta' echo '### Test of --eta'
seq 1 10 | stdout parallel --eta "sleep 1; echo {}" | wc -l seq 1 10 | stdout parallel --eta "sleep 1; echo {}" | wc -l
@ -14,3 +16,7 @@ stdout parallel --progress "sleep 1; echo {}" < /dev/null
echo '### bug #34422: parallel -X --eta crashes with div by zero' echo '### bug #34422: parallel -X --eta crashes with div by zero'
seq 2 | stdout parallel -X --eta echo seq 2 | stdout parallel -X --eta echo
echo '### --timeout on remote machines'
parallel -j0 --timeout 3 --onall -S .. 'sleep {}; echo {}' ::: 1 6 7 ; echo $?
EOF

View file

@ -18,3 +18,7 @@ Computers / CPU cores / Max jobs to run
Computers / CPU cores / Max jobs to run Computers / CPU cores / Max jobs to run
1:local / 2 / 1 1:local / 2 / 1
### --timeout on remote machines
1
1
2