Repository navigation
fix: 本地请求超时不再触发账号冷却 - #4
Merged
Merged
Conversation
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.
单账号的长请求达到网关总超时时,原逻辑会把本地取消计入账号失败并触发整段冷却,导致后续请求立即返回 503。现在本地总超时、客户端取消和网关退出不会触发账号失败冷却;超时请求仍记录为 504 / timeout 并释放并发槽位,原账号可立即接受后续请求。错误提示改为「网关请求总超时」,避免误认为上游返回了超时。
正常结束分支与异常分支均排除本地取消。总超时仍是总时限;上游 408/429/5xx、真实断流及 Responses 缺少结束事件的检测保持现有语义。
验证:
npm run test:unit:310 项全部通过。npm run typecheck、修改文件的 Prettier 检查及git diff --check通过。修复 #2 中已确认的总超时误冷却问题。Responses 的兼容性兜底需要实际 SSE 样本验证,未把无终止事件的 EOF 无条件当作成功。
Refs #2