~smspillaz/folly/folly-git-master

Viewing all changes in revision 9843.

  • Committer: Facebook GitHub Bot
  • Author(s): Aaryaman Sagar
  • Date: 2021-07-15 04:12:12 UTC
  • Revision ID: git-v1:ea91c9bc37bd25f8adfa4652822263f196f2d482
Have collect() handle the case of a not-ready future

Summary:
If one of the input futures is off the end of a folly::Executor::weakRef()
executor, then there is a chance that it may never complete with a value or an
ecception.  In this case, collect() would crash because it assumes that the
folly::Try instances for all input futures have either a value or an exception.

Fix that case by injecting a BrokenPromise exception for the case where a future
never has an exception or a value.

Reviewed By: yfeldblum

Differential Revision: D26989091

fbshipit-source-id: b810fe4d5d071233da1f453b3759991e057d78c6

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: