diff options
author | Richard van der Hoff <richard@matrix.org> | 2017-03-17 15:33:04 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2017-03-18 00:07:43 +0000 |
commit | 067b00d49d25d6994e851fc362328a164ace85b2 (patch) | |
tree | dff78f1cc53c77ea5d8f67258ab90981c9b0c90f /synapse/app/federation_sender.py | |
parent | Remove broken use of clock.call_later (diff) | |
download | synapse-067b00d49d25d6994e851fc362328a164ace85b2.tar.xz |
Run the reactor with the sentinel logcontext
This fixes a class of 'Unexpected logcontext' messages, which were happening because the logcontext was somewhat arbitrarily swapping between the sentinel and the `run` logcontext.
Diffstat (limited to 'synapse/app/federation_sender.py')
-rw-r--r-- | synapse/app/federation_sender.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/app/federation_sender.py b/synapse/app/federation_sender.py index 0cf5b196e6..76c4cc54d1 100644 --- a/synapse/app/federation_sender.py +++ b/synapse/app/federation_sender.py @@ -35,7 +35,7 @@ from synapse.storage.engines import create_engine from synapse.storage.presence import UserPresenceState from synapse.util.async import sleep from synapse.util.httpresourcetree import create_resource_tree -from synapse.util.logcontext import LoggingContext +from synapse.util.logcontext import LoggingContext, PreserveLoggingContext from synapse.util.manhole import manhole from synapse.util.rlimit import change_resource_limit from synapse.util.versionstring import get_version_string @@ -193,7 +193,11 @@ def start(config_options): ps.start_listening(config.worker_listeners) def run(): - with LoggingContext("run"): + # make sure that we run the reactor with the sentinel log context, + # otherwise other PreserveLoggingContext instances will get confused + # and complain when they see the logcontext arbitrarily swapping + # between the sentinel and `run` logcontexts. + with PreserveLoggingContext(): logger.info("Running") change_resource_limit(config.soft_file_limit) if config.gc_thresholds: |