summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2022-02-23 14:22:22 +0000
committerGitHub <noreply@github.com>2022-02-23 14:22:22 +0000
commita711ae78a8f8ba406ff122035c8bf096fac9a26c (patch)
treeec0eed60280be225efdd059157473e0392a557cb
parentAdd type hints to `tests/rest/client` (#12066) (diff)
downloadsynapse-a711ae78a8f8ba406ff122035c8bf096fac9a26c.tar.xz
Add logging to `/sync` for debugging #11916 (#12068)
-rw-r--r--changelog.d/12068.misc1
-rw-r--r--synapse/handlers/sync.py9
2 files changed, 10 insertions, 0 deletions
diff --git a/changelog.d/12068.misc b/changelog.d/12068.misc
new file mode 100644
index 0000000000..72b211e4f5
--- /dev/null
+++ b/changelog.d/12068.misc
@@ -0,0 +1 @@
+Add some logging to `/sync` to try and track down #11916.
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 98eaad3318..0aa3052fd6 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -697,6 +697,15 @@ class SyncHandler:
         else:
             # no events in this room - so presumably no state
             state = {}
+
+            # (erikj) This should be rarely hit, but we've had some reports that
+            # we get more state down gappy syncs than we should, so let's add
+            # some logging.
+            logger.info(
+                "Failed to find any events in room %s at %s",
+                room_id,
+                stream_position.room_key,
+            )
         return state
 
     async def compute_summary(