mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Merge pull request #5042 from matrix-org/erikj/fix_get_missing_events_error
Handle the case of `get_missing_events` failing
This commit is contained in:
commit
7dcf984075
1
changelog.d/5042.bugfix
Normal file
1
changelog.d/5042.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix bug processing incoming events over federation if call to `/get_missing_events` fails.
|
@ -498,15 +498,25 @@ class FederationHandler(BaseHandler):
|
|||||||
#
|
#
|
||||||
# All that said: Let's try increasing the timout to 60s and see what happens.
|
# All that said: Let's try increasing the timout to 60s and see what happens.
|
||||||
|
|
||||||
missing_events = yield self.federation_client.get_missing_events(
|
try:
|
||||||
origin,
|
missing_events = yield self.federation_client.get_missing_events(
|
||||||
room_id,
|
origin,
|
||||||
earliest_events_ids=list(latest),
|
room_id,
|
||||||
latest_events=[pdu],
|
earliest_events_ids=list(latest),
|
||||||
limit=10,
|
latest_events=[pdu],
|
||||||
min_depth=min_depth,
|
limit=10,
|
||||||
timeout=60000,
|
min_depth=min_depth,
|
||||||
)
|
timeout=60000,
|
||||||
|
)
|
||||||
|
except RequestSendFailed as e:
|
||||||
|
# We failed to get the missing events, but since we need to handle
|
||||||
|
# the case of `get_missing_events` not returning the necessary
|
||||||
|
# events anyway, it is safe to simply log the error and continue.
|
||||||
|
logger.warn(
|
||||||
|
"[%s %s]: Failed to get prev_events: %s",
|
||||||
|
room_id, event_id, e,
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
"[%s %s]: Got %d prev_events: %s",
|
"[%s %s]: Got %d prev_events: %s",
|
||||||
|
Loading…
Reference in New Issue
Block a user