summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2021-09-29 11:59:43 +0100
committerGitHub <noreply@github.com>2021-09-29 11:59:43 +0100
commit176aa55fd5971610727cb10372faf521542653d9 (patch)
tree36f560e385679213b8d717d1b2d7f55f90f6ddfe
parentUse direct references for configuration variables (part 6). (#10916) (diff)
downloadsynapse-176aa55fd5971610727cb10372faf521542653d9.tar.xz
add event id to logcontext when handling incoming PDUs (#10936)
Diffstat (limited to '')
-rw-r--r--changelog.d/10936.misc1
-rw-r--r--synapse/federation/federation_server.py5
2 files changed, 5 insertions, 1 deletions
diff --git a/changelog.d/10936.misc b/changelog.d/10936.misc
new file mode 100644
index 0000000000..9d1d6e5b02
--- /dev/null
+++ b/changelog.d/10936.misc
@@ -0,0 +1 @@
+Include the event id in the logcontext when handling PDUs received over federation.
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py
index 638959cbec..83f11d6b88 100644
--- a/synapse/federation/federation_server.py
+++ b/synapse/federation/federation_server.py
@@ -1008,7 +1008,10 @@ class FederationServer(FederationBase):
             async with lock:
                 logger.info("handling received PDU: %s", event)
                 try:
-                    await self._federation_event_handler.on_receive_pdu(origin, event)
+                    with nested_logging_context(event.event_id):
+                        await self._federation_event_handler.on_receive_pdu(
+                            origin, event
+                        )
                 except FederationError as e:
                     # XXX: Ideally we'd inform the remote we failed to process
                     # the event, but we can't return an error in the transaction