mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3041] [CLOSED] [Other] Serialize conversation-cache log polling #4417
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4417
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3041
Author: @oscarlius
Created: 10/18/2026
Status: ❌ Closed
Base:
main← Head:fix/conversation-cache-poll-lock-20261018📝 Commits (1)
6cc2030fix(serve): serialize conversation-cache log polling📊 Changes
2 files changed (+95 additions, -0 deletions)
View changed files
📝
serve/server.py(+6 -0)📝
serve/test_monitor.py(+89 -0)📄 Description
Problem and result
Concurrent
/metricsreaders could read the same conversation-cache log range and replay an event. This change serializes access to the shared log cursor, so direct and HTTP metrics readers count each event once.Related discussion
Closes #3039.
Approach
Guard the existing log-poll operation with the cache object's lock and add direct-reader and local loopback
/metricsconcurrency regressions. Cache parsing and native inference behavior are unchanged.Validation
Rebased on upstream main
e88ee39d1d6be6e3364183af3b39b62a7ed6f211(0.2.0-beta); tested candidate04796fa0427beaa6b8628d6e2ab914c7059ca8c0on Windows, Python 3.14.3. Each test command starts a fresh local process.Passed:
py -3.12 -m ruff check --output-format json serve/server.py serve/test_monitor.py(Ruff 0.2.1): 10 existing diagnostics, same as unmodified main; zero new diagnostics.python -m unittest -v serve.test_monitor serve.test_prometheus— 18 tests passed.python -m py_compile serve/server.py serve/test_monitor.py.git diff --check e88ee39d1d6be6e3364183af3b39b62a7ed6f211..HEAD.Failed:
regexdependency was installed. The subsequent fresh loopback HTTP/metricsred test failed as expected with(parks, restores) = (2, 0)instead of(1, 0).Not run:
Limits
The proof covers concurrent Python readers, the repository mock engine, and a local loopback HTTP server. It does not exercise a real model process or hardware runtime.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.