Repository navigation
一个请求体字节围栏的参考实现:整包体上限 + 字段级丢弃记账 + 分类器修正 #7820
txxt114514
started this conversation in
General
Replies: 1 comment
|
Useful data point for ③: a reclassification for exactly this case already exists as a plugin, and I tested it against a recorded failure.
Two boundaries from the other end, which matter for ①:
Your classifier section and #7626 describe the same gate from two sides; happy to cross-link if that helps. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
不是新发现。** #6754 提了诉求("至少要有大小上限,且失败不能让会话不可用")、#6497 给了咽喉点修法、#6134 给了"跳过失败条目而不是让整个 profile 失败"的主张 —— 到今天还没有一份能跑的代码挂在这里。这篇是代码。不提交 PR(CONTRIBUTING 说明暂不接受外部 PR),只作参考。
上游
dsh-session-log-deepseek@0.1.7-rc.2已给那个字段加了maxBytes,自锁解决了。但它约束的是一个字段 —— 引用 @yamingmou 在 #7699 的说法:"Same order of magnitude, different object." 下面补的是另外两层。① 整包体上限
判据是整份 payload 的字节数,不是任何单个字段 —— 所以任何原因变大的请求体都拦得住。
② 丢弃必须记账(#5426 的反对意见是对的:要隔离就明着隔离)
③ 分类器:无正文的 400/413 不再一律落
INVALID_REQUEST原来那个码下游一处都不消费(递归 grep 三种写法:12 处命中全是生产点,0 处分支)。收紧后
dsh-compaction-basic:885、dsh-llm-retry:160与DEFAULT_RETRYABLE_CODES才能正确触发。实测(一台真机,Windows 11 + openresty 前置)
三条踩坑(这篇最值钱的部分)
accept()的位置不能动。 它必须在response.ok分支内、SSE 被消费之前。挪到 2xx 之外就等于让水位撒谎。宁可水位不动。delivery-accepted—— 推论同上:字段没上传成功,就不存在"被接受"。DEFAULT_TIMEOUT_MS = 3e4因误杀大历史加载被投诉(dsh-client-connection:history 等大载荷 RPC 受全局 30s 超时限制,Web 端报「历史加载失败:signal timed out (internal)」—— timeoutPolicy 钩子已存在但无人接线 #7143/dsh-client-connection:history 等大载荷 RPC 受全局 30s 超时限制,Web 端报「历史加载失败:signal timed out (internal)」—— timeoutPolicy 钩子已存在但无人接线 #7144)而去掉,然后 [Bug][0.1.5-rc.2 + 0.1.6-alpha.2] Web 发送链静默挂起:prompt 类 unary RPC 无 deadline,传输挂起时 echo 永不退场(#2060 的翻转面) #7210 报出翻转面(静默挂起)。要做就用"连接空闲"而不是"总耗时",且必须可配置。catch(() => {})的数量去修。 实测 878 个lib/**/*.js里 55 处这个写法,只有 1 处属于本族,47 处是正确的串行队列续链守卫(例dsh-api-terminal-controller:492)。该审计的是成功信号的判据。局限
8 MiB是实测峰值 6 倍的经验值,不构成"任何合法请求都能通过"的保证;(32,48] MB是夹逼区间不是确切值;只测了 deepseek-official 线路;补丁是给0.1.7-alpha.2的 dist 写的,上游已改过,不能直接套。前作:#6754 #6862 #7658 #6497 #6134 #7632 #7310 #7220 #7670 #5426 #2865 #5263
All reactions