This message was deleted.
# bolt
s
This message was deleted.
a
Awesome! Thank you. I think the documentation was missing the .targets on it's example.
w
any advice on getting hundreds of targets to action the same steps, but not wait on each other to finish before they continue?
n
You can use the
parallelize
function
w
thanks, we already do that. Where we get tripped up is in 'everyone do A', then everyone that successfully did A, do B, and everyone that failed to do A, do C instead. But don't wait until you know who succeeded and who failed before starting. seems like we are missing something relatively obvious.
n
I'm not sure I understand. If you have nodes X, Y, Z and they have to run tasks A, B, C, do you want to ensure every node has finished A before any node starts B, or do you just want each node to independently run A then B then C, but stopping if that node fails?
This should basically do what I think you're describing:
Copy code
parallelize([x,y,z]) |$target| {
  run_task(a, $target)
  run_task(b, $target)
  run_task(c, $target)
}
w
wow, two months later. the problem with your proposal, is that task b will run on hosts where task a failed
OR, if one host fails task a, everone will bail out, and no-one will runb task b
n
That shouldn’t be the case. Within the block, an exception (caused by the failure of a on a target) will stop execution of that block and not run b and c. But the parallelize block runs separately for each target, so it shouldn’t affect other targets.
w
yeah. it's been a while since I looked at this specific codebase, so I forget which problems we run into, and when
do you know if you can 'stack' parralize blocks?
n
I think it should work but I’m not sure. In particular I don’t know if it will work to have two different tasks running on the same target at once. I think so but I could imagine it not working.