Do not swallow child exceptions on cancellation
Summary: Aligns `collectAll` and `collectAny` behaviour and simplifies the logic for propagating child exceptions on cancellation. Prior to this change, we were conditionally setting `firstException` dependent on whether cancellation was requested or not. Additionally, `collectAny` was unconditionally returning `co_cancelled` even if all the child tasks completed successfully. Now, the behaviour is consistent between general errors and cancellation: If any child task completes in error (including folly::OperationCancelled), then the parent `collectAll`/`collectAny` will propagate that failure. Otherwise, if no child fails, then `collectAll`/`collectAny` will propagate that success. (Note: this ignores all push blocking failures!) Reviewed By: iahs Differential Revision: D31266586 fbshipit-source-id: b6eba6ab2a0a3634b112318b1810819d7916acdb
Showing
Please register or sign in to comment