fix(sentry): also drop transient redis TimeoutError events - #3028
Conversation
- The before_send filter caught redis.exceptions.ConnectionError but not redis.exceptions.TimeoutError — in redis-py the two are siblings under RedisError, not parent/child, so a redis outage that hangs the socket (rather than refusing) slipped through to Sentry - Surfaced post-deploy as ANTHIAS-1B (Timeout connecting to server, viewer resolution reporter) once the build-hash release tags made it identifiable - Match on both types; add the redis-stubs TimeoutError entry and a regression test that also pins the sibling (not subclass) relation Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
There was a problem hiding this comment.
Pull request overview
This PR tightens the Sentry before_send noise filter to also drop transient Redis socket TimeoutError events (a sibling of ConnectionError in redis-py), preventing expected Redis blips from being reported to Sentry.
Changes:
- Update
_sentry_before_sendto treat bothredis.exceptions.ConnectionErrorandredis.exceptions.TimeoutErroras transient Redis noise. - Add a regression test ensuring
TimeoutErroris filtered and asserting the sibling (non-subclass) relationship toConnectionError. - Extend the local redis stub exceptions to include
TimeoutErrorfor type checking.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/anthias_server/django_project/settings.py |
Expands transient Redis exception filtering to include TimeoutError via a shared tuple in the before_send hook. |
tests/test_sentry.py |
Adds regression coverage for dropping Redis TimeoutError and locks in the intended redis-py exception hierarchy assumption. |
stubs/redis-stubs/exceptions.pyi |
Adds TimeoutError to the redis exception stubs to match the newly-referenced exception type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- CalVer (YYYY.0M.MICRO); still June 2026, micro 2 -> 3 - Gives Sentry a real release boundary: every build since 2026.6.2 reported the same base version (only the +git-hash differed), so resolved-in-next-release never stuck and fixed issues kept reopening on the next event. A version bump lets the deployed fixes actually clear from the board. - Ships the crash/noise fixes merged since 2026.6.2: SQLite WAL + busy timeout (#3015), celery migration-gate (#3016) and asset-probe soft limits (#3017), transient-redis/CancelledError Sentry filtering + redis healthcheck (#3018/#3028), GitHub update-check log level (#3019), webview respawn on D-Bus death at setup and mid-play (#3020/#3031), resilient static-file scan (#3026), Wayland-socket wait (#3030), and Sentry release/board triage tags (#3021/#3025) Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
|
When performing a full clean install of 2026.7.1 (after zero configuration), I get the following error repeating in the logs of Is this the same condition this pull was to fix or is this something different? |



Issues Fixed
Sentry ANTHIAS-1B —
TimeoutError: Timeout connecting to serverin the viewer's resolution reporter; a gap in #3018 found while auditing the post-deploy2026.6.2+eb1baa6events.Description
#3018's
before_sendfilter dropsredis.exceptions.ConnectionError, but redis-py'sTimeoutErroris a sibling ofConnectionErrorunderRedisError— not a subclass. So the same transient redis outage, when the socket hangs instead of refusing, slipped past the filter and reached Sentry. (The build-hash release tags from #3025 are what made this newly-distinguishable event easy to spot in the audit.)(ConnectionError, TimeoutError)fromredis.exceptionsTimeoutErrortostubs/redis-stubs/exceptions.pyiChecklist
🤖 Generated with Claude Code