narrow load_outcomes exception in replay.py to redis and parse failures - #18
narrow load_outcomes exception in replay.py to redis and parse failures#18HrachShah wants to merge 1 commit into
Conversation
load_outcomes wraps three operations: xrange() (Redis stream read, raises aioredis.RedisError on connection drops, timeouts, NOSCRIPT after Redis restarts), OutcomeRecord.from_stream() (which itself catches (ValueError, TypeError) and returns a sentinel, but if its own internal logic changes it can propagate them), and dict.get / float() / int() on the fields dict (also ValueError / TypeError on malformed payloads). The previous bare `except Exception:` also caught AttributeError / NameError from typos in this file, KeyboardInterrupt when the user Ctrl-Cs while a replay is running, and SystemExit. The narrow set keeps the existing "load failure logs and returns []" behavior for the real failure modes while letting real bugs surface. Verified the file still parses, and a manual round-trip with a malformed "judge_score" entry returns the existing logger.exception path.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideNarrows the exception handling in load_outcomes to only Redis and parsing-related errors so that genuine programming errors and interrupts surface instead of being silently swallowed. Sequence diagram for narrowed exception handling in load_outcomessequenceDiagram
participant load_outcomes
participant redis
participant OutcomeRecord
participant logger
load_outcomes->>redis: xrange
redis-->>load_outcomes: stream_entries
load_outcomes->>OutcomeRecord: from_stream
OutcomeRecord-->>load_outcomes: records
load_outcomes->>logger: info
alt [aioredis.RedisError or ValueError or TypeError]
load_outcomes->>logger: exception
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Review limit reached
Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
load_outcomes wraps three operations: xrange() (Redis stream read, raises
aioredis.RedisError on connection drops, timeouts, NOSCRIPT after Redis
restarts), OutcomeRecord.from_stream() (which itself catches (ValueError,
TypeError) and returns a sentinel, but if its own internal logic changes
it can propagate them), and dict.get / float() / int() on the fields dict
(also ValueError / TypeError on malformed payloads). The previous bare
except Exception:also caught AttributeError / NameError from typos inthis file, KeyboardInterrupt when the user Ctrl-Cs while a replay is
running, and SystemExit. The narrow set keeps the existing "load failure
logs and returns []" behavior for the real failure modes while letting
real bugs surface.
Verified the file still parses, and a manual round-trip with a
malformed "judge_score" entry returns the existing logger.exception
path. No test changes (the existing test suite for the experiments
module is minimal; the manual round-trip is the highest-signal check).
Summary by Sourcery
Bug Fixes: