Skip to content

[OpenTelemetry] Release completed log payloads when returning pooled … - #7978

Merged
Kielek merged 2 commits into
open-telemetry:mainfrom
Kielek:codex/fix-ant-2026-pqevm980
Oct 19, 2026
Merged

Kielek merged 2 commits into
open-telemetry:mainfrom
Kielek:codex/fix-ant-2026-pqevm980

Conversation

@Kielek

@Kielek Kielek commented Oct 19, 2026

Copy link
Copy Markdown
Member

This fix addresses a ANT-2026-PQEVM980 finding from Anthropic's OSS Scanner.
Project enrollment: anthropics/oss-scanner#117.

Changes

Returned LogRecords retain completed log data, including state and exceptions,
until the records are reused. Oversized attribute and scope lists also remain
reachable after their reusable-storage references are dropped.

Reset the payload when either pool returns a record, keeping the existing limits
on reusable buffers and preserving data while a shared-pool reference remains.
Add regression coverage for both pools and independent attribute/scope limits.
This is an ordinary bug fix with no public API changes.

Validation: all seven focused Release/net10.0 cases failed before the fix and
pass after it. The final regressions pass on net10.0, net9.0, net8.0 and net472
(28/28). The full SDK Release test project passes (6,776 passed, 17 skipped), and
the Release solution build passes with zero warnings or errors.

Changed-file formatting checks pass. The full solution formatting command
reports design-time API tracking diagnostics on unchanged APIs and cannot load
some framework names containing whitespace; its exit code is 2. The repository
sanity check passes on an LF-normalized copy of the exact tracked working files;
the Windows checkout itself fails on existing CRLF files and build artifacts.
The SDK changelog entry is prepared and awaits this fix's actual PR URL.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, successful build/tests, etc.)
  • Tests added/updated
  • CHANGELOG.md file(s) updated for non-trivial changes
  • Changes in public API reviewed (if applicable)
  • AI usage disclosure:
    • No AI used
    • AI-assisted
    • Bulk AI-generated
  • I have the experience and knowledge necessary to understand, review, and validate all content in this PR1

Note

This PR description was generated with OpenAI Codex.

Footnotes

  1. Yes, I can answer maintainer questions about the content of this PR without using AI. ↩

…records

Reset log data, ILogger state, and attribute references when a LogRecord's
last owner returns it to a pool. Preserve reusable attribute and scope buffers
within their existing size limits.

Add regression coverage for exported records, oversized attributes/scopes,
thread-static cleanup, and records with an outstanding shared-pool reference.

Discovered by Anthropic's OSS Scanner, as bug ANT-2026-PQEVM980.
@github-actions github-actions Bot added the pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package label Oct 19, 2026
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-10-19 11:49 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Link the SDK changelog entry to PR open-telemetry#7978 for the completed log payload cleanup.

Discovered by Anthropic's OSS Scanner, as bug ANT-2026-PQEVM980.
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.17%. Comparing base (d34ce49) to head (8862e28).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7978      +/-   ##
==========================================
+ Coverage   90.14%   90.17%   +0.02%     
==========================================
  Files         365      365              
  Lines       21428    21431       +3     
  Branches     3939     3939              
==========================================
+ Hits        19316    19325       +9     
+ Misses       1532     1525       -7     
- Partials      580      581       +1     
Flag Coverage Δ
unittests-Project-Experimental 90.18% <100.00%> (+<0.01%) ⬆️
unittests-Project-Stable 90.20% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/OpenTelemetry/Logs/Pool/LogRecordPoolHelper.cs 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

@Kielek
Kielek marked this pull request as ready for review October 19, 2026 09:09
@Kielek
Kielek requested a review from a team as a code owner October 19, 2026 09:09
@martincostello martincostello added this to the v1.20.1 milestone Oct 19, 2026
@Kielek
Kielek added this pull request to the merge queue Oct 19, 2026
Merged via the queue into open-telemetry:main with commit 7ce5f73 Oct 19, 2026
80 checks passed
@Kielek
Kielek deleted the codex/fix-ant-2026-pqevm980 branch October 19, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants