[Bug] Nondeterminism replaying local activity markers recorded after a FORCE_CLOSE_COMMAND workflow task failure (1.34.0)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 8/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- python
研究方向
The failure is a replay nondeterminism error, Missing associated machine for LocalActivity(1719), raised when Replayer reprocesses the downloaded history. Start by reproducing it from the sanitized marker metadata, then check how local activity results are ordered within an activation after a FORCE_CLOSE_COMMAND task failure. Done means a replay of that history succeeds without the error. This needs deep knowledge of the workflow state machine and the Rust core, so it is not a first contribution.
由索引模型根據 Issue 內容生成。
描述
What are you really trying to do?
A workflow fans out ~900 regular activities with asyncio.gather. A workflow outbound interceptor records progress with a local activity: at most one is in flight, and when it resolves a done callback starts the next one with the changes accumulated in the meantime. (We have replaced it with a regular activity as a workaround.)
Describe the bug
While results streamed in, workflow tasks took 2.5-6 s and the server failed them 12 times with WORKFLOW_TASK_FAILED_CAUSE_FORCE_CLOSE_COMMAND (51-139 activity completions arrived during each task). After one of those, the next workflow task (started 08:52:05.021Z, completed 08:52:08.319Z) recorded, in this order:
- local activity marker seq 1296 (
activation_index1,original_schedule_time08:52:04.597Z,complete_time08:52:00.700Z) - 422 x ScheduleActivityTask (seq 1297-1718)
- local activity marker seq 1719 (
activation_index1,original_schedule_time08:52:04.637Z,complete_time08:52:02.229Z) - 49 x ScheduleActivityTask
- local activity markers seq 1769 (
activation_index2) and 1770 (activation_index3)
The complete_time of 1296 and 1719 is before that task started, so both ran during the force-closed attempt (08:52:00.674Z-08:52:04.941Z) and their results were handed to the next attempt.
Any later full replay of this history fails with:
[TMPRL1100] Nondeterminism error: Missing associated machine for LocalActivity(1719)
Replaying the downloaded history with Replayer, the same workflow code and temporalio 1.34.0 fails the same way, so the SDK cannot replay a history it wrote. On the live worker the workflow task kept failing until we terminated the workflow (114 attempts over 16 hours).
Our reading (may be wrong): in the original activation 1, the 1296 result was delivered after the 422 activity resolutions, so the next local activity got seq 1719. activation_index keeps 1296 in activation 1 but not its position among the other resolutions in that activation, so on replay the next local activity gets a different seq.
Minimal Reproduction
We don't have a minimal reproduction yet. The history contains customer data, so we can't attach it, but we can share sanitized event and marker metadata or run a patched build against it.
Shape: asyncio.gather over many activities, plus an outbound interceptor that chains one local activity at a time from done callbacks, plus enough concurrent completions to trigger FORCE_CLOSE_COMMAND (default history.maximumBufferedEventsBatch = 100).
Environment/Versions
- temporalio (Python) 1.34.0, which includes "Record order LAs are resolved in WFTs" (temporalio/sdk-rust#1616); Python 3.12; Linux container
- Temporal server 1.31.1, default dynamic config
- Related: #1881 (closed), #1578 (open)
Additional context
Workaround: send the recording call as a regular activity instead of a local activity.
- 主要語言
- Python
- 星號
- 1.2k
- 分支
- 269
- 平均合併
- 1 天 20 小時
- 30 天內合併 PR
- 60
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
temporalio/sdk-python 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
temporalio/sdk-python#496 ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 57/100
temporalio/sdk-python#1988 ·
維護者通常 1 天內回覆
-
Proposal: handle SIGTERM by default to initiate graceful worker shutdown可能已有人在做 @eamsden 於 12 天前認領。 未關閉
temporalio/sdk-python#1948 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Cloud CI Skips Nexus Tests可能重新可做 @tconley1428 於 70 天前認領,目前沒有進行中的 PR。 未關閉
temporalio/sdk-python#1704 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 45/100
temporalio/sdk-python#1592 · 8 則留言 ·
維護者通常 1 天內回覆
查看 temporalio/sdk-python 的全部 Issue
相似的 Issue
-
[Bug]: `hermes plugins update` clones an entire monorepo twice - `subdir` is resolved but dropped at both catalog-update call sites可能已有人在做 @HootRock 今天認領。 未關閉comp/cli P2 type/perf
難度 2/5 1-3 小時 新手友好度 72/100
NousResearch/hermes-agent#142417 · 2 則留言 ·
維護者通常 1 天內回覆
-
bug enhancement python
難度 2/5 1-3 小時 新手友好度 85/100
DewaldOosthuizen/tech-cheat-sheets-and-notes#392 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆
-
bug p2
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
Restore postgresql_vm_test_charm actions.yaml change (removed in canonical/postgresql-operator#2054)未關閉
難度 1/5 1 小時以內 新手友好度 85/100
canonical/postgresql-single-kernel-library#390 · 1 則留言 ·
維護者通常 2 天內回覆