summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2023-02-08 17:41:55 +0100
committerGitHub <noreply@github.com>2023-02-08 16:41:55 +0000
commitc78c67c5a909c6749f25b251d46be3df8f56f8c2 (patch)
tree61c6b0005ecdfb992143dbe1f28841786e0f8dd6
parentPermalink to the docs (diff)
downloadsynapse-c78c67c5a909c6749f25b251d46be3df8f56f8c2.tar.xz
Fix bug in replication where response is cached (#15024)
-rw-r--r--changelog.d/15024.bugfix1
-rw-r--r--synapse/replication/http/_base.py2
2 files changed, 3 insertions, 0 deletions
diff --git a/changelog.d/15024.bugfix b/changelog.d/15024.bugfix
new file mode 100644
index 0000000000..dddd406322
--- /dev/null
+++ b/changelog.d/15024.bugfix
@@ -0,0 +1 @@
+Fix bug where retried replication requests would return a failure. Introduced in v1.76.0.
diff --git a/synapse/replication/http/_base.py b/synapse/replication/http/_base.py
index 908f3f1db7..c20d9c7e9d 100644
--- a/synapse/replication/http/_base.py
+++ b/synapse/replication/http/_base.py
@@ -426,6 +426,8 @@ class ReplicationEndpoint(metaclass=abc.ABCMeta):
             code, response = await self.response_cache.wrap(
                 txn_id, self._handle_request, request, content, **kwargs
             )
+            # Take a copy so we don't mutate things in the cache.
+            response = dict(response)
         else:
             # The `@cancellable` decorator may be applied to `_handle_request`. But we
             # told `HttpServer.register_paths` that our handler is `_check_auth_and_handle`,