Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Record any exception when processing a pulled event #13814

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.d/13589.feature
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Keep track when we attempt to backfill an event but fail so we can intelligently back-off in the future.
Keep track when we fail to process a pulled event over federation so we can intelligently back-off in the future.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating the changelog to be more accurate

1 change: 1 addition & 0 deletions changelog.d/13814.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Keep track when we fail to process a pulled event over federation so we can intelligently back-off in the future.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same changelog as #13589 since we're still doing the same sort of thing. Just recording other exceptions here now.

10 changes: 10 additions & 0 deletions synapse/handlers/federation_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,11 @@ async def _process_pulled_event(
event.room_id, event_id, str(err)
)
return
except Exception as exc:
await self._store.record_event_failed_pull_attempt(
event.room_id, event_id, str(exc)
)
raise exc
Comment on lines +869 to +873
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a specific error that I am trying to catch here. But seems good to catch whatever exception might be popping out of our processing loops.


try:
try:
Expand Down Expand Up @@ -908,6 +913,11 @@ async def _process_pulled_event(
logger.warning("Pulled event %s failed history check.", event_id)
else:
raise
except Exception as exc:
await self._store.record_event_failed_pull_attempt(
event.room_id, event_id, str(exc)
)
raise exc

@trace
async def _compute_event_context_with_maybe_missing_prevs(
Expand Down