Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
libflux/composite_future: propagate child errors to parent #2099
This is something I ran across in the
Currently, composite "wait all" and "wait any" futures are fulfilled with success as soon as all or any of their child futures are fulfilled, whether with success or failure. This makes it challenging to use
This PR just sets up the check for composite future fulfillment to propagate any error from the children to the "parent". To see the exact error or more detail, the user should still iterate over child futures (e.g. to see which future or futures were fulfilled with error)
Problem: Composite wait "any" or "all" futures are fulfilled with sucess even if one of the child futures that makes up the composite is fulfilled with an error. This makes it tricky to use the composites as a component in a flux_future_and_then() chain, since the error will not break the chain. This can cause unexpected failures from the next continuation in the chain. When fulfilling the dummy "parent" future for a composite, propagate an error if a child future was fulfilled with an error. This means that a composite "wait all" future is only fulfilled with success if all of its child futures are fulfilled with success, and that a "wait any" is fulfilled with success if the first future to complete is sucessful.