Commit graph

62 commits

Author SHA1 Message Date
Jason Volk
ffe3b0faf2 make shutdown grace periods configurable
Signed-off-by: Jason Volk <jason@zemos.net>
2025-02-02 16:30:55 +00:00
Jason Volk
09bc71caab fix missed concurrent fetch opportunities in sender (ffd0fd4242)
Signed-off-by: Jason Volk <jason@zemos.net>
2025-01-31 22:46:26 +00:00
Jason Volk
99fe88c21e use smallvec for the edu sending event buffer
Signed-off-by: Jason Volk <jason@zemos.net>
2025-01-29 01:18:08 +00:00
Jason Volk
ffd0fd4242 pipeline pdu fetch for federation sending destination
Signed-off-by: Jason Volk <jason@zemos.net>
2025-01-29 01:18:08 +00:00
Jason Volk
4a2d0d35bc split federation request from sending service
Signed-off-by: Jason Volk <jason@zemos.net>
2025-01-28 18:36:00 +00:00
Jason Volk
3e0ff2dc84 simplify references to server_name
Signed-off-by: Jason Volk <jason@zemos.net>
2025-01-28 18:36:00 +00:00
Jason Volk
02f19cf951 tweak tracing spans; inlines
db deserializer tracing instrument cover

Signed-off-by: Jason Volk <jason@zemos.net>
2025-01-10 07:03:34 +00:00
strawberry
a5d70f7356
add some m.room.member checks on putting direct state events
Signed-off-by: strawberry <strawberry@puppygock.gay>
2025-01-02 18:16:00 -05:00
Jason Volk
7e4453620e move exponential backoff util to different submod
Signed-off-by: Jason Volk <jason@zemos.net>
2025-01-01 23:28:01 -05:00
Jason Volk
0a9b6c136f refactor for ruma identifiers optimizations
Signed-off-by: Jason Volk <jason@zemos.net>
2025-01-01 23:28:01 -05:00
Jason Volk
e5a1309583 additional interruption points to hasten shutdown
Signed-off-by: Jason Volk <jason@zemos.net>
2025-01-01 23:28:01 -05:00
Jason Volk
af3d6a2e37 shard sender into multiple task workers by destination hash
rename Destination::Normal variant

tracing instruments

Signed-off-by: Jason Volk <jason@zemos.net>
2025-01-01 23:28:01 -05:00
Jade Ellis
5b5735f653 update ruwuma 2024-12-19 21:03:12 -05:00
strawberry
f54a62dda0 Revert "Send read reciept and typing indicator EDUs to appservices with receive_ephemeral"
This reverts commit 3675c941f8.
2024-12-18 11:26:18 -05:00
Jade Ellis
3675c941f8 Send read reciept and typing indicator EDUs to appservices with receive_ephemeral 2024-12-17 22:49:45 -05:00
strawberry
77e0b76408
apply new rustfmt.toml changes, fix some clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-12-15 01:00:41 -05:00
strawberry
0317cc8cc5
rename conduit to conduwuit finally
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-12-14 22:24:45 -05:00
Jason Volk
aba88ccead misc tracing span tweaks
Signed-off-by: Jason Volk <jason@zemos.net>
2024-12-10 06:20:30 +00:00
Jason Volk
ef9b1c6303 simplify sender shutdown; prevent launching any retries
Signed-off-by: Jason Volk <jason@zemos.net>
2024-12-04 00:51:57 +00:00
Jason Volk
b5266ad9f5 parallelize sender edu selection
Signed-off-by: Jason Volk <jason@zemos.net>
2024-11-29 08:47:03 +00:00
Jason Volk
c903a71807 refactor and optimize receipt service data
Signed-off-by: Jason Volk <jason@zemos.net>
2024-11-25 02:54:29 +00:00
Jason Volk
90106c4c33 streamline batch insertions
Signed-off-by: Jason Volk <jason@zemos.net>
2024-11-19 08:37:25 +00:00
Jason Volk
887ae84f1e optimize sha256 interface gather/vector inputs
Signed-off-by: Jason Volk <jason@zemos.net>
2024-11-16 00:33:40 +00:00
strawberry
4f0bdb5194 general misc bug fixes and slight improvements
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-11-15 09:41:17 -05:00
strawberry
4296d7174f add receive_ephemeral check for appservice EDU sending (if it even works)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-11-15 09:41:17 -05:00
Jason Volk
9da523c004 refactor for stronger RawPduId type
implement standard traits for PduCount

enable serde for arrayvec

typedef various shortid's

pducount simplifications

split parts of pdu_metadata service to core/pdu and api/relations

remove some yields; improve var names/syntax

tweak types for limit timeline limit arguments

Signed-off-by: Jason Volk <jason@zemos.net>
2024-11-06 21:46:20 +00:00
Jason Volk
d35376a90c aggregate receipts into single edu; dedup presence; refactor selection limits etc
Signed-off-by: Jason Volk <jason@zemos.net>
2024-10-26 18:50:29 -04:00
Jason Volk
0e0438e1f9 further optimize presence_since iteration
Signed-off-by: Jason Volk <jason@zemos.net>
2024-10-26 18:50:29 -04:00
Jason Volk
d526db681f refactor various patterns for serde_json::from_ elim
bump ruma

