|
From: | Gregor Jasny |
Subject: | GNU Parallel Bug Reports Exit status for semaphore mode |
Date: | Wed, 16 Jan 2019 16:23:02 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
Hello,I'm wondering how top propagate errors in semaphore mode. I'd expect that any calls of "parallel" either when submitting jobs or when waiting for the result return a non-zero exit code.
This is my test code. Here I'd expect the last line to return "failure" #!/bin/bash function faillater { sleep 5 exit 1 } export -f faillater ./parallel --semaphore --halt-on-error 1 --jobs 2 -- faillater ./parallel --semaphore --halt-on-error 2 --jobs 2 -- sleep 10./parallel --semaphore --halt-on-error 1 --jobs 2 --wait && echo success || echo failure
I can see that implementing or defining error handling is problematic especially because returning the error is deferred. But nevertheless error handling is important and it would be nice if parallel could be helpful in that area.
Thanks, Gregor
[Prev in Thread] | Current Thread | [Next in Thread] |