mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-21 17:15:38 +03:00
Also handle invalid event errors
This commit is contained in:
parent
d52c17ce01
commit
b4d0356e48
1 changed files with 6 additions and 3 deletions
|
@ -41,7 +41,10 @@ from synapse.storage.databases.main.events import (
|
||||||
SlidingSyncMembershipSnapshotSharedInsertValues,
|
SlidingSyncMembershipSnapshotSharedInsertValues,
|
||||||
SlidingSyncStateInsertValues,
|
SlidingSyncStateInsertValues,
|
||||||
)
|
)
|
||||||
from synapse.storage.databases.main.events_worker import DatabaseCorruptionError
|
from synapse.storage.databases.main.events_worker import (
|
||||||
|
DatabaseCorruptionError,
|
||||||
|
InvalidEventError,
|
||||||
|
)
|
||||||
from synapse.storage.databases.main.state_deltas import StateDeltasStore
|
from synapse.storage.databases.main.state_deltas import StateDeltasStore
|
||||||
from synapse.storage.databases.main.stream import StreamWorkerStore
|
from synapse.storage.databases.main.stream import StreamWorkerStore
|
||||||
from synapse.storage.types import Cursor
|
from synapse.storage.types import Cursor
|
||||||
|
@ -2090,7 +2093,7 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
|
||||||
fetched_events = await self.get_events(
|
fetched_events = await self.get_events(
|
||||||
current_state_ids_map.values()
|
current_state_ids_map.values()
|
||||||
)
|
)
|
||||||
except DatabaseCorruptionError as e:
|
except (DatabaseCorruptionError, InvalidEventError) as e:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"Failed to fetch state for room '%s' due to corrupted events. Ignoring. Error: %s",
|
"Failed to fetch state for room '%s' due to corrupted events. Ignoring. Error: %s",
|
||||||
room_id,
|
room_id,
|
||||||
|
@ -2197,7 +2200,7 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fetched_events = await self.get_events(state_ids_map.values())
|
fetched_events = await self.get_events(state_ids_map.values())
|
||||||
except DatabaseCorruptionError as e:
|
except (DatabaseCorruptionError, InvalidEventError) as e:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"Failed to fetch state for room '%s' due to corrupted events. Ignoring. Error: %s",
|
"Failed to fetch state for room '%s' due to corrupted events. Ignoring. Error: %s",
|
||||||
room_id,
|
room_id,
|
||||||
|
|
Loading…
Reference in a new issue