fix(schedule): 选号按持久化冷却条件清除本机账号级阻断 - #6320
Open
spongehah wants to merge 1 commit into
Open
Conversation
- Treat TempUnschedulableUntil/RateLimitResetAt/OverloadUntil as source of truth during account selection - Drop stale local account-level runtime blocks with generation+deadline CAS - Leave model-scoped transient and Grok quota blocks unchanged
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.
Fixes #6319
变更概述
多实例部署时,OpenAI/Grok 失败会同时写入持久化冷却字段和进程内openaiAccountRuntimeBlockUntil。管理端重置/恢复会清 DB/快照,但其它网关实例仍保留本机阻断,继续跳过该账号。本 PR 让选号以持久化冷却为准:
TempUnschedulableUntil/RateLimitResetAt/OverloadUntil均未生效,则丢掉过期的本机账号级阻断取舍
这确实违背当前传输错误路径的契约:即使 DB 写失败或账号缓存尚未同步,内存阻断也必须立即生效。改完之后,调度 Account 上冷却字段为空即 fail-open,本机账号级阻断会被丢掉。
我仍然认为以 DB/快照为准才是多实例下最合理的行为,这也是目前最简单的修复方式。如果认为这个取舍不合理,请不要合并本 PR——但 #6319 里的多实例问题仍然存在,需要重新修复。
测试
TestRuntimeBlockHonorsClearedPersistedCooldownTestRuntimeBlockKeepsActivePersistedCooldownTestRuntimeBlockConditionalClearSkipsNewerGenerationTestHandleOpenAITransientError_HardDisableStillBlocksWholeAccount已按 fail-open 更新