mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3335] [Other] Serialize conversation-cache log polling #4574
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#4574
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/3335
Author: @oscarlius
Created: 10/20/2026
Status: 🔄 Open
Base:
main← Head:fix/conversation-cache-poll-lock-20261018📝 Commits (1)
2a5d7a3fix(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
Continues #3041 after the v0.2.1.4 tracker reset. The original passed the new format check, but GitHub refused to reopen the rebased branch; the reset bot explicitly suggested a new linked pull request.
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
9de04cd44e927a9a3df6bbc0e94fc1be8b844ba4(v0.2.1.4); tested candidate2a5d7a369e8ec1deab6d0f463798bb7fe3c7e592on 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 9de04cd44e927a9a3df6bbc0e94fc1be8b844ba4..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.