Repository navigation
[PR] served-markers: graceful dispose records stoppedAt — restart flows no longer raise split-brain alarms (#3923) - #4989
Conversation
… longer raise split-brain alarms (#3923) A SIGTERM'd proxy's final marker write (dispose flush) lands with a fresh mtime seconds before its successor rebinds; findContestedWriters' 30s freshness fallback then counts the dead predecessor as live and logs a false [split-brain] error (observed in release-gate lane A proxy restart). Fix: dispose() stamps stoppedAt on the final marker. Peers skip markers carrying stoppedAt unconditionally — a recorded graceful stop is positively-known death and must not contest, even while the file is fresh or the pid has been reused. The freshness fallback is unchanged for crashed peers (no stoppedAt), preserving cross-platform pid invisibility coverage. Two regression tests pin both paths.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.6575-pr.4989.fbe45b1This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4989.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 无既有 issue/PR 针对「重启流程对已优雅停机的前任误报 split-brain」这一缺陷。同家族相关项:#3923(本功能的源头 issue,已关闭)、#4626/#4630(同一 split-brain 呈现面,但症状与机制都不同——那边是「横幅在 peer 消失后永久残留」,修的是 stale 标签: bug + scope/storage + p3(写者标记文件/会话状态持久化面的观测性误报;无功能损伤、纯日志+面板噪音)。 审核结论(八问)
验证
判定:可合并(待 CI 全绿收口;代码与回归审查均通过,无需改动)。 |
(ai: vllm-qwen/qwen3.8-27b) Merge-guard sync done: merged origin/master ( |
(ai: vllm-qwen/qwen3.8-27b) 收口更新(审核结论见上一条评论,此处只报最终状态):
|
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.891-master.09e33bf # this exact build
npm install -g billion-context@master # always the newest merged build
|
Problem
During the v0.1.209 release-gate run (lane A), the gate's intentional proxy restart logged a false positive:
Mechanics: the old proxy was SIGTERM'd; its
dispose()writes a final marker (intentional — peers should attribute its last commits). The successor rebinds ~3.5 s later and scans peer markers:isPidAlive(154838)is false, but the marker mtime is insidePEER_FILE_FRESH_MS(30 s), so the dead predecessor is counted "live" and an error is raised.The freshness fallback exists for platforms where the pid check cannot see the peer (cross-namespace) — it should only rescue crashed peers whose death we cannot prove, not a predecessor that told us it stopped.
Fix (
src/served-markers.ts)WriterMarkerFilegains optionalstoppedAt?: number— set only by a gracefuldispose()on its final marker write.findContestedWritersskips any marker carryingstoppedAt, unconditionally — before the liveness test. A recorded graceful stop is positively-known death: never a concurrent writer, even while the file is fresh or the pid has since been reused (which also removes a latent pid-reuse false positive).stoppedAt→ existing freshness fallback intact.Tests (
tests/served-markers.test.ts)stoppedAt; successor committing the same session seconds later logs nothing (the exact gate-restart sequence).stoppedAtskips even when the peer pid is alive (stop outranks liveness).stoppedAt).All 11 served-markers tests + 5 split-brain-surface tests pass;
tsc --noEmitclean.Notes
stoppedAtstay valid; new markers read by old builds are ignored field-by-field (they only skip ontypeof raw.stoppedAt === "number"— old builds don't know the key and behave exactly as before).