syncProbeTimers publishes scheduler state BEFORE arming the anchor, so nextAnchoredRunAt reads null exactly when an operator checks it
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 86/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
调研方向
从 util/changeProbe.js 中的 syncProbeTimers 开始,然后阅读 armIntervals 和 publishScheduler,以跟踪已发布快照的顺序。为 continuous 到 anchored 的实时切换添加或更新测试,并验证在 arming 后 published nextAnchoredRunAt 是有限值;对于 disarmed 或不可用的 anchors,保留 null 报告。
由索引模型根据 Issue 内容生成。
描述
Small, but it breaks the one signal the code designs for this.
What happens
In syncProbeTimers (util/changeProbe.js):
armedSweep = desiredSweep;
armedCanary = desiredCanary;
void publishScheduler(); // <-- publishes here; nextAnchorAt is still null
if (desiredSweep === null) return;
if (wasEnabled || isAnchored()) {
armIntervals(); // <-- arms the anchor, sets nextAnchorAt
return;
}
publishScheduler() runs before armIntervals(), so the published snapshot captures nextAnchorAt while it is still null. The admin surface then reports nextAnchoredRunAt: null until something else republishes — in practice the end of the current sweep, which can be hours away.
Why it matters
armAnchorTimer uses that exact field as its failure signal, and says so:
An unusable anchor arms NOTHING.
setTimeout(fn, NaN)fires at once, which would turn a typo in the timezone into a full-rate pass on every config apply; a warning and a nullnextAnchoredRunAton the admin surface is the failure mode that gets noticed and fixed.
So null is supposed to mean "your anchor is broken, fix it". After this ordering bug it also means "the anchor is perfectly fine, it just has not been republished yet" — and the two are indistinguishable from the admin API.
Observed on a 4-node deployment, switching changeProbe.mode from continuous to anchored live:
mode=anchored armed=anchored:00:05|America/Chicago nextAnchoredRunAt=None stillRunning=True
on all four nodes. The anchor was in fact healthy — zero anchored mode has no next run and zero anchorTimezone ... is not usable warnings in the logs. The only way to tell the difference was to shell into the containers and grep, which is precisely what the published field exists to avoid.
It is worst at the moment it is most likely to be read: right after flipping to anchored mode, when an operator wants to confirm the next run.
Fix
Publish after arming. Either move the void publishScheduler() below the armIntervals() calls, or publish again at the end of each branch. The desiredSweep === null path should still publish, since a disarm is exactly what the field should report.
Worth a test that a live continuous -> anchored switch leaves nextAnchoredRunAt finite in the published state.
- 主要语言
- JavaScript
- 星标
- 0
- 派生
- 0
- 平均合并
- 9 小时 10 分钟
- 30 天内合并 PR
- 56
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
HarperFast/prerender-plugin 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 48/100
HarperFast/prerender-plugin#189 ·
-
难度 5/5 一周以上 新手友好度 35/100
HarperFast/prerender-plugin#185 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
HarperFast/prerender-plugin#183 ·
-
难度 5/5 一周以上 新手友好度 35/100
HarperFast/prerender-plugin#180 ·
-
难度 4/5 3-5 天 新手友好度 38/100
HarperFast/prerender-plugin#179 ·
查看 HarperFast/prerender-plugin 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
antfu-collective/icones#398 ·
-
ECmail.com 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
wesbos/burner-email-providers#554 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
radiantearth/stac-browser#1023 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
components-web-app/docs#92 ·