Skip to content

[PR] fix: stamp bili.log lines with the system local time | 日志时间改用系统本地时间 - #4537

Closed
yanhuojiyusheng wants to merge 1 commit into
ranxianglei:masterfrom
yanhuojiyusheng:2026-10-24_log-local-time
Closed

yanhuojiyusheng wants to merge 1 commit into
ranxianglei:masterfrom
yanhuojiyusheng:2026-10-24_log-local-time

Conversation

@yanhuojiyusheng

Copy link
Copy Markdown
Contributor

Fixes #4535

问题

bili.log 的打戳点用 new Date().toISOString():永远是 UTC 且以 Z 结尾,而系统时钟给的是本地时间。本机(Asia/Shanghai)同一瞬间日志 2026-10-24T11:19:02.681Z vs date 19:19:02 +0800 —— 排查时每次都得手工折算,日志里的“刚刚”看起来像几小时前,和终端、宿主日志、面板其它字段(走 toLocaleString())不同基准。

时钟本身是准的:探针请求 UTC 11:19:02.673 写出行 11:19:02.681Z(8 ms),文件 mtime 与最后一行对应同一瞬间。

方案

  • src/logger.ts 新增 logTimestamp():输出系统本地墙上时间 YYYY-MM-DDTHH:mm:ss.SSS(无后缀),与 date 逐字对齐;两处打戳点(log() 的 file+stderr 行、warnReopenFailed() 的降级 warn 行)统一走它。
  • 读侧兼容(日志文件会跨格式变更存活):src/web/logs-query.ts 的 TS_RE 与 src/acp-cache-diff.ts 的 usage 行正则都把时区段改为可选 —— 新裸戳按本地时间解释,历史/rotated 文件里的 Z 行仍按 UTC 解释,同一文件两种都能解析。
  • tests/logger-local-time.test.ts:格式与本地字段、Date.parse 回环、新旧混合的时间窗过滤、usage 行解析。

