facebook / facebook/folly

Future interruption (raise, cancel) doesn't propagate through `collect`

オープン
#1,237 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
30.5k
フォーク
5.9k
PR マージ指標
30日以内にマージされた PR はありません

説明

One would expect that interrupting the future resulting from `collect` would interrupt all the source futures, but this doesn't happen.

This prints 0, not 2:

```
int n = 0;

auto [p1, f1] = folly::makePromiseContract();
p1.setInterruptHandler([&](const folly::exception_wrapper& ew) { ++n; });

auto [p2, f2] = folly::makePromiseContract();
p2.setInterruptHandler([&](const folly::exception_wrapper& ew) { ++n; });

auto f = folly::collect(std::move(f1), std::move(f2));

f.cancel();

printf("%d\n", n);
```

Is there a better way to accomplish this?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。