Skip to content

Commit

Permalink
Fix trace cache iteration crash
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed Nov 16, 2022
1 parent 75449a0 commit b2d2812
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions newrelic/core/trace_cache.py
Expand Up @@ -197,7 +197,7 @@ def active_threads(self):
debug = global_settings().debug

if debug.enable_coroutine_profiling:
for thread_id, trace in list(self._cache.items()):
for thread_id, trace in self._cache.copy().items():
transaction = trace.transaction
if transaction and transaction._greenlet is not None:
gr = transaction._greenlet()
Expand Down Expand Up @@ -359,7 +359,7 @@ def record_event_loop_wait(self, start_time, end_time):
task = getattr(transaction.root_span, "_task", None)
loop = get_event_loop(task)

for trace in list(self._cache.values()):
for trace in self._cache.copy().values():
if trace in seen:
continue

Expand Down

0 comments on commit b2d2812

Please sign in to comment.