This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
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.
Catch-up after Federation Outage (bonus): Catch-up on Synapse Startup #8322
Catch-up after Federation Outage (bonus): Catch-up on Synapse Startup #8322
Changes from 9 commits
2486840
c36261e
86d0b79
a2e6b36
223ba3c
49bd80e
918ef90
876b4d1
9b97702
3cafd45
f27744d
c76209a
47452c3
d464a4f
4b92775
0ea50f3
9425bb4
1f0bedf
5186364
7757ced
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
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 logic seems to be duplicated from
wake_destination
. What was the goal here? Is it just to avoid the logging?If there is multiple federation senders than they'll each run this code, but only handle the destinations they're interested in? It might be clearer to pre-filter the list, like:
synapse/synapse/federation/sender/__init__.py
Lines 335 to 340 in 58f61f1
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.
Yes, just to avoid the logging (because it'd be very confusing to have a federation sender claim it was waking a destination that it didn't) [and we also avoid the sleep].
Pre-filtering: no strong opinions there, fine by me — it's an extra pass and list allocation but only a small list so should be OK
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.
Is it possible that
destination
no longer needs to be woken up at this point or willwake_destination
just bail since the loop is running already?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.
If it already started transmitting and is doing that, it will see the flag and not start the transmitter loop.
If it already caught up quickly, then it will still wake it up but the logic there will notice that there is nothing to send so it won't do anything.
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.
That was what I gathered too, just double checking!
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.
Where is this
last_successful_stream_ordering
coming from?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.
Is it clearer now?:
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 attempts to find destinations which have never been backed off from or which are beyond their retry interval?
Does this mean it will just poke all servers when it wakes up?
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.
Yes, this part means
have never been backed off from or have an expired backoff
.restricts this to only destinations with catch-up needed.
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.
Why is this necessary? Is it because
_wake_destinations_needing_catchup
doesn't protect itself from being called multiple times?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.
Yes, since the reactor gets pumped then calling it manually ourselves doesn't change the fact that it is called automatically after the timer.
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.
If you're just trying to compare the values are the same (in any order), use
assertCountEqual
: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.
It's good to see there is a built-in function for this, but I'm not sure I like it — the name is completely misleading?
(sounds like it is doing
len(woken.keys()) == len(server_names[:-1])
…)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.
I agree that the name isn't great, but using the standardized form is easier instead of parsing the logic IMO.