This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Record any exception when processing a pulled event #13814
Merged
MadLittleMods
merged 3 commits into
develop
from
madlittlemods/13700-track-any-exception-failing-processing-pulled-event
Sep 15, 2022
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | ||
|
@@ -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( | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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