listen: to.any never completes — areAnyComplete passed by value to await, always times out
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- backend, distributed-systems
Hướng nghiên cứu
Bắt đầu trong pkg/zigflow/tasks/task_builder_listen.go, đặc biệt là areAnyComplete, signal/update callback và điều kiện AwaitWithTimeout của await. Tái hiện bằng workflow any.yaml được cung cấp và các Temporal CLI commands, sau đó chạy các bài kiểm thử Go liên quan của dự án hoặc bổ sung coverage cho listen.to.any. Hoàn tất khi signal approve hoặc reject hoàn thành workflow trước timeout, trong khi hành vi của to.all và to.one vẫn được giữ nguyên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
A listen task using to.any never completes when a matching signal arrives. The workflow waits for the whole timeout and then fails with [408] Timeout Error. to.one with the same signal completes immediately.
Version: zigflow 0.15.2 (source checked at cc35734), Temporal CLI 1.9.1 dev server.
Reproduction
any.yaml:
document:
dsl: 1.0.0
taskQueue: repro-listen
workflowType: listen-any
version: 0.0.1
title: listen.to.any repro
do:
- waitForApproveOrReject:
metadata:
timeout: 20s
listen:
to:
any:
- with:
id: approve
type: signal
- with:
id: reject
type: signal
- done:
set:
completed: true
Control one.yaml is identical, except it uses workflowType: listen-one and to.one.with: {id: approve, type: signal}.
WORKFLOW_FILE= WORKFLOW_DIRECTORY=. WORKFLOW_DIRECTORY_GLOB='*.yaml' LOG_LEVEL=debug zigflow run
temporal workflow start --task-queue repro-listen --type listen-one --workflow-id r-one
temporal workflow start --task-queue repro-listen --type listen-any --workflow-id r-any
temporal workflow signal --workflow-id r-one --name approve --input '{"ok":true}'
temporal workflow signal --workflow-id r-any --name approve --input '{"ok":true}'
Result
r-one: COMPLETED{"completed":true}immediately.r-any: FAILED after 20s with[408] Timeout Error: no matching event received within 20s.- History:
TimerStarted (20s)→WorkflowExecutionSignaled (approve)→TimerFired→ failed. - The debug log shows
Waiting for first listening to completewithstate=falseat start, again right after the signal, and again at timeout.
- History:
Cause
In pkg/zigflow/tasks/task_builder_listen.go, areAnyComplete (a bool, line 107) is set to true by the signal/update callback (line 115). But it is passed by value to t.await(...) (line 154), and the AwaitWithTimeout condition inside await (lines 174–190) reads that copy, so it never becomes true.
to.all is not affected because areAllComplete is a slice and shares its backing array.
Suggested fix
Pass *bool (or a func() bool condition) to await instead of the bool value, for example t.await(ctx, workflowCtx, timeout, isAll, &areAnyComplete, areAllComplete) and return *areAnyComplete. This is untested; I don't have a Go toolchain here.
- Ngôn ngữ chính
- Go
- Star
- 206
- Fork
- 27
- Merge trung bình
- 7 giờ 17 phút
- Pull request đã merge (30 ngày)
- 27
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của zigflow/zigflow
-
never-stale v1
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 74/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
-
Support workflow streams Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
enhancement help wanted
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
Tất cả issue của zigflow/zigflow
Issue tương tự
-
ai-generated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SiaFoundation/indexd#1116 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
wakatime/wakatime-cli#1585 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Agent-Field/CodeAF#1489 ·