Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sentry_sdk/profiler/continuous_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,13 @@ def _sample_stack(*args, **kwargs):
# that are starting profiles are not blocked until it
# can acquire the lock.
for _ in range(new_profiles):
self.active_profiles.add(self.new_profiles.popleft())
try:
profile = self.new_profiles.popleft()
except IndexError:
# If another thread is concurrently popping profiles, we could
# end up with an empty deque here.
break
self.active_profiles.add(profile)
inactive_profiles = []

for profile in self.active_profiles:
Expand Down
Loading