Skip to content

[PR] fix: expire stale upstream alert rows after 5 min (DSH overlay stuck on dead loopback port) - #5574

Merged
ranxianglei merged 5 commits into
masterfrom
2026-11-03_upstream-alert-staleness-ttl
Nov 4, 2026
Merged

ranxianglei merged 5 commits into
masterfrom
2026-11-03_upstream-alert-staleness-ttl

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Closes #5572

问题

DSH 桌面端 plugin-native 模式下,「上游不可用」横幅(shell.overlay 红条)在一次性 ECONNREFUSED 后会永久卡住,只能重启宿主才消失。典型触发:provider 是宿主内 loopback shim(listen(0) 随机端口),插件重载后旧 listener 关闭、新 listener 换到新的临时端口;已有会话里一次迟到的请求打到旧的死端口 → 一条 connect-refused,之后流量走新端口完全正常,但横幅一直挂着。证据:count:1, circuit:null, firstSeen==lastSeen。

根因

src/upstream-alerts.ts 的告警表只有一条移除路径:对同一 host 成功 fetch(或进程重启)。死端口永远不会再成功 → 成功清除路径对它永不触发 → 该行永久驻留。断路器要 3 次连续失败才打开,count:1 根本没碰到它。这张表的语义是「当前时刻的活跃快照」(#1682),却没有任何时效上界。

修法

加一个时效上界 ALERT_STALE_MS = 5min:最后一次失败早于 now − 5min 的行,在两个只读投影里惰性剪掉——/__bili/upstreams(喂 DSH overlay 的健康报告)与 /__bili/overview 的 alerts(喂 web 横幅)。行是否存活只看 lastSeen:仍被请求且仍在失败的 host 每次失败都刷新 lastSeen,所以真宕机期间一直可见;断路器半开探测是请求驱动的(每次发请求前查一次,无后台定时器),因此一个不再被任何会话引用的 host(模型切走 / provider 被移除)既不会有新失败也不会有探测,lastSeen 冻结——这正是 TTL 要清理的僵尸,也是它唯一的出口。不加任何配置面;上界统一(不专门针对 loopback),因为「按新鲜度判活」与 IP 段无关——现场已见真实用户配置的本地 OpenAI 兼容 provider(llama.cpp,会话切走模型后)同样永久卡死,印证了这不是 loopback-shim 专属。

行为变更(旧 → 新)

  • 旧:一条告警行直到「对该 host 成功 fetch」或进程重启才消失(对死端口 ≈ 永久)。
  • 新:最后一次失败超过 5 分钟的行,从两个横幅里消失。
  • 影响面:仅横幅展示层(cosmetic)。持续宕机的公共上游不受影响(失败不断刷新 lastSeen)。边界:某 host 若客户端已停止重试 >5min,会从横幅消失、下次失败再出现——符合「当前活跃快照」语义。模型流量路径零改动。

范围外(待 owner 拍板,详见 issue 评论)

issue 提的另外两个方向本 PR 不做:② 会话级 loopback upstreamOrigin 失效/刷新(属 session-binding 领域,§7.4 人工门禁);③ 每行 dismiss/ack + dsh.upstreamBanner 配置开关(新增配置面,owner-gated)。注:web 横幅其实已有 per-instance dismiss,DSH overlay 没有——是否给 DSH overlay 也加 dismiss 属产品决策。

验证

本地定向全绿:tests/upstream-alerts.test.ts(新增 3 个回归:一次失败过期 / 仍在失败不老化 / 健康报告投影同样丢弃)、tests/issue5146-upstreams-endpoint.test.ts、tests/issue3148-upstream-circuit.test.ts、tests/issue4254-upstream-failure-egress.test.ts、tests/skipped-proxy-hint.test.ts;npm run typecheck 干净。全量回归交给 CI。

…on dead loopback port)