Signed-off-by: Jason Volk <jason@zemos.net>
2024-10-26 18:50:28 -04:00
Jason Volk
da34b43302 abstract account-data deserializations for serde_json::from_elim
Signed-off-by: Jason Volk <jason@zemos.net>
2024-10-26 18:50:28 -04:00
Jason Volk
56dd0f5139 use loop condition to account for loole channel close
Signed-off-by: Jason Volk <jason@zemos.net>
2024-10-26 18:50:28 -04:00
strawberry
fafe320899 send EDUs to appservices if in events
to_device is not supported yet

Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-10-25 00:38:14 -04:00
Jason Volk
946ca364e0 Database Refactor
combine service/users data w/ mod unit

split sliding sync related out of service/users

instrument database entry points

remove increment crap from database interface

de-wrap all database get() calls

de-wrap all database insert() calls

de-wrap all database remove() calls

refactor database interface for async streaming

add query key serializer for database

implement Debug for result handle

add query deserializer for database

add deserialization trait for option handle

start a stream utils suite

de-wrap/asyncify/type-query count_one_time_keys()

de-wrap/asyncify users count

add admin query users command suite

de-wrap/asyncify users exists

de-wrap/partially asyncify user filter related

asyncify/de-wrap users device/keys related

asyncify/de-wrap user auth/misc related

asyncify/de-wrap users blurhash

asyncify/de-wrap account_data get; merge Data into Service

partial asyncify/de-wrap uiaa; merge Data into Service

partially asyncify/de-wrap transaction_ids get; merge Data into Service

partially asyncify/de-wrap key_backups; merge Data into Service

asyncify/de-wrap pusher service getters; merge Data into Service

asyncify/de-wrap rooms alias getters/some iterators

asyncify/de-wrap rooms directory getters/iterator

partially asyncify/de-wrap rooms lazy-loading

partially asyncify/de-wrap rooms metadata

asyncify/dewrap rooms outlier

asyncify/dewrap rooms pdu_metadata

dewrap/partially asyncify rooms read receipt

de-wrap rooms search service

de-wrap/partially asyncify rooms user service

partial de-wrap rooms state_compressor

de-wrap rooms state_cache

de-wrap room state et al

de-wrap rooms timeline service

additional users device/keys related

de-wrap/asyncify sender

asyncify services

refactor database to TryFuture/TryStream

refactor services for TryFuture/TryStream

asyncify api handlers

additional asyncification for admin module

abstract stream related; support reverse streams

additional stream conversions

asyncify state-res related

Signed-off-by: Jason Volk <jason@zemos.net>
2024-10-25 00:32:30 -04:00
strawberry
acb9eae707 add back server name to error sending PDU to remote server
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-10-24 20:51:50 -04:00
strawberry
2d54264fbe
bump rust to 1.82.0, rocksdb v9.7.3, ruwuma, and a few nix pkgs
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-10-24 20:47:51 -04:00
Jason Volk
59efabbbc2 de-global server_is_ours / user_is_local
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-27 08:26:42 +00:00
Jason Volk
010e4ee35a de-global services for services
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-27 08:26:42 +00:00
Jason Volk
4343218957 initialize some containers with_capacity
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-27 08:26:42 +00:00
Jason Volk
b0ac5255c8 move sending service impl properly back to mod root
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-27 08:26:41 +00:00
Jason Volk
29fc5b9b52 de-global some services in services
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-27 08:26:41 +00:00
Jason Volk
8a2ae401df convert Client into Service
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-27 07:54:05 +00:00
Jason Volk
d2fb6d04c9 cleanup pending transactions before sender worker completes
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-14 11:31:39 +00:00
Jason Volk
c111d2e395 abstract service worker pattern; restart on panic.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-14 11:31:39 +00:00
Jason Volk
7397064edd fix arithmetic side-effects
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Jason Volk
52a561ff9e abstract expoential backoff to math utils.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-08 22:02:09 +00:00
Christoph Dittmann
2bc53139fa Don't send empty presence EDUs
I run a homeserver whose logs show a high number of incoming empty
presence EDUs originating from the user agent "Conduwuit/0.4.4". They
arrive at a rate of about 2 queries per second per Conduwuit server.

The empty EDUs all look the same, only with `origin_server_ts`
increasing:

```
{"origin":"example.com","origin_server_ts":1720266475601,"edus":[{"edu_type":"m.presence","content":{"push":[]}}]}
```

These updates are unnecessary because they don't do anything. They
only increase network traffic and CPU usage on both sides.

After this commit, the empty presence updates are no longer inserted
into the outgoing event queue.
2024-07-06 14:13:33 +02:00
Jason Volk
0cea64309a move PduEvent from services to core
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-04 21:06:35 +00:00
Jason Volk
6dd6e4bfaf simplify cork interface related
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-03 06:34:16 +00:00
Jason Volk
cb48e25783 refactor dyn KvTree out of services
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:02:16 +00:00
Jason Volk
7ad7badd60 devirtualize service Data traits
Signed-off-by: Jason Volk <jason@zemos.net>
2024-06-30 18:01:20 +00:00