Local activity scheduleToClose budget restarts when a timer-backed retry runs on replay
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- java
調査の方向性
Start in temporal-sdk/src/main/java/io/temporal/internal/statemachines/LocalActivityCallback.java, tracing how firstSkd is parsed and passed into retries. Reproduce with sticky queue scheduling disabled and the listed local activity options; done means replayed retries preserve the original schedule-to-close budget, terminate with RETRY_STATE_TIMEOUT, and a regression test covers the behavior.
索引モデルが issue の本文から書いたものです。
説明
Expected Behavior
A local activity that retries through a workflow timer keeps counting ScheduleToCloseTimeout from its first attempt across replay. sdk-core restores the original schedule time from the marker and hands it back with the retry (local_activity_state_machine.rs:147, :646); its proto says it "Must be passed with attempt to the retry LA" (activity_result.proto:97-99). sdk-go sets the schedule time from workflow time (workflow.go:1281) and computes the deadline from it (internal_event_handlers.go:892-894), so both preserve the original scheduling baseline across replay.
Actual Behavior
Java parses firstSkd from the marker into LocalActivityFailedException, then discards it (LocalActivityCallback.java:29-37). The retry uses System.currentTimeMillis() captured when workflow code ran, which on replay is the replay clock. The retry pre-check then sees a budget computed from that clock, so a replay can reset the budget. In the reproduction below the activity runs all 5 attempts and ends with RETRY_STATE_MAXIMUM_ATTEMPTS_REACHED instead of RETRY_STATE_TIMEOUT. Further evictions can keep extending it while retries remain eligible. This dates to v1.18.0 (#1542); it's not a regression.
Steps to Reproduce the Problem
- Worker with
WorkerOptions.newBuilder().setStickyQueueScheduleToStartTimeout(Duration.ZERO), so every workflow task replays full history (an eviction or restart during backoff does the same). - Run:
@ActivityInterface public interface Fails { String run(); }
public static class FailsImpl implements Fails {
public String run() { throw new RuntimeException("fail"); }
}
@WorkflowInterface public interface Wf { @WorkflowMethod String run(); }
public static class WfImpl implements Wf {
public String run() {
return Workflow.newLocalActivityStub(Fails.class, LocalActivityOptions.newBuilder()
.setScheduleToCloseTimeout(Duration.ofSeconds(10))
.setLocalRetryThreshold(Duration.ofSeconds(1))
.setRetryOptions(RetryOptions.newBuilder()
.setInitialInterval(Duration.ofSeconds(4))
.setBackoffCoefficient(1)
.setMaximumAttempts(5).build())
.build()).run();
}
}
- Expected:
RETRY_STATE_TIMEOUTafter about 2 attempts, since attempt 3 would start at ~8s with ~2s left, under the 4s backoff. Actual:RETRY_STATE_MAXIMUM_ATTEMPTS_REACHEDafter all 5 attempts.
Specifications
- Version:
mainat 4a4e6b2d (v1.40.0-4) - Platform: macOS, JDK 21, in-process test server
One limitation: the marker value is the first worker's wall clock, so cross-worker clock skew can shorten or lengthen the budget. I have a fix with a regression test ready.
- 主要言語
- Java
- スター
- 433
- フォーク
- 257
- 平均マージ
- 2日 20時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
temporalio/sdk-java のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
temporalio/sdk-java#1825 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
temporalio/sdk-java#3121 ·
メンテナーはふだん 1 日以内に返信
-
Allow a timer summary on Workflow.sleep and Workflow.await with timeout対応中かも @sangkyoonnam が 4 日前に担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
temporalio/sdk-java#3108 ·
メンテナーはふだん 1 日以内に返信
-
Warn if the SDK tried to send a payload above a specific size - Java対応中かも @jmaeagle99 が 26 日前に担当しました。 オープン
temporalio/sdk-java#3059 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Promise.get(timeout, unit) throws a misleading TimeoutException when the workflow is canceled対応中かも @Quinn-With-Two-Ns が 41 日前に担当しました。 オープン
temporalio/sdk-java#3026 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
temporalio/sdk-java の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
bancolombia/scaffold-clean-architecture#1002 ·
メンテナーはふだん 1 日以内に返信
-
CalendarEventAttendance/get returns eventAttendanceStatus while the doc says attendanceStatus対応中かも @chibenwa が今日担当しました。 オープンbug claude
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
linagora/tmail-backend#2697 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/skywalking#14120 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Case-insensitive search suggestions miss items when the JVM default locale is Turkish対応中かも @thswlsqls が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
HMCL-dev/HMCL#6943 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信