-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more tests for receiving events while resyncing for a partial join #419
Merged
squahtx
merged 22 commits into
main
from
squah/faster_room_joins_calculate_partial_state_flag_for_backfill
Jul 26, 2022
Merged
Changes from 8 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a07b041
Factor out CreateMessageEvent() function
7b483be
Factor out `testReceiveEventDuringPartialStateJoin()` function
bd2b688
Add `handleGetMissingEventsRequests()` function to respond to `/get_m…
d085f11
Test whether the homeserver thinks it has full state at a received event
2cbeaae
Allow explicitly specified `/state` and `/state_ids` requests to comp…
894d755
Add simple test for receiving an event with a missing prev event
0643979
Add a test for receiving an event with one missing and one known prev…
5e38528
Add a test for receiving an event with a missing prev event, with one…
2979d24
fixup: s/sent/created/
a5b3c71
fixup: define StateIDsResult struct and send /state_id failures down …
8f5b930
fixup: rename new tests to use parents/grandparents terminology
49e35b4
Revert "Allow explicitly specified `/state` and `/state_ids` requests…
1adf5aa
Faster joins tests: make request handlers more specific
richvdh 74dc057
fixup: Add explicit /state_id and /state handlers instead
5a9832f
Log which /state_ids request is being replied to
d437bfb
fixup: explain purpose of deferred channel read
8abc0e8
fixup: link to synapse#13288
8f0b234
Merge remote-tracking branch 'origin/main' into squah/faster_room_joi…
98907c0
fixup: Use WithRetryUntil to retry /event
47ce7ba
Use Context.WithTimeout instead of a SendFederationRequest goroutine
1a0fa9f
Add comment explaining purpose of early /state_ids request
e3d8197
fixup: Remove .vscode/settings.json
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
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.
(I'm a bit surprised that closing the channel isn't sufficient for this, but fair enough)
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.
We get a
panic: send on closed channel
without this. To clarify:no close and no read -> complement times out after 10 minutes
defer close + no read -> panic
defer close + defer read -> complement is happy
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 don't really see why this is done in a goroutine at all - is this because
SendFederationRequest
can block indefinitely? There is a default 30s timeout - if that is too long then you need to send a custom context with a timeout here -complement/internal/federation/server.go
Line 227 in d842670
context.Background()
so it won't ever expire, but you can change that easily by doing:This will require a change to Complement's API to:
but that's fine.
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.
Thanks for the suggestion, that's a lot cleaner!