行为变更披露(有意)

  1. 日志时间基准:UTC → 系统本地时间。已有日志里的 Z 行保持原样,不重写、不迁移;新行不再带任何时区标记,因此把日志带到别的时区时无法判断归属(这是本 PR 接受的可读性代价,见 Timestamps in bili.log are always written in UTC, which differs from the system local time by the full timezone offset ( | bili.log 时间戳固定写 UTC,与系统本地时间差整个时区偏移(排查需手工折算) #4535 的讨论)。
  2. 行宽:每行时间戳少一个字符(Z)。
  3. 读取面:两处解析正则放宽 —— 对旧格式无行为变化。

验证

  • 时区矩阵(日志逐字对比同刻 date):Asia/Shanghai 19:40:29、UTC 11:40:29、America/New_York 07:40:29、Asia/Kathmandu(+05:45)17:25:29、America/St_Johns(-02:30)09:10:29 —— 全部一致。
  • 真实产物 e2e:npm run build 后 node dist/index.js start 在隔离 XDG 下跑 Kathmandu / St_Johns / UTC 三个时区,bili.log 时间与系统时间同刻。
  • 面板读路径:在真实产出的日志文件上跑 queryLogLines 时间窗,命中行数 >1(证明解析成功,否则会退化成只返命中行)。
  • node --import tsx --test tests/logger-local-time.test.ts tests/web-logs-query.test.ts tests/web-logs-view.test.ts tests/acp-cache-diff.test.ts tests/logger-{rotate,rotation,session-tag,silent-loss,epipe,stderr-mute}.test.ts → 49/49。
  • npm run typecheck 通过;npm run build 通过(dist-import-annotations: OK / dist-external: OK)。
  • 全量回归以远程 CI 为准;注意当前 master 自身 docs-sync 为红(种子缺 pluginLaneServerHistory),与本 PR 无关,test 矩阵会被 needs 跳过。

配置面

无新增/重命名/语义变更的配置项:时区来源就是系统时区,没有新 env、没有新 config 字段,CONFIGURATION.md 无需改动。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复。检索 open/closed issue 与近期 PR 均无同主题条目(#4535 是本 PR 的源 issue,同作者、先于本 PR 7 分钟)。

标签: bug, p3, scope/ui(已打,连同原有 pr)——纯日志可读性缺陷,无功能/数据影响(p3);观察面在面板日志视图与人工排查(scope/ui);也是你在 #4535 里请求的标签。

审核结论(结构化八问)

  1. 是什么问题:bili.log 每行的时间戳永远是 UTC 且带 Z,和系统本地时间差一个时区偏移,排查时每次手工折算,日志里的"刚刚"看起来像几小时前。
  2. 什么原因导致的:logger 两处打戳点写死 new Date().toISOString(),该方法按定义永远输出 UTC+Z,与系统时区无关;项目又没有时区配置面可表达"用本地时间"。
  3. 影响范围与严重程度:所有直接读 bili.log 的人(面板日志页、终端 stderr、人工排查);零功能/数据影响,纯可读性与排查效率缺陷 —— p3 成立。
  4. 怎么修复的:打戳点改输出系统本地墙上时间 YYYY-MM-DDTHH:mm:ss.SSS(无后缀,与 date 逐字对齐);两处读侧正则(面板时间窗查询、usage 行解析)把时区段改可选——历史 Z 行仍按 UTC 解析、新裸戳按本地解析,同一文件两种共存,不重写不迁移。方向正确,打到根因(打戳点本身),不是在读侧做显示层换算。
  5. 是否有回归问题:逐项清点过既有行为,无意外回归——
    • bili.log 的写者只有 logger 那两处,全部迁移到位;其它带时间戳的产物(spawn-port 日志 src/server.ts:661,1444、launcher stderr src/launcher.ts:3868、host-log src/agent/host-log.ts:36)是独立文件/独立格式,有意不动,正确;
    • 旧格式 Z 行解析字节不变(现有 tests/web-logs-query.test.ts 生成的就是 Z 行,通过);
    • diagnostics 对 bili.log 只做子串过滤不解析时间戳;面板 JSON 字段仍是 Z-ISO;冲突横幅 [YYYY-MM-DD HH:MMZ] 来自 conflict-watch 自己的格式器;session-report 的 stripTs 作用于报告生成时间 —— 均不受影响;
    • 仓库内没有其它测试钉住 bili.log 行格式(grep 验证过);
    • 有意变更三项(基准 UTC→本地、行宽 -1、读侧正则放宽)均已在 PR 披露,与 diff 一致。
  6. 是否破坏缓存:不涉及(未触碰缓存/重试/增量游标/去重键)。
  7. 是否改了设计方向:不涉及架构/边界/数据流转向;裸戳格式的代价(日志跨时区搬移后无法判断归属)已在 PR 与 Timestamps in bili.log are always written in UTC, which differs from the system local time by the full timezone offset ( | bili.log 时间戳固定写 UTC,与系统本地时间差整个时区偏移(排查需手工折算) #4535 讨论中明确接受,属既定取舍。
  8. 是否引入了新的配置:无(时区来源即系统时区,无新 env/config 字段,CONFIGURATION.md 无需改动——已核实)。

review 中发现的两处小修(已写好,附补丁)

  1. src/logger.ts 头注释过期(独立 commit docs:):注释仍写 <iso-ts>,代码现在打的是本地墙上时间,注释与事实不符:
- * Line format: `<iso-ts> [level][ [sess=<session-id>]] [v=<version>] <msg>`
- * — one prefix per PHYSICAL line (multi-line payloads repeat ts+level+tags on
- * every row, which is what makes line-wise grep / time-window queries honest).
+ * Line format: `<local-ts> [level][ [sess=<session-id>]] [v=<version>] <msg>`
+ * (`<local-ts>` = the system's local wall clock without a zone suffix — see
+ * logTimestamp(); pre-#4535 lines carry a UTC `Z` stamp, readers must accept
+ * both since one file outlives the format change). One prefix per PHYSICAL
+ * line (multi-line payloads repeat ts+level+tags on every row, which is what
+ * makes line-wise grep / time-window queries honest).
  1. 测试补强(独立 commit test:):现有测试在新旧两种格式下都只断言"能解析",而 Date.parse 对裸戳按本地解释——在 UTC runner(CI 环境)上 local==UTC,若将来打戳点或读侧悄悄退回 UTC,这组测试依然全绿。加一个强制非整点时区的用例把"裸戳=本地时间"钉死(tests/logger-local-time.test.ts,插在 usage-line 测试之前):
test("bare stamps are LOCAL time end-to-end (TZ forced, non-whole-hour offset)", () => {
    if (process.platform === "win32") return; // process.env.TZ is only honored on POSIX
    const prevTz = process.env.TZ;
    try {
        process.env.TZ = "Asia/Kathmandu"; // UTC+05:45 — non-whole-hour offsets catch sloppy math
        const instant = Date.UTC(2026, 9, 24, 11, 0, 0); // 16:45:00 Kathmandu wall clock
        const ts = logTimestamp(new Date(instant));
        assert.equal(ts, "2026-10-24T16:45:00.000"); // writer emits LOCAL fields, no suffix
        assert.equal(Date.parse(ts), instant); // bare stamp reads back as LOCAL → same instant
    } finally {
        if (prevTz === undefined) delete process.env.TZ; else process.env.TZ = prevTz;
    }
});

两个 commit 我已在本机基于你的 head 做好并跑过(该文件 4/4 绿、typecheck/build 绿),但 push 被拒:fork 不允许我推分支,且 PR 没开 "Allow edits by maintainers"(maintainer_can_modify=false)。请二选一:① 把上面两段按原样提交到你的分支;② 在 PR 设置里勾上 Allow edits by maintainers,我来推。

本地验证(PR head d3e419f)

  • npm run build OK(dist-import-annotations/dist-external OK)、npm run typecheck 干净;
  • 定向套件 32/32 绿:tests/logger-local-time web-logs-query web-logs-view acp-cache-diff + logger-{rotate,rotation,session-tag,silent-loss,epipe,stderr-mute};
  • 你 PR 描述里的时区矩阵结论我抽查了实现逻辑(getFullYear/getMonth/getDate/getHours 全走本地字段,padStart 正确,+05:45/-02:30 这类非整点偏移由上面的强制 TZ 用例覆盖)。

CI 状态(需注意)

PR head 上 47 个 check-run:28 success / 12 skipped / 7 failure,失败的 7 个全是 test 分片(ubuntu/windows × node22/24)。我拉了失败分片的日志定位:与本 PR 改动无关的环境性失败——

  • ubuntu 分片:3320 个测试恰好挂 1 个 storage-render golden (chat)(tests/golden-storage-render.test.ts),报错是 golden drive: node_modules/acp-kernel/dist is older than kernel/src … Rebuild first: npm run build(tests/golden-storage-drive.ts 里的陈旧 kernel dist 前置守卫,mtime 判定);
  • windows 分片:挂在 #4427 maskPathsForPublish … $HOME to ~ 一族(tests/web-storage-diagnostics-redaction.test.ts,"home dir stripped from absolute path")。

这两条路径本 PR 一行没碰,且这两个测试文件我在 PR head 本地全绿(10/10);同时 master 自己最新的 CI 也有红(lifecycle-ledger-guard、deploy)。判断:环境性/既有问题,不是本 diff 引入的回归。建议重跑失败的 test 分片;若重跑后同一签名仍在,我再单独立项跟踪(暂不为单次疑似 flake 开 issue)。另:PR 描述说"master docs-sync 为红、test 矩阵会被 needs 跳过"已过时——本 PR head 上 docs-sync 是绿的,test 矩阵实际跑了。

收工判定

方向正确、根因定位准确、diff 干净、行为变更披露完整、配置面无新增、review 未发现意外回归;两处小修(见上)落进分支 + 失败分片重跑转绿后即可合并。合并动作按规矩由你/owner 执行。

@ranxianglei ranxianglei added bug Something isn't working p3 scope/ui labels Oct 24, 2026
@yanhuojiyusheng
yanhuojiyusheng force-pushed the 2026-10-24_log-local-time branch 2 times, most recently from 01e0b46 to 28f9402 Compare October 24, 2026 13:29
ranxianglei pushed a commit that referenced this pull request Oct 24, 2026
Review follow-up on top of #4537: local-time stamping landed in src/logger.ts only, but three more writers emit the same line head into the same paste-able log surface and would keep writing UTC Z stamps after merge:

- src/agent/host-log.ts — [dsh-client]/[native-client] host-side events share bili.log with proxy-side lines (#3651)
- src/server.ts writeSpawnPortLog (x2) — per-port temp log on listen failure
- src/launcher.ts defaultAttachDiag — debug stderr copy of attach diagnostics

All four now use the shared logTimestamp(). The five test assertions pinning the old Z head for these writers are updated to pin the bare-local head, and tests/logger-local-time.test.ts gains a mixed-generation window test (legacy Z rows + new bare rows in ONE array) pinning the compat promise that a rotated file outlives a format change.
@ranxianglei

Copy link
Copy Markdown
Owner

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

审核结论:方向正确、核心实现成立,质量达标(测试是确定性构造、不靠环境运气,正则放宽最小、注释讲清了为什么)。但有 4 处同机制的写入点漏改——合入后 #4535 的症状会在这些行上继续存在。我已把补齐做成一个 additive commit(见文末),等你解锁推送或自行 cherry-pick。

八问:

  1. 是什么问题:bili.log 行首时间戳硬编码 UTC(toISOString() 永远带 Z),与机器本地时间差整个时区偏移,排查时每次手工折算——可读性/排查效率缺陷,不是功能缺陷。
  2. 什么原因导致的:打戳点用了 Date.toISOString(),该 API 按定义永远输出 UTC、忽略进程时区;也没有时区配置项(也不该有——时区是机器属性,不是项目配置)。
  3. 影响范围与严重程度:全体用户、全部车道、bili.log 每一行(含 stderr 镜像);p3——无功能/数据影响,只有排查误判风险(事件时序看错 8 小时)。
  4. 怎么修复的:统一打戳函数 logTimestamp() = 系统本地墙钟、不带 zone 后缀;读侧两处解析(web 日志时间窗过滤的 TS_RE、缓存报告 usage 行正则)同步放宽为「旧 Z / 新裸 / ±偏移」三态可解析,保证历史 rotated 文件继续可用。
  5. 是否有回归问题:逐项过——时间窗过滤新旧格式均可解析(你的两个用例分别覆盖,我补了一个新旧混排的单文件用例);usage 行对齐(±50ms skew 窗)逻辑未动;rotation/掩码/session-tag 未触碰;session-report golden 不受影响(该报告不含日志行);未发现语义漂移。但发现 4 处漏改的写入点(见下),我已补:补齐后本地定向验证 dsh-native+launcher 410 pass/0 fail、logger/logs-query/acp-cache-diff 49/49、typecheck 绿。全量回归以远端 CI 为准。
  6. 是否破坏缓存:不涉及——日志不参与前缀缓存/重试/增量游标。
  7. 是否改了设计方向:无——纯输出格式变更。行为变更披露已在 PR 正文(旧值 ...T11:19:02.681Z(UTC)→ 新值 ...T19:19:02.681(本地墙钟)),理由成立。备注:读侧已接受 ±hh:mm 形态,若以后想改成「本地+显式偏移」(RFC3339,每行自带时区归属),只需换格式化函数,代价极低,不锁死。
  8. 是否引入新配置:无(配置面一节已确认)。

我补的 4 处漏改(同一机制:相同的行首语法、同一个可粘贴日志面,却仍在写 UTC):

commit 位置与落地方式:

  • commit b64e16025,分支 2026-10-24_4535-log-local-time-followup(基于你的 head 28f940254,纯追加、不动你的历史);
  • 我尝试直接追加推送到你的 PR 分支被拒(PR 未开启 Allow edits by maintainers)。两条路任选其一:
    1. 在 PR 页面勾选 Allow edits by maintainers,我直接把该 commit 推到你分支(推荐,历史线性);
    2. 或在你分支上:git fetch https://github.com/ranxianglei/billion-context.git 2026-10-24_4535-log-local-time-followup && git cherry-pick b64e16025。

另外两点状态说明:PR base 略落后当前 master(无冲突,mergeable);你正文提到的 docs-sync 红在最新 master 已恢复绿,CI 测试矩阵会正常跑。合并由人来操作,我不代合。

@yanhuojiyusheng
yanhuojiyusheng force-pushed the 2026-10-24_log-local-time branch from 28f9402 to 186f485 Compare October 24, 2026 15:02
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

收到这条补充 review。我按规矩没有直接采信,把每处写入点和 commit b64e16025 都独立重新核了一遍——核心指控成立,而且我要先纠正我自己上一轮审核里的一个错误判断。

先纠错(诚实作答)

我上一轮回复里写「host-log / spawn-port / launcher 是独立文件/独立格式,有意不动,正确」——对 host-log 这一处我判错了。实际代码:src/agent/host-log.ts 的 logHostEvent() 走 appendFileSync(defaultLogFile(), …),写的就是同一个 bili.log(文件头注释也明说 #3651 起与 proxy 侧行共享这个可粘贴日志面)。我当时从模块结构推断它是独立通道,没有追到落盘路径,这是我的疏漏。合并后 [dsh-client]/[native-client] 宿主事件行会一直是 UTC Z 戳,#4535 的症状恰好活在这些行上——不补就是修了一半。

逐处复核结果(均独立读码确认):

位置 落点 判定
src/agent/host-log.ts logHostEvent 同一 bili.log(defaultLogFile()) 同面,必须改 —— 最关键的一处
src/launcher.ts defaultAttachDiag 经 logHostEvent 进 bili.log + debug 时 stderr 副本 同面(stderr 副本与终端 date 对齐也是加分项)
src/server.ts writeSpawnPortLog ×2(:661/:1444) os.tmpdir()/bili-proxy-<port>.log,独立 per-port 文件 一处措辞小偏差:它不是 bili.log 本身、「同可粘贴面」对它略言过其实;但行语法相同、无代码读者解析其行首时间戳(纯人读),统一成本零、收益一致,改是对的

对 b64e16025 的独立审查

diff 干净最小(7 文件 +34/-17):四处打戳全部收敛到共享 logTimestamp()(单一事实来源,不是各处自写格式);host-log.ts 与 logger.ts 两处头注释同步更新为与事实一致;钉死旧 Z 行首的 5 条断言(dsh-native ×2、launcher ×3)改为钉新裸戳;新增的「单文件新旧混排」窗口测试是确定性的、时区无关(Z 行按绝对时刻构造,±90s 窗跨两代、排除 10 分钟外的远代行),正好把「rotated 文件比格式变更活得久」这条兼容承诺钉进测试。未发现死代码/吞错/风格问题。

本地验证(我自己跑的,不复述对方数字):

  • 拓扑:PR 分支已被 force-rebase(d3e419ff4→186f485f3,base d95799d86);followup 基于更早的 rebase 点 28f940254。我在一次性 worktree 里实测 cherry-pick b64e16025 到当前 head 186f485f3:干净应用,零冲突(master 漂移只碰 server.ts 的 56/2422/2455 行,远离改动区);
  • cherry-pick 后定向测试:tests/logger-local-time(含新混排用例)+web-logs-query+acp-cache-diff = 32/32 绿;被改钉的 5 条写入侧断言(dsh-native 2 条 + launcher 3 条,按名过滤跑)= 5/5 绿;npm run typecheck 干净。全量回归以远端 CI 为准。

与我上一轮两个本地 commit 的关系(避免重复落地)

  • 我的本地 nit commit(docs(logger) 头注释 <iso-ts>→本地戳)已被 b64e16025 覆盖(措辞略不同但修的是同一处)——b64e16025 落地后我的那个不要再应用,二选一即可;
  • 我的另一个本地 commit(强制 Asia/Kathmandu 非整点偏移的端到端钉桩测试)不在 b64e160 里,属可选增强:现有测试在 UTC runner 上对「将来悄悄退回 UTC」不敏感,这条用例把「裸戳=本地时间」钉死在非整点偏移下。可加可不加,不阻塞合并;要的话我可以提供 patch。

八问(本轮增量 = 补齐 commit)

  1. 是什么问题:原 PR 只改了 logger 模块两处打戳点,另外三处写同一/同行语法日志面的写入点仍在写 UTC,合并后 Timestamps in bili.log are always written in UTC, which differs from the system local time by the full timezone offset ( | bili.log 时间戳固定写 UTC,与系统本地时间差整个时区偏移(排查需手工折算) #4535 症状会在这些行上持续。
  2. 什么原因导致的:原修复范围圈定在「logger 模块的两个函数」,没有清点所有共享该文件/该行语法的写入点;host-log 作为独立模块写同一文件,极易漏。
  3. 影响范围与严重程度:TUI 调试最常见的宿主事件行([dsh-client]/[native-client])、attach 诊断 stderr 副本、端口占用临时日志;p3 可读性问题,无功能/数据影响。
  4. 怎么修复的:四处统一到共享 logTimestamp();同步更新 5 条旧格式钉桩断言;补新旧混排文件的窗口回归测试。
  5. 是否有回归问题:逐项过——两个读侧解析器(logs-query TS_RE、acp-cache-diff usage 正则)在原 PR 已接受 Z/裸/±偏移三态,新裸戳解析正确;port 临时日志无代码读者;rotation/掩码/session-tag 未触碰;定向 37 例全绿 + typecheck 干净。未见回归。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:无——纯输出格式收敛,且强化了「行语法单一定义」的既有不变量(所有写者走同一个函数)。
  8. 是否引入新配置:无。

落地方式与收工判定

maintainer_can_modify 目前仍是 false,fork 分支我也推不了。两条路任选其一:① PR 页面勾 Allow edits by maintainers,由有主仓权限的一方把 b64e16025 追加到 PR 分支(我已实测 cherry-pick 到当前 head 干净);② 作者在自己分支上 git fetch https://github.com/ranxianglei/billion-context.git 2026-10-24_4535-log-local-time-followup && git cherry-pick b64e16025。判定:补齐方向正确、commit 质量达标、我独立复验通过——落地后 CI 转绿即可合并,合并由人操作。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

结论:本 PR 的 CI 红是继承自 master 的存量红灯,与日志时间戳改动无关。未向分支推送任何代码——等 master 修绿后 rebase 重跑即可。

证据(本地三提交对照复现)

把 CI 失败涉及的全部 8 个测试文件在三个提交上各跑一遍:

提交 说明 失败数
d95799d 分叉点,不含本 PR 改动 13
186f485 本 PR head 12
146b34f 最新 master 17

所有失败项在本 PR 提交之前就已存在 → 日志时间戳改动完全免责;本 PR 新增的 tests/logger-local-time.test.ts 在 CI 各分片全部通过。

失败项清单(去重后)

为什么之前没暴露:master 自 10-24 16:21Z(#4590 合并后)gate job(unused-exports)红,needs 使 master 自己的 test matrix 被跳过——套件红灯一直被掩盖。本 PR 恰逢合并风暴后的第一次全量矩阵运行,把存量问题一次性顶了出来。master 红状态见 #4599(总控)。

八问

  1. 是什么问题:本 PR 10 个 test 分片红了 9 个(约 17 个不同测试项 + 4 个 Windows 特有项)。
  2. 什么原因导致的:不是本 PR 的代码。10-24 合并风暴([PR] merge: tier-5 train — dsh prepare/streaming domain (7 PRs: bili_final terminal marker, auto-fold storm gate, wire-only guard) #4590/[PR] feat: windowed render source (D5-5) + view-domain judge tailStart (#4241 teeth regression) [rescue of #4584] #4586/[PR] feat: one-time ledger restamp of legacy refs + fork row cloning (#4316 layer 3 PR3/3) #4575/[PR] merge: tier-4 train — dsh/cache domain rework (7 PRs incl. p1 #3307/#3301/#3890); kernel straggler from #3680 reverted per boundary #4572 等)期间 master 多个套件被改坏且未经全量验证,又被 gate job 红掩盖;本 PR 只是替它跑了第一次全量矩阵。
  3. 影响范围与严重程度:无终端用户影响(全是未发布的 master 状态);但任何会触发 test matrix 的开放 PR 都会同样红;master 自身也红。属 CI 阻塞,非功能缺陷。
  4. 怎么修复的:本 PR 侧无需修复——按 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 机制等专用 ci-worker 修好 master 套件红灯,再 rebase 到绿的 master 重跑;其中 Egress Judge false positive on Snapshot Render Lane I2: prefix comparison baseline needs to be aware of the render view | 出站判官对快照渲染车道误报 I2:前缀比对基准需要感知渲染视图 #4241 一项 rebase 后即自动转绿。
  5. 是否有回归问题:本 PR 自身改动干净(新增测试全分片通过;时间戳格式 UTC-Z → 本地墙上时间是本 PR 的预期行为,读侧 logs-query/acp-cache-diff 已兼容新旧两种格式)。我未推送任何代码,无处置引入的附带回归。
  6. 是否破坏缓存:不涉及(未推代码)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入新配置:不涉及。

已按 #4599 纪律在那边留了一行记录。判定:暂不合,等 master 绿后 rebase。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

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

重复通知(同一 run 40105194164、head 186f485):状态无变化——本 PR 无新提交无新运行,红的仍是同一批继承自 master 的 17 项。判定见上方评论(三提交本地对照复现,与 logger 改动无关),#4599 总控已留记录。master 侧进展:gate job(unused-exports)部分已在 #4603 修复在途,但套件级红灯(storage-render golden ×4、storage-engine-proofs、#4260/#4305/#4297/latch 等)尚未修复——现在 rebase 只会白烧一轮 CI。继续等 master 绿后 rebase 重跑,本侧无进一步动作。

bili.log 每行都用 `new Date().toISOString()` 打戳:永远是 UTC 并以 Z 结尾,
而系统时钟(`date` / timedatectl)给的是本地时间。排查时两者差着整个时区
偏移(本机 CST 是 8 小时),日志里刚发生的事件看起来像是几小时前,必须
手工换算才能和终端、浏览器、宿主日志对齐。

- `logTimestamp()` 输出本地墙上时间 `YYYY-MM-DDTHH:mm:ss.SSS`(无后缀),
  与 `date` 逐字对齐;两处打戳点(file+stderr 与降级 warn)统一走它;
- 读侧兼容:该格式没有时区标记,历史日志里全是 `Z` 结尾,`logs-query` 的
  时间窗过滤与 `acp-cache-diff` 的 usage 行解析都放宽为"时区段可选",
  同一文件里新旧两种戳都能解析(裸戳按本地时间解释);
- 测试:格式与本地字段、`Date.parse` 回环、新旧混合时间窗、usage 行解析。

验证:定向 suite 49/49、`npm run typecheck`、`npm run build`(dist 导入与
外部依赖检查 OK);时区矩阵(Shanghai/UTC/New_York/Kathmandu +05:45/
St_Johns -02:30)日志与 `date` 同刻;真实 `dist` 起代理在隔离 XDG 下三个
时区 e2e,日志文件时间与系统时间一致。全量回归以远程 CI 为准。
@ranxianglei

Copy link
Copy Markdown
Owner

closing as superseded by #4798 (merged): your head 63fcf8d cherry-picked + the reviewed followup b64e160 (host-log / writeSpawnPortLog / launcher stderr writers + the 5 pinned Z assertions + mixed-format window test). your branch is not maintainer-editable, so the completion landed as a maintainer branch with full credit in the PR body. thanks for the report and the fix — the local-time bili.log is now internally consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working p3 scope/ui

Projects

None yet

2 participants