Clarifying the exception specification for bulk callback functions
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- cpp
調査の方向性
include/stdexec/__detail/__parallel_scheduler.hpp の390-419行目を読み、parallel schedulerのcallback処理をデフォルトのbulk実装と比較してください。提供されているsync_wait/bulkの例を使って、std::runtime_errorがreceiverのset_errorと周囲のcatchに到達すべきかを確認してください。カスタマイズされたbulk実装の例外契約が決定され、検証されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Do we really allow the bulk callback function to throw an exception? That is, when the bulk callback throws an exception, will that exception be propagated through the receiver's set_error(std::exception_ptr)?
Consider:
Given a scheduler sch, what should be the behavior of the following code?
try {
stdexec::sync_wait(stdexec::schedule(sch) | stdexec::bulk(std::execution::par, 1uz, [](std::size_t){
throw std::runtime_error{"xxx"};
}));
}
catch (const std::runtime_error& e) {
...
}
Can the try-catch here catch this std::runtime_error?
For the default implementation of bulk, the answer is yes, it can be caught. But for some customized bulk implementations, it may be different. For example, if sch here is a stdexec::parallel_scheduler, the program will terminate, see https://github.com/NVIDIA/stdexec/blob/e8c349f3f3425b9341306bc56615fc5279a15cf4/include/stdexec/__detail/__parallel_scheduler.hpp#L390-L419
which does not handle the case where the call to __state->__fun_ throws an exception. However, fixing this seems a bit tricky, or should we reconsider the exception specification of bulk_item_receiver_proxy::execute?
- 主要言語
- C++
- スター
- 2.4k
- フォーク
- 270
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 43
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/stdexec のほかの issue
-
inline_scheduler's namespace-scope static_assert fails under nvcc (private nested __sender access) オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 65/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
google/libultrahdr#485 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
godotengine/godot#123776 ·
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 60/100
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ros2/common_interfaces#344 ·