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

Port group attestation renewal slow down from matrix-org-hotfixes #7442

Merged
merged 2 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/7442.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Run group attestation renewal in series rather than parallel for performance.
6 changes: 2 additions & 4 deletions synapse/groups/attestations.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
from synapse.api.errors import HttpResponseException, RequestSendFailed, SynapseError
from synapse.metrics.background_process_metrics import run_as_background_process
from synapse.types import get_domain_from_id
from synapse.util.async_helpers import yieldable_gather_results

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -208,6 +207,5 @@ def _renew_attestation(group_user: Tuple[str, str]):
"Error renewing attestation of %r in %r", user_id, group_id
)

await yieldable_gather_results(
_renew_attestation, ((row["group_id"], row["user_id"]) for row in rows)
)
for row in rows:
await _renew_attestation((row["group_id"], row["user_id"]))