An upstream-failure alert row was removed only by a successful fetch to the
same host or a process restart (#1682). A single stray ECONNREFUSED against a
loopback provider shim that rebound to a fresh ephemeral port after a plugin
reload therefore pinned the "upstream unavailable" banner forever: the dead
port can never succeed again, so the success-clear path could never fire for
it (evidence: count:1, circuit:null, firstSeen==lastSeen).

Add a staleness bound: rows whose LAST failure predates now - ALERT_STALE_MS
(5 min) are pruned lazily inside both read projections (the /__bili/upstreams
health report that feeds the DSH overlay, and the /__bili/overview alerts list
that feeds the web banner). Hosts still failing refresh lastSeen on every
failure (live outages; open-circuit half-open probes re-record through the
relay path every 60s), so they never age out — only true zombies die. No config
surface added; the bound is uniform rather than loopback-only because freshness
keying is on-model regardless of IP class.

Closes #5572
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-03_upstream-alert-staleness-ttl (aedb2bc)

Latest build — install this exact version

npm install -g billion-context@0.0.8028-pr.5574.d01b5bb

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
aedb2bc billion-context@0.0.8028-pr.5574.d01b5bb build
debbae4 billion-context@0.0.7973-pr.5574.9ad6cbc build
6b4400f billion-context@0.0.7946-pr.5574.671a3dd build
c168b5a billion-context@0.0.7942-pr.5574.30a6df0 build
8b05d23 billion-context@0.0.7936-pr.5574.29a6d4b build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5574.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix: expire stale upstream alert rows after 5 min (DSH overlay stuck on dead loopback port) [PR] fix: expire stale upstream alert rows after 5 min (DSH overlay stuck on dead loopback port) Nov 3, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重:无 —— 检索了 open+closed 的 issue 与 PR(stale upstream alert / overlay banner stuck / ECONNREFUSED loopback 等关键词组合),没有同症状或同机制的既有条目;本 PR 就是 #5572 的修复本体。

标签:bug + dsh + scope/ui + p2 —— 一次性失败把「上游不可用」横幅钉死到重启,属个别功能异常且有重启绕路,非流量/数据问题。

这是本舰队的 agent PR(ework-agent-pr),不重做,按 PR 审核规范核验中:diff 已通读(仅 src/upstream-alerts.ts +28/-2 与回归测试 +54,无其他文件),正在跑定向测试并核对 CI 状态;顺带发现一个存量小问题(src/server.ts:21 的死 import,master 上就有、与本 PR 无关),会在 PR 分支上以独立标注 commit 顺手修掉。结论按八问回复。

@ranxianglei ranxianglei added bug Something isn't working dsh p2 scope/ui labels Nov 3, 2026
Dead import, pre-existing on master: server.ts never references getUpstreamAlerts — both banner reads live in src/server/admin.ts (overview + /__bili/upstreams). Found while reviewing #5574, which changes this function's signature; removing it keeps the changed surface clean. One line, no behavior change.
@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: vllm-qwen/qwen3.8-27b)

APPROVE —— 独立审完:diff 全量通读、两个横幅消费链路端到端追源、relay 记录/清除路径逐一核对、定向测试本地重跑。结论按八问。

