Skip to content

Commit 01cca7a

Browse files
committed
Merge branch 'develop' into madlittlemods/18592-GaugeBucketCollector
2 parents ffd4b6b + 458e641 commit 01cca7a

15 files changed

Lines changed: 133 additions & 35 deletions

File tree

changelog.d/18514.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add configurable rate limiting for the creation of rooms.

changelog.d/18718.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Reduce database usage in Sliding Sync by not querying for background update completion after the update is known to be complete.

changelog.d/18726.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Register the MSC4306 endpoints in the CS API when the experimental feature is enabled.

changelog.d/18727.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bump minimum version bound on Twisted to 21.2.0.

docker/complement/conf/workers-shared-extra.yaml.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ rc_delayed_event_mgmt:
9898
per_second: 9999
9999
burst_count: 9999
100100

101+
rc_room_creation:
102+
per_second: 9999
103+
burst_count: 9999
104+
101105
federation_rr_transactions_per_room_per_second: 9999
102106

103107
allow_device_name_lookup_over_federation: true

docs/usage/configuration/config_documentation.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1996,6 +1996,31 @@ rc_reports:
19961996
burst_count: 20.0
19971997
```
19981998
---
1999+
### `rc_room_creation`
2000+
2001+
*(object)* Sets rate limits for how often users are able to create rooms.
2002+
2003+
This setting has the following sub-options:
2004+
2005+
* `per_second` (number): Maximum number of requests a client can send per second.
2006+
2007+
* `burst_count` (number): Maximum number of requests a client can send before being throttled.
2008+
2009+
Default configuration:
2010+
```yaml
2011+
rc_room_creation:
2012+
per_user:
2013+
per_second: 0.016
2014+
burst_count: 10.0
2015+
```
2016+
2017+
Example configuration:
2018+
```yaml
2019+
rc_room_creation:
2020+
per_second: 1.0
2021+
burst_count: 5.0
2022+
```
2023+
---
19992024
### `federation_rr_transactions_per_room_per_second`
20002025

20012026
*(integer)* Sets outgoing federation transaction frequency for sending read-receipts, per-room.

poetry.lock

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,13 @@ signedjson = "^1.1.0"
178178
service-identity = ">=18.1.0"
179179
# Twisted 18.9 introduces some logger improvements that the structured
180180
# logger utilises
181-
Twisted = {extras = ["tls"], version = ">=18.9.0"}
182-
treq = ">=15.1"
181+
# Twisted 19.7.0 moves test helpers to a new module and deprecates the old location.
182+
# Twisted 21.2.0 introduces contextvar support.
183+
# We could likely bump this to 22.1 without making distro packagers'
184+
# lives hard (as of 2025-07, distro support is Ubuntu LTS: 22.1, Debian stable: 22.4,
185+
# RHEL 9: 22.10)
186+
Twisted = {extras = ["tls"], version = ">=21.2.0"}
187+
treq = ">=21.5.0"
183188
# Twisted has required pyopenssl 16.0 since about Twisted 16.6.
184189
pyOpenSSL = ">=16.0.0"
185190
PyYAML = ">=5.3"

schema/synapse-config.schema.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,6 +2228,17 @@ properties:
22282228
examples:
22292229
- per_second: 2.0
22302230
burst_count: 20.0
2231+
rc_room_creation:
2232+
$ref: "#/$defs/rc"
2233+
description: >-
2234+
Sets rate limits for how often users are able to create rooms.
2235+
default:
2236+
per_user:
2237+
per_second: 0.016
2238+
burst_count: 10.0
2239+
examples:
2240+
- per_second: 1.0
2241+
burst_count: 5.0
22312242
federation_rr_transactions_per_room_per_second:
22322243
type: integer
22332244
description: >-

synapse/config/ratelimiting.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,12 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
241241
defaults={"per_second": 1, "burst_count": 5},
242242
)
243243

244+
self.rc_room_creation = RatelimitSettings.parse(
245+
config,
246+
"rc_room_creation",
247+
defaults={"per_second": 0.016, "burst_count": 10},
248+
)
249+
244250
self.rc_reports = RatelimitSettings.parse(
245251
config,
246252
"rc_reports",

0 commit comments

Comments
 (0)