summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2020-05-06 20:21:38 +0100
committerGitHub <noreply@github.com>2020-05-06 20:21:38 +0100
commit4162c39dcf9aa9a2d393e5ab3257596c3aa717c1 (patch)
treeeb27d94c5a10134fdf0f4898c0fdd3712e09a061
parentMake redis go faster with hiredis (#7439) (diff)
downloadsynapse-4162c39dcf9aa9a2d393e5ab3257596c3aa717c1.tar.xz
Port group attestation renewal slow down from matrix-org-hotfixes (#7442)
-rw-r--r--changelog.d/7442.misc1
-rw-r--r--synapse/groups/attestations.py6
2 files changed, 3 insertions, 4 deletions
diff --git a/changelog.d/7442.misc b/changelog.d/7442.misc
new file mode 100644
index 0000000000..a8fd5ad803
--- /dev/null
+++ b/changelog.d/7442.misc
@@ -0,0 +1 @@
+Run group attestation renewal in series rather than parallel for performance.
\ No newline at end of file
diff --git a/synapse/groups/attestations.py b/synapse/groups/attestations.py
index 1eec3874b6..27b0c02655 100644
--- a/synapse/groups/attestations.py
+++ b/synapse/groups/attestations.py
@@ -46,7 +46,6 @@ from twisted.internet import defer
 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__)
 
@@ -208,6 +207,5 @@ class GroupAttestionRenewer(object):
                     "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"]))