diff options
author | Richard van der Hoff <richard@matrix.org> | 2017-03-17 20:56:54 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2017-03-18 00:07:43 +0000 |
commit | f40c2db05ae5e76428c97f1e194fe7d843913054 (patch) | |
tree | 39eb9fd6de50eb4493e336c93c1237a7ba31cd88 /synapse/handlers | |
parent | Run the reactor with the sentinel logcontext (diff) | |
download | synapse-f40c2db05ae5e76428c97f1e194fe7d843913054.tar.xz |
Stop preserve_fn leaking context into the reactor
Fix a bug in ``logcontext.preserve_fn`` which made it leak context into the reactor, and add a test for it. Also, get rid of ``logcontext.reset_context_after_deferred``, which tried to do the same thing but had its own, different, set of bugs.
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/federation.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 0cd5501b05..6157204924 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -933,8 +933,9 @@ class FederationHandler(BaseHandler): # lots of requests for missing prev_events which we do actually # have. Hence we fire off the deferred, but don't wait for it. - synapse.util.logcontext.reset_context_after_deferred( - self._handle_queued_pdus(room_queue)) + synapse.util.logcontext.preserve_fn(self._handle_queued_pdus)( + room_queue + ) defer.returnValue(True) |