Stream write fails with HTTP 409 "inconsistent sequencing state" with concurrent writers (5.5.0, HTTP transport)

Đang mở
#5,418 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ó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
15/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
nodejs, typescript

Hướng nghiên cứu

The failure comes from the HTTP stream write path: a PUT to /api/v2/runs/<runId>/stream/<streamName> that returns 409 and is wrapped as a StreamError. Start there, then reproduce two concurrent getWritable() writers on the HTTP transport to see whether the conflict is reachable from client code. Done means either the concurrent-write conflict no longer occurs, or the 409 is classified as a non-retryable dropped write. The issue suggests the server side may be at fault, so this may end in a server change.

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

Mô tả

Summary

On Vercel, a step that writes to a run's default stream intermittently fails with HTTP 409 and the server message Redis stream "strm_<runId>_user" has inconsistent sequencing state. The failure is deterministic once it starts: every retry of the step gets the same 409, so the step exhausts its retries and the run fails, even though the user-facing work in a parallel step had already succeeded.

Environment

  • workflow / @workflow/core / @workflow/world-vercel 5.5.0
  • Vercel world, Fluid compute, Node.js runtime
  • Streams pinned to the HTTP transport: WORKFLOW_STREAMS_TRANSPORT=http and WORKFLOW_EVENTS_TRANSPORT=http

What happens

  • Two steps of the same run write to the run's default stream at the same time: one writes model output chunks (getWritable() in a "use step" function, lock released in finally), the other writes small progress parts. The streaming docs say concurrent writers are allowed.
  • One write gets:
StreamError: Stream write failed: HTTP 409 (PUT https://vercel-workflow.com/api/v2/runs/<runId>/stream/strm_<runId>_user)
{"success":false,"error":"conflict","message":"Redis stream \"strm_<runId>_user\" has inconsistent sequencing state"}
  • Both writer steps then fail the same way on each retry (Max retries reached, bubbling error to parent workflow), and the run ends with FatalError / USER_ERROR wrapping the StreamError (STREAM_ERROR).
  • In our case the run was still executing on an older deployment while a newer one had been promoted; we have not confirmed whether that matters.

Expected

  • Concurrent writers to the same stream should not put the stream into an inconsistent state, or
  • if the state is unrecoverable, the error should be classified so callers can treat it as a dropped write rather than retrying an append that can never succeed.

Notes

  • On the HTTP transport the client sends no sequence or writer id, so the inconsistent state does not seem reachable from client behaviour; it looks server-side.
  • Possibly related: #4306 (acknowledged chunks missing under concurrent load), #5383 (stream socket closed mid-run on 5.4.0). Separately, #4414 means a step that catches this error still fails after its body returns, which turns a dropped progress write into a failed run.
  • Happy to provide run ids privately if useful.
Ngôn ngữ chính
TypeScript
Star
2.5k
Fork
401
Merge trung bình
2 ngày 36 phút
Pull request đã merge (30 ngày)
150

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.