Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Creating a handful (~3) of rooms, for example to populate a new Space in Element Web, leads to running into rate limits #14312

@reivilibre

Description

@reivilibre

With default rate limiting values, we used to be able to create at least 3 rooms in one go. The new Space screen in Element Web depends on this (element-hq/element-web#23620) and breaks if any of those room creations are rate limited, as they are now (v1.70.0).

The following test case demonstrates this:

from http import HTTPStatus

from synapse.rest.client import room
from tests.unittest import HomeserverTestCase, override_config


class BisectCase(HomeserverTestCase):
    servlets = [room.register_servlets]
    hijack_auth = True
    user_id = "@sid1:test"

    @override_config({
        "rc_message": {"per_second": 0.2, "burst_count": 10},
    })
    def test_can_create_3_rooms(self):
        """
        Should be able to create 3 rooms in a row (e.g. rooms in a space)
        without hitting rate limits.
        """

        for _ in range(3):
            channel = self.make_request(
                "POST",
                "/createRoom",
                {},
            )
            self.assertEqual(channel.code, HTTPStatus.OK, channel.json_body)

Bisecting, the following commit is what made the above fail because of the rate limit: 8ab16a9 'Persist CreateRoom events to DB in a batch (#13800)' in v1.69.0.

We should try to revert rate limiting to behave the same as before or closely enough that this basic use case is not broken.

Metadata

Metadata

Assignees

Labels

O-OccasionalAffects or can be seen by some users regularly or most users rarelyS-MajorMajor functionality / product severely impaired, no satisfactory workaround.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.X-Release-BlockerMust be resolved before making a release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions