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

Add configuration of the backoff algorithm for the federation client #15754

Merged
merged 17 commits into from
Aug 3, 2023
Merged
14 changes: 10 additions & 4 deletions synapse/config/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,20 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
# when trying to reach an unavailable destination.
# Unlike previous configuration those values applies across
# multiple requests and the state of the backoff is stored on DB.
self.destination_min_retry_interval_ms = Config.parse_duration(
federation_config.get("destination_min_retry_interval", "10m")
self.destination_min_retry_interval_ms = min(
Config.parse_duration(
federation_config.get("destination_min_retry_interval", "10m")
),
2**62,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this one needs to have a minimum set since we'll check against destination_max_retry_interval_ms regardless.

self.destination_retry_multiplier = federation_config.get(
"destination_retry_multiplier", 2
)
self.destination_max_retry_interval_ms = Config.parse_duration(
federation_config.get("destination_max_retry_interval", "7d")
self.destination_max_retry_interval_ms = min(
Config.parse_duration(
federation_config.get("destination_max_retry_interval", "7d")
),
2**62,
)


Expand Down
Loading