Repository navigation
fix(core): stop recording read cache hits as span errors - #1761
Merged
Merged
Conversation
fastapi-redis-sdk signals a hit by raising CacheHitException. The read_cache.read_through span re-raised it inside the span, so Logfire marked every hit as an error (level 17, status ERROR, exception event). On development every hit did this. Raise the hit after the span closes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016N9c6ouiT4Wid3arGR41Dv Signed-off-by: phernandez <paul@basicmachines.co>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
phernandez
added a commit
that referenced
this pull request
Oct 23, 2026
Date the v0.24.0 entry 2026-10-22, add a Security section for GHSA-4gfv-c2mm-mvj2 (DNS rebinding, #1697) and GHSA-pqm2-2wxw-p5hx (host symlink probing, #1807), plus #1804 and #1805, and cover the changes merged since the entry was last edited (#1761 through #1807). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018CoZ3jWnMJsyQsik4tPySk Signed-off-by: phernandez <paul@basicmachines.co>
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
Found testing development after #1752. fastapi-redis-sdk signals a cache hit by raising
CacheHitException, which is control flow and not a failure.read_cache.read_throughre-raised it insidewith logfire.span(...), so Logfire closed the span as failed.On development, every hit span had level 17 (error), status
ERRORand an exception event: 35 of 35 hits, 0 of 72 misses. In production that would fill Logfire exception issues and error-rate views, and bill every hit as an error record.Change
routes.pykeeps the hit and raises it after the span closes. The span still recordscache.lookup.outcome = hitand the hit headers. The SDK handler still turns the exception into the cached response.Tests
test_each_cached_read_reports_one_span_with_its_outcomenow also checks that no read-through span has an exception event or an error level. It fails without the fix.test-int/read_cache: 76 passed.tests/test_read_cache_*: 15 passed.just fast-checkpasses.🤖 Generated with Claude Code
https://claude.ai/code/session_016N9c6ouiT4Wid3arGR41Dv