Commit graph

311 commits

Author SHA1 Message Date
Devon Hudson 07a4ca968c
Hook in mailserver retrieval to pinecone demos 2022-12-06 13:59:20 -07:00
Devon Hudson 5d45b5baad
Fix panic in database GetAsyncTransaction 2022-12-06 13:56:04 -07:00
Devon Hudson fea8b5787a
Mark the possible separation line for mailservers 2022-12-05 13:14:58 -07:00
Devon Hudson 1df1a597ec
Remove assume offline on broadcast received 2022-12-02 16:18:48 -07:00
Devon Hudson 98c7711b84
Merge branch 'main' into mailbox 2022-12-02 16:13:30 -07:00
Devon Hudson b60669ad63
Add federation client endpoint for async_events 2022-12-02 15:18:53 -07:00
Devon Hudson 56e9b54f31
Handle retrieving async events on request 2022-12-02 14:07:40 -07:00
Devon Hudson bfa784b224
Add initial api for getting async_events 2022-12-02 11:48:55 -07:00
Devon Hudson 9dbfcd9e06
Handle async send success/fail cases 2022-12-01 14:17:13 -07:00
Devon Hudson e26d07c779
Add test for queued edus to set server assumed offline 2022-11-30 12:42:17 -07:00
Devon Hudson 1687aac200
Store assumed offline servers in the database 2022-11-30 12:38:54 -07:00
Devon Hudson 22ec1deaca
Handle async queue sending error to not fail if any mailserver succeeds 2022-11-29 18:22:00 -07:00
Devon Hudson 266bf20a85
Try sending to async mailservers if the conditions are right 2022-11-29 18:12:18 -07:00
Devon Hudson 116bdfc511
Add doc comments for statistics 2022-11-29 17:54:48 -07:00
Devon Hudson 0c86e8269d
Query mailservers when creating a new server statistics instance 2022-11-29 17:51:04 -07:00
Devon Hudson 0520a9b0ed
Add database table for mailservers 2022-11-29 17:43:09 -07:00
Devon Hudson 2df4b0750e
Don't do regular federation if should be using mailserver 2022-11-29 15:52:21 -07:00
Devon Hudson d4dde15113
Mark server as assumed offline with configurable value 2022-11-29 15:10:16 -07:00
Devon Hudson f218daaf64
Integrate initial s&f interactions with db 2022-11-23 11:21:07 -07:00
Devon Hudson b237f2d62d
Add s&f database interactions 2022-11-22 14:28:48 -07:00
Neil Alexander 8299da5905
Fix registration for virtual hosting 2022-11-18 13:24:02 +00:00
devonh a8e7ffc7ab
Add p2p wakeup broadcast handling to pinecone demos (#2841)
Adds wakeup broadcast handling to the pinecone demos.
This will reset their blacklist status and interrupt any ongoing
federation queue backoffs currently in progress for this peer.
The end result is that any queued events will quickly be sent to the
peer if they had disconnected while attempting to send events to them.
2022-11-18 00:29:23 +00:00
Neil Alexander 16325203af
Try that again 2022-11-17 09:32:19 +00:00
Neil Alexander 607819f425
Fix /key/v2/server, add HTTP Host matching 2022-11-17 09:26:56 +00:00
Neil Alexander 163dabc498
Fix bug in a2f72dd9 2022-11-16 15:10:33 +00:00
Neil Alexander a2f72dd966
Fix slice out of bounds in federation API 2022-11-16 09:39:19 +00:00
Neil Alexander d558da1c87
Virtual host server name workaround 2022-11-16 09:34:09 +00:00
Neil Alexander deddf686b9
Tweak /key/v2/server 2022-11-16 09:16:07 +00:00
Neil Alexander 9b8bb55430
Don't get blacklisted hosts when querying joined servers (#2880)
Otherwise we just waste time/CPU.
2022-11-15 17:21:16 +00:00
Neil Alexander 6650712a1c
Federation fixes for virtual hosting 2022-11-15 15:05:23 +00:00
Neil Alexander 529df30b56
Virtual hosting schema and logic changes (#2876)
Note that virtual users cannot federate correctly yet.
2022-11-11 16:41:37 +00:00
Till 0193549201
Send presence to newly added servers (#2869)
This should make `New federated private chats get full presence
information (SYN-115)` happy.
2022-11-11 10:35:17 +01:00
Devon Hudson b9d5fd942f
Add initial test for forward_async federation endpoint 2022-11-10 18:24:21 -07:00
Till b13cb43785
Send presence to joined hosts only (#2858)
Send presence events only to rooms the user is participating, not all
servers we know about.
Should fix #2752
2022-11-04 13:23:00 +01:00
Neil Alexander a2706e6498
Refactor claimRemoteKeys 2022-10-27 15:34:26 +01:00
Till 444b4bbdb8
Add AS specific public room list endpoints (#2836)
Adds `PUT
/_matrix/client/v3/directory/list/appservice/{networkId}/{roomId}` and
`DELTE
/_matrix/client/v3/directory/list/appservice/{networkId}/{roomId}`
support, as well as the ability to filter `/publicRooms` on networkID
and including all networks.
2022-10-27 14:40:35 +02:00
devonh 97491a174b
Associate events in db before queueing them to send (#2833)
Fixes a race condition between sending federation events and having them
fully associated in the database.
2022-10-26 17:35:01 +01:00
Neil Alexander 5298dd1133
Update federation API consumers 2022-10-26 14:52:33 +01:00
Neil Alexander f6dea712d2
Initial support for multiple server names (#2829)
This PR is the first step towards virtual hosting by laying the
groundwork for multiple server names being configured.
2022-10-26 12:59:19 +01:00
Till 9e4c3171da
Optimize inserting pending PDUs/EDUs (#2821)
This optimizes the association of PDUs/EDUs to their destination by
inserting all destinations in one transaction.
2022-10-21 12:50:51 +02:00
devonh b58c9bb094
Fix flakey queue test (#2818)
Ensure both events are added to the database, even if the destination is
already blacklisted.
2022-10-20 15:37:35 +00:00
Till Faelligen 6a93858125
Fix race condition 2022-10-20 10:45:59 +02:00
devonh 241d5c47df
Refactor Federation Destination Queues (#2807)
This is a refactor of the federation destination queues.
It fixes a few things, namely:
- actually retry outgoing events with backoff behaviour
- obtain enough events from the database to fill messages as much as
possible
- minimize the amount of running goroutines
  - use pure timers for backoff
  - don't restart queue unless necessary
  - close the background task when backing off
- increase max edus in a transaction to match the spec
- cleanup timers more aggresively to reduce memory usage
- add jitter to backoff timers to reduce resource spikes
- add a bunch of tests (with real and fake databases) to ensure
everything is working
2022-10-19 11:03:16 +01:00
Neil Alexander f3be4b3185
Revert "Federation backoff fixes and tests (#2792)"
This reverts commit dcedd1b6bf.
2022-10-13 16:06:50 +01:00
devonh dcedd1b6bf
Federation backoff fixes and tests (#2792)
This fixes some edge cases where federation queue backoffs and
blacklisting weren't behaving as expected.
It also adds new tests for the federation queues to ensure their
behaviour continues to work correctly.
2022-10-13 14:38:13 +00:00
Neil Alexander 0a9aebdf01
Private read receipts (#2789)
Implement behaviours for `m.read.private` receipts.
2022-10-11 12:27:21 +01:00
Neil Alexander 9ed8ff6b93
Tweak federation M_NOT_FOUND errors 2022-10-11 10:48:36 +01:00
Neil Alexander 6bf1912525
Fix joined hosts with RewritesState (#2785)
This ensures that the joined hosts in the federation API are correct
after the state is rewritten. This might fix some races around the time
of joining federated rooms.
2022-10-10 16:54:04 +01:00
Till b000db81ca
Send E2EE related errors to sentry (#2784)
Only sends errors if we're not retrying them in NATS.
Not sure if those should be scoped/tagged with something like "E2EE".
2022-10-10 17:36:26 +02:00
Till 1ca3f3efb5
Fix issue with DMs shown as normal rooms (#2776)
Fixes #2121, test added in
https://github.com/matrix-org/complement/pull/494
2022-10-07 16:00:12 +02:00