mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Merge branch 'erikj/fix_stalled_catchup' into develop
This commit is contained in:
commit
be0e722fe1
1
changelog.d/9770.bugfix
Normal file
1
changelog.d/9770.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix bug where sharded federation senders could get stuck repeatedly querying the DB in a loop, using lots of CPU.
|
@ -734,16 +734,18 @@ class FederationSender(AbstractFederationSender):
|
|||||||
self._catchup_after_startup_timer = None
|
self._catchup_after_startup_timer = None
|
||||||
break
|
break
|
||||||
|
|
||||||
|
last_processed = destinations_to_wake[-1]
|
||||||
|
|
||||||
destinations_to_wake = [
|
destinations_to_wake = [
|
||||||
d
|
d
|
||||||
for d in destinations_to_wake
|
for d in destinations_to_wake
|
||||||
if self._federation_shard_config.should_handle(self._instance_name, d)
|
if self._federation_shard_config.should_handle(self._instance_name, d)
|
||||||
]
|
]
|
||||||
|
|
||||||
for last_processed in destinations_to_wake:
|
for destination in destinations_to_wake:
|
||||||
logger.info(
|
logger.info(
|
||||||
"Destination %s has outstanding catch-up, waking up.",
|
"Destination %s has outstanding catch-up, waking up.",
|
||||||
last_processed,
|
last_processed,
|
||||||
)
|
)
|
||||||
self.wake_destination(last_processed)
|
self.wake_destination(destination)
|
||||||
await self.clock.sleep(CATCH_UP_STARTUP_INTERVAL_SEC)
|
await self.clock.sleep(CATCH_UP_STARTUP_INTERVAL_SEC)
|
||||||
|
Loading…
Reference in New Issue
Block a user