Pull requests / #3041

#3041 serve: serialize conversation-cache log polling

open · @oscarlius · 0 comentarios · En GitHub

Server & APIWindows

Descripción

Concurrent metrics requests can read the same conversation-cache log range and count one park twice, then replay it on a later poll when the shared cursor overshoots EOF. Serialize each `ConvCacheLog.poll()` transaction with an observer-local lock, including run changes, file reads, cursor updates, and returned snapshots.

Add direct-reader and HTTP regressions that pause the first physical file read and overlap a second reader. Both fail before the fix and pass afterward; they also check that the next poll does not replay events and a subsequent restore is counted once. Native cache policy, log parsing, API fields, and model generation are unchanged. This is independent of #3034 and #2692.

Validation on Windows with Python 3.12.7:

- New regressions: 2 failed before the fix; both pass after it.
- `python -m unittest serve.test_monitor serve.test_server serve.test_prometheus`: 355 tests, 352 passed and 3 existing signal-related skips.
- Python compilation and `git diff --check` passed; Ruff introduces no findings (three existing `server.py` findings remain).
- Independent review found no actionable issues. Tests use CPU fixtures and local mock HTTP servers; no native backend files were changed and no live model service was restarted.

Closes #3039.

En el sitio

Enlaces a install, modelos, releases.