Repository navigation
fix: 实时跟踪当前并发(Acquire/Release) - #366
Merged
Merged
Conversation
InFlight was only refreshed by MergeHealth (~30s probes), so the overview live strip and sidebar lagged and WorkBuddy/Trae stayed at 0. Count slots on the chat attempt path instead; probes no longer overwrite InFlight. Sidebar polls /api/live like the overview strip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根因
Item.InFlight只在MergeHealth(约 30s 探活 / 手动刷新)里写入;请求开始/结束不加减。inFlight,但主进程只在探活时抄一次,UI 仍滞后。InFlightIndicator还在打/api/overview/summary,与概览LiveStrip(/api/live)不同源。修法
Pool.Acquire/Pool.Release:持锁加减;MaxInFlight>0且已满则 Acquire 失败。MergeHealth不再覆盖InFlight(只更新 ready/hot/restarts/lastError/runtime_state);注释标明执行器是 in-flight 源。ChatNonStream/chatStreamProxy(含 native responses):pickNext后立刻 Acquire;失败则 exclude 继续(防 TOCTOU)。非流式各路径 Release;流式成功返回时在 BodyClose()时 Release;X-Qoder-Account改写后仍按 Acquire 时的 pool id Release。Upsert保留现有InFlight,避免注册/刷新把进行中的计数清零。fetchLive(),约 2.5s、仅可见时轮询。容量公式未改(enabled 账号
max_inflight之和,默认 4)。未改 RPM。测试
go test ./...通过scripts/release-notes.py validate通过npm run sync嵌入 static自测建议
/api/live与侧边栏「当前并发」应在一轮轮询(~2.5s)内升高,结束后回落。剩余风险
Response却从不Close()Body,对应 slot 会泄漏到进程重启(与连接泄漏同类)。不要 merge / 不要打 tag。