diff options
author | Erik Johnston <erikj@element.io> | 2024-07-15 16:13:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-15 16:13:04 +0100 |
commit | df11af14dbd2faad916924cab96e75bd7c95a66a (patch) | |
tree | 2de4fa075d8876aafda9cce06862c577f1219a5e /synapse/handlers | |
parent | Bump types-jsonschema from 4.22.0.20240610 to 4.23.0.20240712 (#17446) (diff) | |
download | synapse-df11af14dbd2faad916924cab96e75bd7c95a66a.tar.xz |
Fix bug where sync could get stuck when using workers (#17438)
This is because we serialized the token wrong if the instance map contained entries from before the minimum token.
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/sliding_sync.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/synapse/handlers/sliding_sync.py b/synapse/handlers/sliding_sync.py index be98b379eb..1b5262d667 100644 --- a/synapse/handlers/sliding_sync.py +++ b/synapse/handlers/sliding_sync.py @@ -699,10 +699,17 @@ class SlidingSyncHandler: instance_to_max_stream_ordering_map[instance_name] = stream_ordering # Then assemble the `RoomStreamToken` + min_stream_pos = min(instance_to_max_stream_ordering_map.values()) membership_snapshot_token = RoomStreamToken( # Minimum position in the `instance_map` - stream=min(instance_to_max_stream_ordering_map.values()), - instance_map=immutabledict(instance_to_max_stream_ordering_map), + stream=min_stream_pos, + instance_map=immutabledict( + { + instance_name: stream_pos + for instance_name, stream_pos in instance_to_max_stream_ordering_map.items() + if stream_pos > min_stream_pos + } + ), ) # Since we fetched the users room list at some point in time after the from/to |