mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-13 05:21:43 +01:00
Fix "Starting metrics collection from sentinel context" errors (#9053)
This commit is contained in:
parent
12f79da587
commit
a03d71dc9d
3 changed files with 22 additions and 21 deletions
1
changelog.d/9053.bugfix
Normal file
1
changelog.d/9053.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fix bug where we didn't correctly record CPU time spent in 'on_new_event' block.
|
|
@ -396,7 +396,6 @@ class Notifier:
|
||||||
|
|
||||||
Will wake up all listeners for the given users and rooms.
|
Will wake up all listeners for the given users and rooms.
|
||||||
"""
|
"""
|
||||||
with PreserveLoggingContext():
|
|
||||||
with Measure(self.clock, "on_new_event"):
|
with Measure(self.clock, "on_new_event"):
|
||||||
user_streams = set()
|
user_streams = set()
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,8 @@ class Measure:
|
||||||
curr_context = current_context()
|
curr_context = current_context()
|
||||||
if not curr_context:
|
if not curr_context:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"Starting metrics collection from sentinel context: metrics will be lost"
|
"Starting metrics collection %r from sentinel context: metrics will be lost",
|
||||||
|
name,
|
||||||
)
|
)
|
||||||
parent_context = None
|
parent_context = None
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue