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
Don't wake up destination transaction queue if they're not due for retry. #16223
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ff14b77
Don't reset retry timers on error
erikjohnston 87ac2ed
Fix up
erikjohnston 99d6e1c
Fix up
erikjohnston badce67
Newsfile
erikjohnston 0b68944
Fix tests
erikjohnston f2149dc
Don't wake up destinations
erikjohnston 9456f06
Newsfile
erikjohnston 55c641e
Check nulls
erikjohnston 448e7d9
Add desc
erikjohnston 89c329e
Merge branch 'develop' into erikj/prune_destinations
erikjohnston 932cc3e
Also apply to sending device messages
erikjohnston cb2295f
Update newsfile
erikjohnston 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
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
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 |
---|---|---|
|
@@ -836,17 +836,16 @@ async def _handle_new_device_update_async(self) -> None: | |
user_id, | ||
hosts, | ||
) | ||
for host in hosts: | ||
self.federation_sender.send_device_messages( | ||
host, immediate=False | ||
) | ||
# TODO: when called, this isn't in a logging context. | ||
# This leads to log spam, sentry event spam, and massive | ||
# memory usage. | ||
# See https://github.com/matrix-org/synapse/issues/12552. | ||
# log_kv( | ||
# {"message": "sent device update to host", "host": host} | ||
# ) | ||
await self.federation_sender.send_device_messages( | ||
hosts, immediate=False | ||
) | ||
# TODO: when called, this isn't in a logging context. | ||
# This leads to log spam, sentry event spam, and massive | ||
# memory usage. | ||
# See https://github.com/matrix-org/synapse/issues/12552. | ||
# log_kv( | ||
# {"message": "sent device update to host", "host": host} | ||
# ) | ||
Comment on lines
-839
to
+848
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. 7 -> 6 levels of indentation :) |
||
|
||
if current_stream_id != stream_id: | ||
# Clear the set of hosts we've already sent to as we're | ||
|
@@ -951,8 +950,9 @@ async def handle_room_un_partial_stated(self, room_id: str) -> None: | |
|
||
# Notify things that device lists need to be sent out. | ||
self.notifier.notify_replication() | ||
for host in potentially_changed_hosts: | ||
self.federation_sender.send_device_messages(host, immediate=False) | ||
await self.federation_sender.send_device_messages( | ||
potentially_changed_hosts, immediate=False | ||
) | ||
|
||
|
||
def _update_device_from_client_ips( | ||
|
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
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
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 |
---|---|---|
|
@@ -343,7 +343,9 @@ def test_send_device_updates(self) -> None: | |
self.reactor.advance(1) | ||
|
||
# a second call should produce no new device EDUs | ||
self.hs.get_federation_sender().send_device_messages("host2") | ||
self.get_success( | ||
self.hs.get_federation_sender().send_device_messages(["host2"]) | ||
) | ||
Comment on lines
-345
to
+348
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. Ugh, more of these. Maybe we should resurrect #14519 , at least for the tests |
||
self.assertEqual(self.edus, []) | ||
|
||
# a second device | ||
|
@@ -551,7 +553,9 @@ def test_unreachable_server(self) -> None: | |
|
||
# recover the server | ||
mock_send_txn.side_effect = self.record_transaction | ||
self.hs.get_federation_sender().send_device_messages("host2") | ||
self.get_success( | ||
self.hs.get_federation_sender().send_device_messages(["host2"]) | ||
) | ||
|
||
# We queue up device list updates to be sent over federation, so we | ||
# advance to clear the queue. | ||
|
@@ -602,7 +606,9 @@ def test_prune_outbound_device_pokes1(self) -> None: | |
|
||
# recover the server | ||
mock_send_txn.side_effect = self.record_transaction | ||
self.hs.get_federation_sender().send_device_messages("host2") | ||
self.get_success( | ||
self.hs.get_federation_sender().send_device_messages(["host2"]) | ||
) | ||
|
||
# We queue up device list updates to be sent over federation, so we | ||
# advance to clear the queue. | ||
|
@@ -657,7 +663,9 @@ def test_prune_outbound_device_pokes2(self) -> None: | |
|
||
# recover the server | ||
mock_send_txn.side_effect = self.record_transaction | ||
self.hs.get_federation_sender().send_device_messages("host2") | ||
self.get_success( | ||
self.hs.get_federation_sender().send_device_messages(["host2"]) | ||
) | ||
|
||
# We queue up device list updates to be sent over federation, so we | ||
# advance to clear the queue. | ||
|
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.
This seems to add the filtering to
Are there other EDUs we should worry about here? (Typing? Device list stuff? to-device messages?)
What about the other methods on FederationSender?
is the point that only the former three handle multiple destinations in one call?
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.
(Oh there is logic below for typing EDUs. But why don't they go via the federation sender too?)
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.
Oh, mainly because a)
send_edu
andsend_device_messages
just take a single host, and b) I forgot about device messages 🤦