bug: A config reload stops the old pipeline while requests are still using it
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 23
- フォーク
- 44
- 平均マージ
- 16時間 37分
- マージ済み PR(30日)
- 250
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rossoctl/cortex のほかの issue
-
UI shows costs for all sessions even when drilled into a session対応中かも @esnible が 20 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
rossoctl/cortex#1116 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
feedback laptop
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 60/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1週間以上 初心者へのやさしさ 18/100
メンテナーはふだん 1 日以内に返信
rossoctl/cortex の issue をすべて見る
似ている issue
-
area:sampler tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
jmbarzee/temporal-architect#302 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
riverqueue/river#1576 ·
メンテナーはふだん 1 日以内に返信
-
NFS StorageProvider renders a missing nfsSubDir as "<no value>"対応中かも @ldming が今日担当しました。 オープンkind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apecloud/kubeblocks#11067 ·
メンテナーはふだん 1 日以内に返信
-
area:ui bug priority:low
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
RTX payload type is not found when the RTX fmtp line has rtx-time対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信