From 8dedbc48b85a5cd721835fb40e642e33b17ee99a Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 8 Feb 2023 13:48:23 +0000 Subject: [PATCH 1/2] Fix bug in replication where response is cached --- synapse/replication/http/_base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/synapse/replication/http/_base.py b/synapse/replication/http/_base.py index 908f3f1db7da..c20d9c7e9da7 100644 --- a/synapse/replication/http/_base.py +++ b/synapse/replication/http/_base.py @@ -426,6 +426,8 @@ async def _check_auth_and_handle( 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`, From 22ecb51852d717e8e6c9b31c4d6a266414bebd63 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 8 Feb 2023 13:51:27 +0000 Subject: [PATCH 2/2] Newsfile --- changelog.d/15024.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/15024.bugfix diff --git a/changelog.d/15024.bugfix b/changelog.d/15024.bugfix new file mode 100644 index 000000000000..dddd406322ee --- /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.