Skip to content

Commit

Permalink
Defensive copy for BoundedList deque iter
Browse files Browse the repository at this point in the history
  • Loading branch information
c24t committed Jul 23, 2019
1 parent e9e59ac commit 7836995
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def __len__(self):
return len(self._dq)

def __iter__(self):
return iter(self._dq)
with self._lock:
return iter(self._dq.copy())

def append(self, item):
with self._lock:
Expand Down

0 comments on commit 7836995

Please sign in to comment.