Repository navigation
[Api] Reuse tracers for equal array-valued scope tags - #7960
Merged
Merged
Conversation
Compare and hash scalar array tag values by their elements and snapshot the arrays so caller mutations cannot change cached tracer keys. Give ActivitySource its own array copies to keep its public tags separate from the cache key. Cover repeated lookups, differing values and types, mutation, shape, and cyclic input. Discovered by Anthropic's OSS Scanner, as bug ANT-2026-PFSTNMUG.
Pull request dashboard statusMerged · refreshed 2026-10-16 12:07 UTC Status above doesn't look right?
|
Complete the Api changelog with the real fix PR link, open-telemetry#7960. Discovered by Anthropic's OSS Scanner, as bug ANT-2026-PFSTNMUG.
martincostello
approved these changes
Oct 16, 2026
Kielek
marked this pull request as ready for review
October 16, 2026 11:27
Kielek
enabled auto-merge
October 16, 2026 11:28
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7960 +/- ##
==========================================
+ Coverage 92.30% 92.33% +0.03%
==========================================
Files 363 363
Lines 21035 21108 +73
==========================================
+ Hits 19416 19490 +74
+ Misses 1619 1618 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix addresses a ANT-2026-PFSTNMUG finding from Anthropic's OSS Scanner.
Project enrollment: anthropics/oss-scanner#117.
Changes
GetTracercurrently creates another cached tracer andActivitySourcewheneverequal scalar array-valued scope tags are supplied in fresh arrays. Compare and
hash array elements by value, preserve array type/shape distinctions, and copy
input arrays so later caller mutation cannot alter the cached key or source tags.
Give ActivitySource its own array copies so mutation through public source tags
cannot change a cache key either.
Element comparison stays shallow, avoiding recursion through arbitrary graphs.
Add regression coverage for repeated lookups, different contents/order/length/type,
nulls, empty arrays, mutation, array shape, and self-referential arrays. Three
regressions fail against unchanged production code for the reported cause.
The focused GetTracer suite passes all 22 tests on net10.0, net9.0, net8.0, and
net472. Full Api Release tests pass 1,880 tests across those targets, with eight
existing skips. The final Release solution build completes with zero warnings
or errors. Both changed files pass project formatting with relative include
filters, and source sanity checks pass.
The full solution formatter reports workspace reference-load warnings; the raw
full sanity check encounters existing CRLF/generated-file failures in this checkout.
No public API changes.
Merge requirement checklist
CHANGELOG.mdfile(s) updated for non-trivial changesNote
This PR description was generated with OpenAI Codex.
Footnotes
Yes, I can answer maintainer questions about the content of this PR without using AI. ↩