Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Remove all remaining synchronized implementations of Sampler.sample #809

Conversation

william-tran
Copy link

Which problem is this PR solving?

Fixes #807 and improves on jaegertracing/jaeger#1729 by not replacing samplers on every update. Rate limit budgets will only be reset if the operation's lower bound rate limit changes.

Short description of the changes

Will Tran added 2 commits October 14, 2021 18:14
- Add volatile keyword to underlying samplers so updated references can
be made available to other threads.

See jaegertracing#609 for
similar work.

Fixes jaegertracing#807

Signed-off-by: Will Tran <[email protected]>
- Use a ConcurrentHashMap for operationNameToSampler so that any number
of concurrent calls to sample can be made and safely modify it.
- Add volatile to any fields that can be changed by the update method to
ensure visibility of changes to other threads.
- Retain instances of GuaranteedThroughputSampler to preserve their rate
limit balances across updates when parameters don't change improving on
jaegertracing/jaeger#1729

See jaegertracing#609 for
similar work.

Fixes jaegertracing#807

Signed-off-by: Will Tran <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.sample() methods of PerOperationSampler and GuaranteedThroughputSampler are synchronized
1 participant