273 Commits

Author SHA1 Message Date
Till Faelligen
ee714ea95e
Set a fillfactor of 90%, use DeepEqual instead of marshal -> bytes.Equal 2023-07-26 08:56:29 +02:00
David Robertson
4a6623ff77
Include room ID in the txnid payload 2023-07-25 19:08:11 +01:00
David Robertson
008157c146
poller: send all-clear 2023-07-25 19:08:10 +01:00
David Robertson
c5d7570e09
poller: mark txn IDs as seen 2023-07-25 19:08:10 +01:00
David Robertson
8592fe3af2
TODO note 2023-07-25 19:08:10 +01:00
David Robertson
f9d49722f1
Construct a gadget for tracking pending txn IDs 2023-07-25 19:08:10 +01:00
Till Faelligen
8dc8d4897f
Let only one device handle typing notifications 2023-07-24 08:40:23 +02:00
Till Faelligen
e56615856f
Protect typingMap with a mutex, sort userIDs before hashing 2023-07-20 13:06:11 +02:00
Till Faelligen
ca263b261e
Try to call SetTyping more synchronized, fix wrong JSON 2023-07-20 12:31:18 +02:00
Till Faelligen
2840d0dd52
Add failing test 2023-07-20 09:42:03 +02:00
Till Faelligen
22f640a352
Check that calls to /sync use the expected since token 2023-07-19 14:56:44 +02:00
Till Faelligen
46d56b8433
Add test to check that the since token is only stored in the database
periodically
2023-07-19 12:17:47 +02:00
Till Faelligen
f6f1106fc4
Update test to include ToDevice messages 2023-07-18 14:37:33 +02:00
Till Faelligen
bccfa87453
Persist the since token only if the last time was over 1 minute ago OR
there are toDevice events in the response
2023-07-18 13:39:18 +02:00
kegsay
a840e9a681
Merge pull request #188 from MatMaul/mv/increase-timeout-init-sync
Increase timeout of init sync to 30mn for small homeservers
2023-07-17 01:09:59 -07:00
Kegan Dougal
c47665f1e8 Actually honour max conns globally, not per storage struct 2023-07-12 17:36:59 +01:00
Kegan Dougal
c1b0f0b93b Review comments 2023-07-12 12:24:02 +01:00
kegsay
b72ad3bded
Merge branch 'main' into dmr/debug-from-stable 2023-07-12 03:41:06 -07:00
David Robertson
dcf8db3472
Actually observe the new metric 2023-07-10 16:19:05 +01:00
David Robertson
5064f64b35
Log error message to stdout if poller panics
otherwise we only see the error message if we're using sentry.
2023-07-10 14:26:49 +01:00
David Robertson
41a7240384
Report a metric for the size of gappy state blocks 2023-07-10 14:26:49 +01:00
Kegan Dougal
150821f61e Add unregister hooks 2023-07-07 14:05:00 +01:00
Kegan Dougal
7621aa1ebb Track num polls in the right place 2023-07-07 12:46:01 +01:00
Kegan Dougal
e67ba9a30e Add more poller metrics 2023-07-07 12:41:39 +01:00
Kegan Dougal
0c95c56f01 logging: log less, aggregate more. Fix npe on slowReq metric 2023-07-04 17:20:55 +01:00
Kegan Dougal
b9bc83d93f Add WorkerPool and use it for OnE2EEData
- Allowing unlimited concurrency on OnE2EEData causes huge spikes in DB conns
  when device lists change.
- Using a high, bounded amount of concurrency ensure we don't breach DB conn limits.

With unit tests.
2023-06-28 16:32:23 -05:00
Mathieu Velten
3bf3f23053 Increase timeout of init sync to 30mn for small homeservers 2023-06-27 20:07:21 +02:00
Kegan Dougal
0caeb03f38 kick ci? 2023-06-26 21:12:56 -07:00
Kegan Dougal
f36c038cf8 Rate limit pubsub.V2DeviceData updates to be at most 1 per second
The db writes are still instant, but the notifications are now delayed
by up to 1 second, in order to not swamp the pubsub channels.
2023-06-26 21:04:02 -07:00
Kegan Dougal
f7b2478ad0 Merge branch 'main' into kegan/max-db-conns-test 2023-06-19 17:31:02 +01:00
David Robertson
af852c22d1
Another test fixup 2023-06-19 16:49:37 +01:00
David Robertson
0c4dd11bba
Update tests 2023-06-19 16:42:05 +01:00
David Robertson
9c1362fc8e
Actually use txn when inserting tokens & devices 2023-06-19 16:17:57 +01:00
Kegan Dougal
4c661fbdd1 Add db conns test; uncomment DBMaxConns to break the world 2023-06-19 15:56:22 +01:00
Kegan Dougal
5f3401659f Treat 403s on /sync as 401s 2023-06-19 11:23:31 +01:00
Kegan Dougal
6569468e45 Add structures for unit testing handler2 2023-06-15 11:57:22 +01:00
Kegan Dougal
cb15252967 Set sensible DB conn limits 2023-06-14 10:24:25 +01:00
David Robertson
9caa6db903
Trace DoSyncV2 in a region, too 2023-06-12 17:42:14 +01:00
David Robertson
44d8f2f811
Add subtasks for the hell of it 2023-06-12 16:23:11 +01:00
David Robertson
fae8210a30
Make each poll a task, for easier profiling 2023-06-12 16:06:50 +01:00
David Robertson
af5852f2a5
Merge pull request #153 from matrix-org/dmr/txnid-payload
Emit txnid payloads
2023-06-12 12:01:51 +01:00
David Robertson
6a951908af
Emit a User and DeviceID in txn message 2023-06-12 11:52:33 +01:00
David Robertson
ff02c4c79a
handler2.Handler: emit txn id payloads 2023-06-10 14:14:16 +01:00
David Robertson
ecd4df4f1a
Comments! 2023-06-10 14:11:20 +01:00
David Robertson
e58e06a417
Sentry: report panics in poller.Poll 2023-06-09 20:30:11 +01:00
David Robertson
7633860cca
Perf: process device data faster
Pollers can now publish E2EE data outside of the executor.
2023-06-09 19:29:29 +01:00
Kegan Dougal
08f34ba5c2 Move out SetCallbacks to allow for better DI 2023-06-08 16:59:37 +01:00
David Robertson
e5eb4f12ba
Plumb a ctx through to sync2
Thank God for Goland's refactoring tools.

This will (untested) associate sentry events from the sync2 part of the
code with User IDs and Device IDs, without having to constantly invoke
sentry.WithScope(). (Not all of the handler methods currently have that
information.) It also leaves the door open for us to include more data
on poller sentry reports (e.g. access token hash, time of last token
activity on the sync3 side, ...)
2023-05-25 22:22:15 +01:00
David Robertson
cb75672132
Attach a sentry hub to the DoSyncV2 context 2023-05-25 21:55:37 +01:00
David Robertson
c0e0f8400e
Introduce const for the ss sentry context key 2023-05-25 21:55:18 +01:00