bug: A config reload stops the old pipeline while requests are still using it
Maintainer thường phản hồi trong vòng 1 ngà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
- 45/100
Hướng nghiên cứu
Start with core/reloader/reloader.go and the drain goroutine, then trace how Holder.Run pins a pipeline and how requests reach RunFinish; also find how WebSocket turns hold pipelines. The issue proposes stopping old pipelines when their holders finish, with a maximum wait and logging for remaining requests. Done means requests can finish on a live pipeline after reload, while the ceiling still ensures abandoned pipelines are eventually stopped.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
A config reload stops the old pipelines on a fixed timer: 30 seconds after the swap, whether or not anything is still using them (core/reloader/reloader.go, the drain goroutine after pipelines swapped). Stop calls each plugin's Shutdown.
Since #1561, a request keeps the pipeline it started on: Holder.Run pins it on the request context, and every later phase (RunResponse, RunResponseFrame, RunFinish, Resend) runs on that pin. That fixed the crash #1561 reported. But it means any request still open 30 seconds after a reload finishes on a pipeline whose plugins have shut down. Long requests are ordinary here:
- a long SSE inference stream;
- a CONNECT tunnel, whose Finishers run when it closes;
- a Codex Responses WebSocket turn (#1467), which keeps the pipeline it started on.
#1561 handled the one plugin where this skipped policy: cpex now follows fail_open when it is not ready. It did not change when the reloader stops a pipeline.
What happens today
Among plugins that tear something down in Shutdown, these are the ones a request reaches after Stop, read from the code (not reproduced):
lineage(OnFinish): the request's response span is dropped, since the tracer provider is shut down and the OTel SDK ignores spans that end after it.session-budget(last frame): the tokens reach the old instance's cache, and the Redis write fails with a WARN. The new instance never sees them.script(frames, last frame): the worker is shared with the new build when the script did not change. A changed script's old worker has stopped, so the hook fails, and underfail_closedthat is a late, recorded refusal.cpex: denies or allows perfail_open(#1561).
Nothing crashes, and nothing the client receives changes. The laptop's default pipeline (inference-parser, mcp-parser, a2a-parser, tool-prune) has none of these.
Possible approach
Stop an old pipeline when nothing holds it, not after a fixed delay:
- Count holders: increment when
Holder.Runpins the pipeline, and decrement after the request'sRunFinish. Paths that pin a pipeline outsideHolder.Run(the WebSocket turns) would hold it the same way. - The reloader waits for the count to reach zero, with a ceiling (minutes, not seconds), so a tunnel left open for hours cannot keep a pipeline's resources forever. Past the ceiling it stops the pipeline as it does today, and logs how many requests were still on it.
Raised in
CodeRabbit's review of #1467, about WebSocket turns. The same exposure exists on main for every long-lived request, so it is tracked here rather than fixed in that PR.
- Ngôn ngữ chính
- Go
- Star
- 23
- Fork
- 44
- Merge trung bình
- 16 giờ 8 phút
- Pull request đã merge (30 ngày)
- 234
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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 rossoctl/cortex
-
feedback laptop
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
Maintainer thường phản hồi trong vòng 1 ngày
-
chore: Remove the decline_responses_websockets translation after a deprecation releaseCó thể đã có người làm @Alan-Cha đã nhận 3 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
rossoctl/cortex#1625 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CodeQL flags request host and path reaching slog in pluginsCó thể đã có người làm @huang195 đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 60/100
rossoctl/cortex#1621 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 Hơn một tuần Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
agentop configure codex/opencode can wait on itself when an agent runs itCó thể đã có người làm @Alan-Cha đã nhận 9 ngày trước. Đang mở
rossoctl/cortex#1530 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rossoctl/cortex
Issue tương tự
-
[v3] KeyBindingManager calls (Add/Remove) are not converted into a case-insensitive accelerator.KeyĐang mởBug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
runtime: usleep sleeps nanoseconds instead of microseconds on linux/mips and linux/mips64Có thể đã có người làm @BRobertson7 đã nhận hôm nay. Đang mởcompiler/runtime
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
golang/go#82913 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aws/aws-sdk-go-v2#3625 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
adrianbrad/queue#92 ·