summary refs log tree commit diff
path: root/synapse/util
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-04-27 14:31:23 +0100
committerRichard van der Hoff <richard@matrix.org>2018-04-27 14:31:23 +0100
commitfc149b4eeb560286f4b54f53619b69089eeeaff8 (patch)
treea237b7a346ebf7c6db550ee65451a903c8ecf2d3 /synapse/util
parentUse run_in_background in preference to preserve_fn (diff)
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-fc149b4eeb560286f4b54f53619b69089eeeaff8.tar.xz
Merge remote-tracking branch 'origin/develop' into rav/use_run_in_background
Diffstat (limited to 'synapse/util')
-rw-r--r--synapse/util/logcontext.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/util/logcontext.py b/synapse/util/logcontext.py
index c2edf87e58..bbadeec922 100644
--- a/synapse/util/logcontext.py
+++ b/synapse/util/logcontext.py
@@ -305,7 +305,12 @@ def run_in_background(f, *args, **kwargs):
     deferred returned by the funtion completes.
 
     Useful for wrapping functions that return a deferred which you don't yield
-    on.
+    on (for instance because you want to pass it to deferred.gatherResults()).
+
+    Note that if you completely discard the result, you should make sure that
+    `f` doesn't raise any deferred exceptions, otherwise a scary-looking
+    CRITICAL error about an unhandled error will be logged without much
+    indication about where it came from.
     """
     current = LoggingContext.current_context()
     res = f(*args, **kwargs)