问题 / #3048

#3048 [Bug]: conversation-cache metrics skip events in log backlogs over 1 MiB

open · @oscarlius · 0 评论 · 去 GitHub 看

Windows

说明

### What happened

`ConvCacheLog.poll()` silently skips unread events when the new engine log output exceeds 1 MiB: it moves its cursor to `file_size - READ_MAX` before parsing. Consequently `/metrics` can retain stale cache occupancy and undercount parks/restores.

CPU-only reproduction:

1. Write a park event and poll once: one parked conversation is reported.
2. Append a restore event reporting `parked=0 bytes=0`, followed by more than 1 MiB of ordinary engine log lines.
3. Poll again. The old observer skips the restore and continues reporting the earlier parked conversation and bytes.

Expected: consume every complete event after the committed cursor. Reading in bounded chunks should not change which events are counted. A trailing partial line should be left for the next poll, and bytes appended during a poll should be processed on the next poll after the captured EOF.

### Strata version, GPU, OS

Upstream main at `477ac13`, Windows, Python 3.12.7. Reproduced with temporary synthetic engine logs and the existing CPU `MockEngine` HTTP server; no GPU or weights are required.

### Engine log

The fixture uses standard native `conversation cache: parked ...` and `conversation cache: restored ...; parked=0 bytes=0` lines separated by ordinary log output. No live model logs are needed.

This is separate from #3039 / #3041's concurrent-reader race and #3033 / #3034's refused-parking parsing.

本站相关内容

相关页面的快捷入口。