Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Only the innermost exception is returned when activity functions throw

オープン
#238 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
backend

調査の方向性

まず、activity-function の失敗に対して返される FailureDetails と、retryContext.getLastFailure() がそれをどのように公開するかを追跡します。Java SDK の動作を、issue で言及されている他の Durable 言語実装と比較します。最外層のユーザーエラー、その完全修飾型、およびすべてのネストされた内部エラーを再帰的に検査できるようになれば完了です。

索引モデルが issue の本文から書いたものです。

説明

P2

When an activity function throws an exception, we return a FailureDetails but it only represents the innermost exception. Request changing this behavior to match the other durable language implementations returning the outermost user error and all inner errors recursively.

Repro code:

    @FunctionName("CustomRetryActivityFunction")
    public String customRetryActivityFunction(
            @DurableOrchestrationTrigger(name = "ctx") TaskOrchestrationContext ctx) {
        TaskOptions options = new TaskOptions(retryContext -> {
            FailureDetails lastFailure = retryContext.getLastFailure();
            if (lastFailure != null
                    // BUG: Only the innermost failure is available in the Java SDK
                    // BUG: isCausedBy() relies on Class.forName() but we do not provide the fully qualified class name
                    //      in the FailureDetails 
                    && lastFailure.getErrorType().equals("OverflowException")
                    // && lastFailure.isCausedBy(InvalidOperationException.class)
                    // BUG: We do not implement inner failures in the Java SDK yet
                    // && lastFailure.getInnerFailure() != null
                    // && lastFailure.getInnerFailure().isCausedBy("java.lang.OverflowException")
                    && retryContext.getLastAttemptNumber() < 3) {
                return true;
            }
            return false;
        });
        return ctx.callActivity("RaiseComplexException", ctx.getInstanceId(), options, String.class).await();
    }

    @FunctionName("RaiseComplexException")
    public String raiseComplexException(
            @DurableActivityTrigger(name = "instanceId") String instanceId,
            final ExecutionContext context) throws InvalidOperationException {
        AtomicInteger count = globalRetryCount.computeIfAbsent(instanceId, k -> new AtomicInteger(0));
        int current = count.incrementAndGet();
        if (current == 1) {
            OverflowException inner = new OverflowException("Inner exception message");
            InvalidOperationException ex = new InvalidOperationException(
                "This activity failed\r\nMore information about the failure", inner);
            throw ex;
        } else {
            return "Success";
        }
    }

Result:

Image
主要言語
Java
スター
29
フォーク
18
平均マージ
1日 10時間
マージ済み PR(30日)
2

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/durabletask-java のほかの issue

microsoft/durabletask-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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