From 4620b5c1b3ea961ddc8fccf456a133afa5426f73 Mon Sep 17 00:00:00 2001 From: Zo Bot Date: Fri, 19 Jun 2026 11:49:14 +0000 Subject: [PATCH] narrow load_outcomes exception in replay.py to redis and parse failures 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. --- freerelay/control_plane/experiments/replay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freerelay/control_plane/experiments/replay.py b/freerelay/control_plane/experiments/replay.py index d09908f..ea9326e 100644 --- a/freerelay/control_plane/experiments/replay.py +++ b/freerelay/control_plane/experiments/replay.py @@ -148,7 +148,7 @@ async def load_outcomes( logger.info("replay_loaded_outcomes count=%d", len(records)) - except Exception: + except (aioredis.RedisError, ValueError, TypeError): logger.exception("load_outcomes_error") return records