mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-08 10:12:15 -04:00
Refactor MatrixFederationAgent to retry SRV.
This refactors MatrixFederationAgent to move the SRV lookup into the endpoint code, this has two benefits: 1. Its easier to retry different host/ports in the same way as HostnameEndpoint. 2. We avoid SRV lookups if we have a free connection in the pool
This commit is contained in:
parent
ce5f1cb98c
commit
f299c5414c
4 changed files with 275 additions and 201 deletions
|
@ -83,8 +83,10 @@ class SrvResolverTestCase(unittest.TestCase):
|
|||
|
||||
service_name = b"test_service.example.com"
|
||||
|
||||
entry = Mock(spec_set=["expires"])
|
||||
entry = Mock(spec_set=["expires", "priority", "weight"])
|
||||
entry.expires = 0
|
||||
entry.priority = 0
|
||||
entry.weight = 0
|
||||
|
||||
cache = {service_name: [entry]}
|
||||
resolver = SrvResolver(dns_client=dns_client_mock, cache=cache)
|
||||
|
@ -105,8 +107,10 @@ class SrvResolverTestCase(unittest.TestCase):
|
|||
|
||||
service_name = b"test_service.example.com"
|
||||
|
||||
entry = Mock(spec_set=["expires"])
|
||||
entry = Mock(spec_set=["expires", "priority", "weight"])
|
||||
entry.expires = 999999999
|
||||
entry.priority = 0
|
||||
entry.weight = 0
|
||||
|
||||
cache = {service_name: [entry]}
|
||||
resolver = SrvResolver(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue