mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Logcontext fixes
Fix some random logcontext leaks.
This commit is contained in:
parent
f559119de0
commit
8dff6e0322
@ -387,7 +387,8 @@ class InitialSyncHandler(BaseHandler):
|
||||
receipts = []
|
||||
defer.returnValue(receipts)
|
||||
|
||||
presence, receipts, (messages, token) = yield defer.gatherResults(
|
||||
presence, receipts, (messages, token) = yield make_deferred_yieldable(
|
||||
defer.gatherResults(
|
||||
[
|
||||
run_in_background(get_presence),
|
||||
run_in_background(get_receipts),
|
||||
@ -399,7 +400,8 @@ class InitialSyncHandler(BaseHandler):
|
||||
)
|
||||
],
|
||||
consumeErrors=True,
|
||||
).addErrback(unwrapFirstError)
|
||||
).addErrback(unwrapFirstError),
|
||||
)
|
||||
|
||||
messages = yield filter_events_for_client(
|
||||
self.store, user_id, messages, is_peeking=is_peeking,
|
||||
|
@ -39,7 +39,7 @@ from synapse.types import RoomStreamToken, get_domain_from_id
|
||||
from synapse.util.async import ObservableDeferred
|
||||
from synapse.util.caches.descriptors import cached, cachedInlineCallbacks
|
||||
from synapse.util.frozenutils import frozendict_json_encoder
|
||||
from synapse.util.logcontext import make_deferred_yieldable
|
||||
from synapse.util.logcontext import PreserveLoggingContext, make_deferred_yieldable
|
||||
from synapse.util.logutils import log_function
|
||||
from synapse.util.metrics import Measure
|
||||
|
||||
@ -147,6 +147,7 @@ class _EventPeristenceQueue(object):
|
||||
# callbacks on the deferred.
|
||||
try:
|
||||
ret = yield per_item_callback(item)
|
||||
with PreserveLoggingContext():
|
||||
item.deferred.callback(ret)
|
||||
except Exception:
|
||||
item.deferred.errback()
|
||||
|
@ -233,7 +233,7 @@ class PusherStore(PusherWorkerStore):
|
||||
)
|
||||
|
||||
if newly_inserted:
|
||||
self.runInteraction(
|
||||
yield self.runInteraction(
|
||||
"add_pusher",
|
||||
self._invalidate_cache_and_stream,
|
||||
self.get_if_user_has_pusher, (user_id,)
|
||||
|
Loading…
Reference in New Issue
Block a user