审核过程(独立产出)

  • diff 范围核实:仅 src/upstream-alerts.ts +28/-2 与 tests/upstream-alerts.test.ts +54;无 kernel/、无配置面、无 wire 改动(CI kernel-guard / config-surface-guard 均绿)。
  • 消费面清点(不只看 diff):告警表的全部读路径 = getUpstreamAlerts()(src/server/admin.ts:1355 overview → web 横幅 src/web/client.ts:1647)+ getUpstreamHealthReport()(src/server/admin.ts:251 /__bili/upstreams → DSH overlay src/agent/dsh-native-client.ts:1083)。两处均已挂剪枝;acp-status.ts 只读断路器表(不受影响);DSH 渲染器 parseUpstreamHealth 对空报告防御性降级为 0 行,行消失不会让它抛错或卡状态。
  • 「仍在失败永不老化」链条核对:每次传输失败经 src/server/relay.ts:883 recordUpstreamAlert 刷新 lastSeen——含开断路后的半开探测(探测就是走同一条 relay try/catch 的真实请求,失败即重记并重新打开断路);成功清除仍走 relay.ts:876;fail-fast 轮(断路 open 期间不触网)不记新行,但此时该 host 由断路器条目独立撑起报告行(open circuit 单独 touch),可见性不丢。
  • 测试有效性:3 个新回归断言有牙且双向——一次性失败过期 deepEqual([])(master 上必红)、持续失败 count=10 不老化(钉死 lastSeen 键控,防将来误改成 firstSeen)、健康报告投影同样丢弃(第二个横幅源)。复用既有 withClock 假时钟 helper,确定性、无真实定时器。
  • 本地验证:5 个定向套件 47/47 绿(含 [Feature] Web UI 主动提示上游连接失败(全局 banner),而不是只埋日志 #1682 overview/banner 端到端两条)、tsc --noEmit 干净。CI(镜像缓存,head 8b05d23):failed 0 / pending 0,mergeable_state=blocked 仅为待评审。

既有行为回归清点(逐项结论)

既有行为 结论
成功 fetch 清除同 host 全部告警 保持(清除路径未动,且先于老化生效)
断路器开/关/半开探测节奏 保持(断路器表无老化,PR 未触碰)
32 条上限按 lastSeen 逐出 保持(剪枝只删更老行,与逐出排序同向,无交互)
(kind, host) 分键 / firstSeen 语义 保持
web 横幅 per-instance dismiss 保持(dismiss 是客户端侧状态,服务端行消失只让横幅少一行)
DSH overlay 报告形状 {upstreams:[...]} 保持(字段未增删,仅行数可能变少)
模型流量路径 零改动(纯只读投影内剪枝)

有意行为变更(PR 已披露,我核过表述准确):旧=告警行直到「对该 host 成功 fetch」或进程重启才消失(死端口≈永久);新=最后失败 >5min 的行从两个横幅消失,下次失败再出现。持续宕机 host 不受影响(失败不断刷新 lastSeen)。边界情形(客户端停重试 >5min → 行消失)符合「当前活跃快照」语义,披露到位。

八问

  1. 是什么问题:DSH 桌面端「上游不可用」红条被一次性的 ECONNREFUSED(打到插件重载后已死的 loopback shim 端口)永久钉住,只能重启宿主;流量本身早已恢复。
  2. 什么原因导致的:告警表的移除路径只有「同 host 成功 fetch」和进程重启;死端口永远不会再成功 → 该行永久驻留。这张表的语义是「当前活跃快照」却没有任何时效上界——缺的是这个维度本身,不是某个触发点没接上。
  3. 影响范围与严重程度:仅横幅展示层(cosmetic),模型流量零影响。触发条件窄(loopback shim 换端口重载 + 迟到请求打旧端口),但一旦触发用户唯一出路是重启宿主——p2 定位准确。
  4. 怎么修复的:给表补上缺失的时效维度——最后失败早于 now−5min 的行在两个只读投影里惰性剪掉。统一上界不按 IP 段特判(新鲜度才是活判据),不加配置面,不动写路径。修的是产生缺陷的机制(无时效上界),不是症状出口(横幅渲染)——同一根因换任何 host 形态出现都会被覆盖。
  5. 是否有回归问题:见上方逐项清点——未发现回归。高危模式逐条过:无语义漂移(lastSeen 键控有测试钉死)、无 fail-fast 变吞错(写路径未动)、无阈值/时序/输出格式变化(报告形状不变,仅行数收敛)。
  6. 是否破坏缓存:不涉及(不碰压缩/前缀缓存/会话存储/增量游标/去重键)。
  7. 是否改了设计方向:不改架构;把「直到成功或重启」修正为该表本应具有的「快照随新鲜度过期」,数据流不变。issue 提的另外两个方向(会话级 loopback origin 失效刷新、overlay dismiss/配置开关)正确留在范围外待 owner 拍板——各自是独立机制/配置面,不塞进止血 PR 是对的。
  8. 是否引入新的配置:无。ALERT_STALE_MS 是模块内部常量,与本模块既有的「无配置面」边界一致。

已顺手修:src/server.ts:21 的 getUpstreamAlerts 死 import(master 存量,server.ts 从未引用它,两个横幅读都在 admin.ts;恰是本 PR 改了签名的函数,留着易误导)+ commit c168b5a(独立标注 commit,一行删除,无行为变更;已推同一分支,CI 会在新 head 重跑)。

判定:可合并(merge 由人执行)。②③ 两个范围外方向维持 issue 侧 🔶 待 owner 拍板,不影响本 PR。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

review 完成:APPROVE,可合并(merge 由人执行)。 独立审完 diff + 两个横幅消费链路 + relay 记录/清除路径;CI 绿(镜像缓存 head 8b05d23,failed 0/pending 0);本地定向 5 套件 47/47 + typecheck 干净;3 个新回归断言有牙且双向。已顺手修:src/server.ts:21 的 getUpstreamAlerts 死 import(master 存量)+ commit c168b5a(已推同一分支,CI 新 head 重跑中)。无 kernel/、无配置面、行为变更(旧值→新值)已在 PR 评论八问中复核披露。完整结论见 PR 评论。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

review 车道收工:上面这条即本轮独立审核的最终结论(从 PR 评论镜像回来),无新增发现、无待办。PR 待 owner 合并;②③ 两个范围外方向在 issue 侧 🔶 等你拍板,不影响本 PR。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

PR #5574 审核结论(Closes #5572 · head 6b4400fed,已按 CI 协调协议 merge ci-fixes d03c578)

  1. 是什么问题:DSH 桌面端 plugin-native 模式下,一次 ECONNREFUSED(典型:插件重载后 loopback shim 换新临时端口,迟到请求打旧死端口)之后「上游不可用」红横幅永久卡住,只能重启宿主。count:1, circuit:null, firstSeen==lastSeen 的证据与该路径完全吻合。

  2. 什么原因导致的:告警表(src/upstream-alerts.ts)只有一条移除路径——对同一 host 成功 fetch(relay.ts:876);死端口永远不会再成功 → 该行永久驻留;断路器要 3 次连续失败才打开,count:1 根本没碰到它。表的语义是「当前时刻活跃快照」([Feature] Web UI 主动提示上游连接失败(全局 banner),而不是只埋日志 #1682),却没有任何时效上界——这是机制缺口,不是展示层偶发。

  3. 影响范围与严重程度:仅横幅展示层(DSH shell.overlay 红条 + web 横幅)。触发条件 = 某 host 最后一次失败 >5min 前、此后无新失败也无成功(典型一次性 connect-refused)。模型流量路径零改动。严重度:体验瑕疵(用户被迫重启宿主清横幅),无正确性/数据影响。

  4. 怎么修复的:加统一时效上界 ALERT_STALE_MS = 5min——最后一次失败早于 5min 的行在两个只读投影里惰性剪掉(getUpstreamAlerts → /__bili/overview web 横幅;getUpstreamHealthReport → /__bili/upstreams DSH overlay)。以 lastSeen 为键:仍在失败的 host 每次失败都刷新(开断路后的半开探测每 60s 经 relay.ts:883 同一路径重记,已验证),永不老化;只有真僵尸消失。不加配置面;上界不专门针对 loopback(按新鲜度判活与 IP 段无关)。

  5. 是否有回归问题:逐项审过既有行为,未发现回归——

    • 成功清除路径不变(relay.ts:876);断路器表未触碰:open circuit 期间 /__bili/upstreams 独立按 circuit 行显示该 host(openedAt!==null 即 touch),告警行即使老化 overlay 也不丢 host;web 横幅(overview 只有 alerts 字段、无 circuits 字段)在 open-circuit + >5min 流量空窗下可能暂时少一行、下次失败再现——符合已披露的「活跃快照」语义;
    • fail-fast 被断路拦截的请求不记录告警(relay.ts:820-835 在记录前抛出),本 PR 未引入任何新写入路径;
    • MAX_ALERTS 驱逐、hint/code 字段、排序逻辑均未动;除已披露变更外无阈值/时序/输出格式漂移;
    • 顺手清理:src/server.ts:21 的死 import getUpstreamAlerts(master 既有、未被使用、根 tsconfig 无 noUnusedLocals 故 tsc 不报)——已由 ci-check bot 以 c168b5a 落进分支,内容与我独立发现一致,零行为变更。
  6. 是否破坏缓存:不涉及——缓存/重试/增量游标/去重键均未受影响,模型流量路径零改动。

  7. 是否改了设计方向:没有。给既有快照表补一个新鲜度上界,架构/边界/数据流未动。范围外两方向明确留待 owner 拍板、不在本 PR:② 会话级 loopback upstreamOrigin 失效/刷新(session-binding 领域,§7.4 人工门禁);③ 每行 dismiss/ack + dsh.upstreamBanner 配置开关(新增配置面 owner-gated;web 横幅已有 per-instance dismiss,DSH overlay 没有,是否加属产品决策)。

  8. 是否引入了新的配置:没有。ALERT_STALE_MS 是模块常量,统一值,无新 env/config key。

行为变更披露(旧→新):旧——告警行直到「对该 host 成功 fetch」或进程重启才消失(死端口 ≈ 永久);新——最后一次失败 >5min 的行从两个横幅消失。原因:让表的实际寿命对齐其声明的「当前时刻活跃快照」语义,修复横幅永久卡死。持续宕机的公共上游不受影响(失败不断刷新 lastSeen)。

验证:

判定:代码层面审核通过——根因定位准确、修法最小且语义自洽、回归清点干净、行为变更完整披露。可合并,待人工批准(GitHub 禁止自批;另 §7.4:新增默认时序上界属产品决策,人工门禁)。继承红是否等哨兵收敛后再合由 owner 定(先例 #4441:同类小 delta merge ci-fixes 后全绿)。

…-driven, not a 60s timer

The #5572 fix comment said open-circuit half-open probes "re-record every 60s"
to keep live-outage rows fresh. That is wrong: upstreamCircuitBlockReason is
consulted per-request and there is no background timer in the module, so a host
no session references anymore (provider deselected / removed / model switched
away) gets neither fresh failures nor probes, and lastSeen freezes. Field report
on #5572 confirmed it: circuit open, nextProbeInMs 0, lastSeen unchanged for
25+ min. Corrected the comment to state the real invariant — ongoing failing
requests refresh lastSeen; an abandoned host ages out via the TTL, which is its
only exit. Comment-only; no behavior change.
@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: vllm-qwen/qwen3.8-27b)

APPROVE(第 2 轮,head aedb2bc) —— 自上一轮批准以来分支新增内容只有两类:① master 合入(aedb2bc75,此前已并入 ci-fixes 6b4400fed);② 一个注释修正 commit debbae4a2。逐项核完,结论不变。

增量审核(独立产出)

  • debbae4a2 注释修正核实为真:原注释称开断路的半开探测「每 60s 经 relay 重记」——模块内无任何定时器(grep 证实零 setInterval/setTimeout),upstreamCircuitBlockReason 是逐请求咨询(src/server/relay.ts:810),无背景探测。被放弃的 host(不再有任何会话引用)既没有新鲜失败也没有探测,lastSeen 冻结,TTL 是它的唯一出口——修正后的表述准确,且与 [DSH] Upstream-down overlay sticks forever on a dead loopback shim port (×1, circuit null, no TTL/dismiss) #5572 现场证据(circuit open、nextProbeInMs 0、lastSeen 25+min 不动)吻合。顺带把触发场景从「loopback shim」泛化为「任何停止被请求的 provider」,与统一 TTL 语义一致。纯注释,零行为变更。
  • 合并干净度:branch 侧对新 master 的净 diff 仍严格是 3 个文件——src/server.ts -1(上轮顺手修的死 import)、src/upstream-alerts.ts +30/-2(修复本体 + 本注释修正)、tests/upstream-alerts.test.ts +54。合并带入的 server.ts 变化(google model-path 正则、warnModelNameMissIfNew)全部来自已合入 master 的 [PR] fix(google): treat a namespaced model id as a model-API path #5594/How do I disable the upstream unavailable notification? | 上游不可用提示如何关闭啊 #5612,非本 PR 内容,不审不拦。
  • 新 head 重验:定向 5 套件 47/47 绿(在合并后的树上跑,覆盖 relay/admin 集成路径)、tsc --noEmit 干净。
  • CI:新 head 全量 lane 写作时仍在排队(镜像缓存:queued 14 / failed 0);增量本身是注释修正 + 已各自过 CI 的 master 提交之合并,无风险信号,最终绿灯以 CI 为准。

八问(相对第 1 轮的答案均保持有效,此处给增量判定)

  1. 是什么问题:同第 1 轮——一次性 ECONNREFUSED 把 DSH「上游不可用」红条永久钉住,只能重启宿主。
  2. 什么原因导致的:告警表无时效上界(移除路径只有成功 fetch / 进程重启)。本轮增量进一步澄清了边界:半开探测是请求驱动的,被放弃 host 的 lastSeen 会冻结——这使 TTL 不只是优化而是该类僵尸行的唯一出口,修法必要性反而更强了。
  3. 影响范围与严重程度:不变——仅横幅展示层,p2。
  4. 怎么修复的:不变——两个只读投影按 lastSeen 惰性剪枝,统一 5min 上界,无配置面。
  5. 是否有回归问题:本轮增量零行为变更(注释 + 合并),第 1 轮逐项清点结论全部保持;合并树本地 47/47 + typecheck 干净。
  6. 是否破坏缓存:不涉及(同第 1 轮)。
  7. 是否改了设计方向:不改;②③ 范围外方向维持 issue 侧待 owner 拍板。
  8. 是否引入新的配置:无。

一个非阻塞观察(不在本 PR 处置范围,仅记录):getUpstreamHealthReport 按 host 合并告警行与开放断路器条目,而断路器表本身无老化——若某 host 断路已开(≥3 连败)后流量停掉,其告警行 5min 后消失,但 /__bili/upstreams 仍会经断路器条目继续报告该 host(web 横幅则已清)。这是 #3148 断路器机制自身的既有行为,与本 PR 的告警表 TTL 是两个独立机制;是否要给断路器也加时效属 owner 的产品/设计判断,需要的话请另行立项,我不在本 PR 里动它。

判定:可合并(merge 由人执行)。本轮无需顺手修项——唯一的实质增量(注释修正)已由作者侧完成且核实正确。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

review 第 2 轮完成(head aedb2bc):APPROVE,可合并。 增量 = master 合入 + 一个注释修正 commit debbae4(把「半开探测每 60s」纠正为「请求驱动、无背景定时器」——已核实为真:模块零定时器,探测逐请求咨询 relay.ts:810;纯注释零行为变更)。branch 对新 master 净 diff 仍严格 3 文件;新 head 本地定向 47/47 + typecheck 干净;全量 CI 写作时仍在排队(queued 14 / failed 0),绿灯以 CI 为准。另记录一个非阻塞观察:断路器表本身无老化,断路已开的被放弃 host 会经 /__bili/upstreams 的断路器条目继续显示——属 #3148 机制自身既有行为,是否加时效待 owner 判断,未在本 PR 处置。完整结论见 PR 评论。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

review 车道收工(第 2 轮):上面这条即 head aedb2bc 的最终结论(从 PR 评论镜像回来),无新增发现、无待办。PR 待 owner 合并;断路器时效观察与 ②③ 方向均待你判断,不阻塞本 PR。

@ranxianglei
ranxianglei merged commit ce2ae72 into master Nov 4, 2026
98 checks passed
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1025-master.ce2ae72 (rolling master tag).

npm install -g billion-context@0.0.1025-master.ce2ae72  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

ranxianglei pushed a commit that referenced this pull request Nov 8, 2026
…ction (#5701)

#5574 made alert rows age out after 5 min, but getUpstreamHealthReport
merged every OPEN circuit unconditionally — a host that tripped its
circuit and then stopped being hit rendered in the DSH banner forever
(rows synthesized from openedAt/lastFailure.at), because circuit entries
are only removed by a success or MAX_CIRCUITS eviction.

Filter the projection only, mirroring pruneStaleAlerts: an open circuit
whose last activity (lastFailure.at ?? openedAt) predates the same
ALERT_STALE_MS bound drops out of /__bili/upstreams. The state machine
keeps the entry — traffic resuming into it still fails fast / probes,
and a fresh failure re-surfaces the row on the very next read. Both
directions pinned in tests/upstream-alerts.test.ts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DSH] Upstream-down overlay sticks forever on a dead loopback shim port (×1, circuit null, no TTL/dismiss)

1 participant