Skip processing stats for broken rooms. (#14873)

* Skip processing stats for broken rooms.

* Newsfragment

* Use a custom exception.
This commit is contained in:
Patrick Cloke 2023-01-23 06:36:20 -05:00 committed by GitHub
parent 2ec9c58496
commit 82d3efa312
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 72 additions and 36 deletions

View file

@ -110,6 +110,10 @@ event_fetch_ongoing_gauge = Gauge(
)
class InvalidEventError(Exception):
"""The event retrieved from the database is invalid and cannot be used."""
@attr.s(slots=True, auto_attribs=True)
class EventCacheEntry:
event: EventBase
@ -1310,7 +1314,7 @@ class EventsWorkerStore(SQLBaseStore):
# invites, so just accept it for all membership events.
#
if d["type"] != EventTypes.Member:
raise Exception(
raise InvalidEventError(
"Room %s for event %s is unknown" % (d["room_id"], event_id)
)