summary refs log tree commit diff
path: root/synapse/replication/tcp/streams/_base.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-04-07 11:01:04 +0100
committerGitHub <noreply@github.com>2020-04-07 11:01:04 +0100
commitce72355d7f67a986d60a7d86489b1b40f93fb152 (patch)
tree9d562fd0a9d98d6ce1eb96c1e837008d43c61ec2 /synapse/replication/tcp/streams/_base.py
parentMove server command handling out of TCP protocol (#7187) (diff)
downloadsynapse-ce72355d7f67a986d60a7d86489b1b40f93fb152.tar.xz
Fix race in replication (#7226)
Fixes a race between handling `POSITION` and `RDATA` commands. We do this by simply linearizing handling of them.
Diffstat (limited to 'synapse/replication/tcp/streams/_base.py')
-rw-r--r--synapse/replication/tcp/streams/_base.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/replication/tcp/streams/_base.py b/synapse/replication/tcp/streams/_base.py
index c14dff6c64..f56a0fd4b5 100644
--- a/synapse/replication/tcp/streams/_base.py
+++ b/synapse/replication/tcp/streams/_base.py
@@ -168,12 +168,13 @@ def make_http_update_function(
     async def update_function(
         from_token: int, upto_token: int, limit: int
     ) -> Tuple[List[Tuple[int, tuple]], int, bool]:
-        return await client(
+        result = await client(
             stream_name=stream_name,
             from_token=from_token,
             upto_token=upto_token,
             limit=limit,
         )
+        return result["updates"], result["upto_token"], result["limited"]
 
     return update_function