Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

listen: to.any never completes — areAnyComplete passed by value to await, always times out

Đang mở Phù hợp với người mới
#598 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

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 complete with state=false at start, again right after the signal, and again at timeout.

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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của zigflow/zigflow

Tất cả issue của zigflow/zigflow

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.