world-postgres: startup recovery re-enqueues runs without a recorded namespace under the World's own prefix, not the registered flow handler's

Đang mở
#5,442 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
50/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ệ
postgresql, typescript
Lĩnh vực
databases

Hướng nghiên cứu

Start at the start() call in packages/world-postgres/src/index.ts, where the TODO points to this issue, and read reenqueueActiveRuns in @workflow/world to see how the fallback namespace is chosen. Find where the flow handler's in-process registration and its namespace are available before start(). Done when runs without a recorded namespace are re-enqueued under that handler's prefix, runs with a recorded namespace are unchanged, and the registration warning is still shown.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

On start(), the Postgres World re-enqueues every active run it owns (reenqueueActiveRuns from @workflow/world, called from packages/world-postgres/src/index.ts). A run goes back to the queue namespace it recorded when it was created; a run that recorded none goes to the World's own namespace (the namespace option, or WORKFLOW_QUEUE_NAMESPACE in the World's process).

Since #5315 the World delivers the Workflow SDK's messages in process, to the flow handler the app registered. That handler is registered under the prefix the flow route was built with (WORKFLOW_QUEUE_NAMESPACE at build time). When that prefix differs from the World's own, the World warns once at registration and still delivers what the SDK publishes, but the runs it recovers at startup without a recorded namespace go to its own prefix, which no handler in the process takes: the runner claims the job and fails the delivery.

Intended fix

Recover such runs under the registered flow handler's prefix rather than the World's namespace option: when a flow handler (one carrying the in-process entry) is registered before start(), pass its namespace as the fallback to reenqueueActiveRuns. Runs that recorded a namespace are unaffected.

Current state

The limitation is noted in the Postgres World docs (Programmatic configuration) and in the registration warning, and a TODO at the start() call in packages/world-postgres/src/index.ts points here.

Related: #2978 covers the wider question of isolating applications that share one database; this issue is only about the fallback namespace of recovery inside one application.

Ngôn ngữ chính
TypeScript
Star
2.5k
Fork
401
Merge trung bình
1 ngày 21 giờ
Pull request đã merge (30 ngày)
201

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có 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 vercel/workflow

Tất cả issue của vercel/workflow

Issue tương tự

Thêm issue về TypeScript

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.