Capture and relay call frames on errors
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- r
調査の方向性
まず FutureResult オブジェクトと、.traceback(NULL)、.traceback(2L)、utils::dump.frames() 周辺のエラーハンドリング経路を調べます。提案されている future.recover.enable オプションと逐次 futures を考慮し、worker の recover スタックを親 R プロセスで記録して再生成できるかどうかを判断します。動作と設定が定義され、転送されたエラーがキャプチャされた call frames を公開できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Idea
> options(error = function() utils::recover())
> foo <- function(x, a = 2) a * x
> f <- future(foo("y"))
> v <- value(f)
Error in a * x : non-numeric argument to binary operator
Enter a frame number, or 0 to exit
1: foo("y")
2: HenrikBengtsson/future-ideas#1: (function ()
utils::recover())()
Selection: 1
Called from: top level
Browse[1]> ls.str()
a : num 2
x : chr "y"
Browse[1]>
The idea is to have the future record the full recover stack in the FutureResult object. Something like the info in:
tb <- .traceback(NULL)
if (is.null(tb)) tb <- .traceback(2L)
utils::dump.frames(dumpto = "frames", to.file = FALSE)
and then regenerate this call stack when relaying the error on the parent R process. I'm not sure if/not the latter can be done, but if we can figure it out, it'll be super cool.
It might be expensive to transfer all call stacks back from the worker to the main R session when running in parallel, so maybe this needs to be enabled via an option, e.g. options(future.recover.enable = TRUE). It might be that we can enable it by default for sequential futures.
See also
- 主要言語
- R
- スター
- 1k
- フォーク
- 93
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
futureverse/future のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
futureverse/future#852 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
futureverse/future#849 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
futureverse/future#833 ·
-
feature/resources RNG
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
futureverse/future#832 ·
-
RNG
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
futureverse/future#831 · コメント 1 件 ·
futureverse/future の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
nf-core/provenancereport#75 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
garner-code/PsyR#80 ·