Sorry, I knew I'd get the terminology wrong!
It sounds from JENKINS-26033 that you're leaning towards not having a (meaningful) return value from 'branch'. So if I want to record the fact a particular branch failed, I'd have to swallow the exception and rethrow (to cause the sibling-cancel) – at least, I assume the rethrow would cause the sibling-cancel.
Just thinking out loud about the following use-case: I want to run two tasks in parallel. If either one fails, I want to cancel the other, and then continue executing my job. How would I do that in a world where 'cancel_siblings' was an option to 'parallel'. I guess it would be something like this:
def one_failed, two_failed;
try {
parallel one: {
try {
...
} catch (x) {
one_failed = true
rethrow }
}, two: {
try {
...
} catch (x) {
two_failed = true
rethrow
}
}
} catch (x) {
}
... continue on, looking at one_failed and two_failed if needed ...
It's a little messy but I believe it works. I doubt this is a super-common case, so as long as it's possible I think this design works for our needs, at least.
Currently to branch return value (not a status per se), but see my comment in
JENKINS-26033.There is only one “job”, the workflow as a whole, a build of which is marked as a failure if any of the parallel branches fail—unless you have a try/catch block outside parallel which does something else.