cache: tolerate corrupt cache files + silence granian close-frame DEBUG#704
Merged
ajslater merged 1 commit intov1.11-performancefrom May 3, 2026
Merged
Conversation
A truncated zlib stream in the file cache (left behind by a write killed mid-flush) was bubbling up as a 500 with a scary `zlib.error: Error -5` traceback into user-facing logs. ResilientFileBasedCache now treats a corrupt entry as a miss, deletes the bad file, and logs at DEBUG. Also silence Granian's routine "Received close frame" / "Replying to close" DEBUG noise (paralleling the existing watchfiles entry); still visible at TRACE. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
ajslater
added a commit
that referenced
this pull request
May 4, 2026
The earlier ``_granian`` filter (#704) didn't catch the close-frame DEBUG messages users were still seeing — those originate from the ``tungstenite`` and ``tokio_tungstenite`` crates that Granian uses for the WebSocket layer, not from ``_granian`` itself. pyo3-log routes Rust tracing targets to Python loggers, mapping ``::`` → ``.`` so e.g. ``tungstenite::protocol`` arrives as the Python logger ``tungstenite.protocol``. Filtering the bare crate name applies hierarchically to all submodules. Verified by applying the dictConfig and reading effective levels: ``tungstenite.protocol`` and ``tokio_tungstenite.compat`` now resolve to INFO with ``isEnabledFor(DEBUG) == False``; root stays at DEBUG so codex code is unaffected. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
zlib.error: Error -5 while decompressing data: incomplete or truncated streamwith a full traceback. NewResilientFileBasedCachetreats a corrupt entry as a miss, deletes the bad file, and logs at DEBUG instead of failing the request.Received close frame/Replying to closeDEBUG noise (every normal client disconnect emits two lines). Pinned_granianto INFO alongside the existingasyncioentry; still visible at TRACE.Test plan
make fix,make ty,make test-python(26 passed) all green.djcachefile at the same path shape as the production traceback is silently dropped;get_manyreturns the surviving keys_granianeffective level isINFOafterdictConfig(LOGGING)🤖 Generated with Claude Code