Skip to content

opentelemetry-sdk: make methods on FixedSizeExemplarReservoirABC thread safe#5437

Open
herin049 wants to merge 2 commits into
open-telemetry:mainfrom
herin049:fix/unsynchronized-exemplar-reservoir
Open

opentelemetry-sdk: make methods on FixedSizeExemplarReservoirABC thread safe#5437
herin049 wants to merge 2 commits into
open-telemetry:mainfrom
herin049:fix/unsynchronized-exemplar-reservoir

Conversation

@herin049

@herin049 herin049 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Description

Per the OpenTelemetry Specification all methods on ExemplarReservoir MUST be safe to be called concurrently.

ExemplarReservoir - all methods MUST be safe to be called concurrently.

This PR introduces a lock to synchronize methods calls on the FixedSizeExemplarReservoirABC class and all subclasses.

Fixes #5431

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

uv run tox -e py314-test-opentelemetry-sdk

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@herin049
herin049 requested a review from a team as a code owner July 19, 2026 01:13
@github-project-automation github-project-automation Bot moved this from Ready for review to Approved PRs in Python PR digest Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

ValueError: empty range for randrange() — data race in SimpleFixedSizeExemplarReservoir between offer() and collect()

2 participants