Skip to content
Snippets Groups Projects
Unverified Commit 81e28139 authored by Erik Johnston's avatar Erik Johnston Committed by GitHub
Browse files

Merge pull request #3996 from matrix-org/erikj/fix_bg_iteration

Fix exception in background metrics collection
parents 01afcfc4 c69faf8c
No related branches found
No related tags found
No related merge requests found
Fix exception in background metrics collection
...@@ -101,9 +101,13 @@ class _Collector(object): ...@@ -101,9 +101,13 @@ class _Collector(object):
labels=["name"], labels=["name"],
) )
# We copy the dict so that it doesn't change from underneath us # We copy the dict so that it doesn't change from underneath us.
# We also copy the process lists as that can also change
with _bg_metrics_lock: with _bg_metrics_lock:
_background_processes_copy = dict(_background_processes) _background_processes_copy = {
k: list(v)
for k, v in six.iteritems(_background_processes)
}
for desc, processes in six.iteritems(_background_processes_copy): for desc, processes in six.iteritems(_background_processes_copy):
background_process_in_flight_count.add_metric( background_process_in_flight_count.add_metric(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment