From 3f8a59f8a49d8fc2aab910803811edec751a9a84 Mon Sep 17 00:00:00 2001 From: Sean Quah Date: Fri, 6 May 2022 20:17:20 +0100 Subject: Don't trash the logging context when cancelling request processing Signed-off-by: Sean Quah --- synapse/http/site.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/synapse/http/site.py b/synapse/http/site.py index ff77fd016e..1c5651fc82 100644 --- a/synapse/http/site.py +++ b/synapse/http/site.py @@ -372,7 +372,8 @@ class SynapseRequest(Request): # that it will finish up sooner than it normally would. # The `self.processing()` context manager will call # `_finished_processing()` when done. - self.render_deferred.cancel() + with PreserveLoggingContext(): + self.render_deferred.cancel() else: logger.error( "Connection from client lost, but have no Deferred to " -- cgit 1.4.1