Pull requests / #3034
#3034 serve: refresh conversation-cache metrics after refused parking
open · @oscarlius · 0 commentaires · Sur GitHub
Server & APISecurityDocumentationWindows
Description
## Summary Fixes #3033. After a refused conversation-cache park, `/metrics` and the Monitor card could still report the old occupancy even when the engine said it had evicted every parked entry. The observer now applies the remaining count from that refusal and represents missing values as unknown rather than displaying stale values. ## What changed - Parse physical-RAM refusal counts; report zero bytes when that path explicitly says no entries remain. Do not add its per-attempt eviction count to a cumulative total: budget eviction may have happened earlier. - Invalidate occupancy and cumulative eviction values that unsuccessful parking cannot establish. Superseded-copy and minimum-length messages retain their known count but do not invent a byte count. A subsequent authoritative log summary restores numeric values. - Keep successful park/restore counters and the last successful switch unchanged. Unknown values are JSON `null`; the Monitor shows a dash and hides the corresponding occupancy bar. The contract is documented in `docs/DETAILS.md`. - Add eight regression tests covering empty/partial eviction, budget and allocation refusals, legacy log format, partial lines, run resets, recovery, HTTP metrics and the card's unknown-to-known transition. The patch changes only the Python observer, its web display, tests and documentation. Native cache policy, inference, engine log formats and defaults are unchanged. ## Validation - Red/green: the new cases fail against the unmodified observer and pass after the fix; the targeted cache-card class passes all 11 tests. - Replayed the preserved failure log: `parked=38` becomes `parked=0`, `bytes=0`; the unreported cumulative eviction count becomes unknown until a full summary supplies it. - Python 3.12 on Windows: `python -m unittest serve.test_monitor serve.test_server serve.test_web_sampling serve.test_parallel serve.test_slots serve.test_prometheus -v` — 426 tests, 422 passed, 4 existing platform skips (three signal tests and one symlink-privilege test). - Python compilation, `node --check serve/web/app.js`, and `git diff --check` pass. Ruff reports the same three pre-existing `serve/server.py` findings as the base and no new findings; the modified test file is clean. - All runtime checks use a local mock engine. No live model service was restarted or changed; native GPU inference was not rerun for this observer-only change. Related: #2962 concerns pressure-release policy. This PR fixes observation of existing logs and does not adopt that policy.
Sur le site
Liens install, modèles, releases.