microsoft / microsoft/durabletask-java
FailureDetails.IsCausedBy throws
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 29
- フォーク
- 18
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 2
説明
When an activity function throws an exception, and it is caught by a custom retry handler in an orchestrator, the retryContext allows accessing the FailureDetails for analysis of the failure. However, attempting to use the FailureDetails.isCausedBy() method will never succeed, as it internally is implemented using Class.forName() which requires the fully-qualified exception class name but FailureDetails does not have this information serialized, just the simple exception class name.
Repro:
@FunctionName("CustomRetryActivityFunction")
public String customRetryActivityFunction(
@DurableOrchestrationTrigger(name = "ctx") TaskOrchestrationContext ctx) {
TaskOptions options = new TaskOptions(retryContext -> {
FailureDetails lastFailure = retryContext.getLastFailure();
if (lastFailure != null
&& lastFailure.getErrorType().equals("OverflowException")
// This line should work, but doesn't
// && lastFailure.isCausedBy(InvalidOperationException.class)
&& retryContext.getLastAttemptNumber() < 3) {
return true;
}
return false;
});
return ctx.callActivity("RaiseComplexException", ctx.getInstanceId(), options, String.class).await();
}
``
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
FailureDetails.isCausedBy() から開始し、retryContext 経由で failure にアクセスしたときに、failure のエラー型がどのようにシリアライズされ、再構築されるかを追跡します。提供されたカスタム retry handler と exception scenario を使用して、failure を再現します。isCausedBy() が cause class を正常に評価でき、再現したケースのカバレッジがある状態を完了とします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100