Skip to content

otlp: wrap the Cause error when context is canceled#7811

Open
bboreham wants to merge 1 commit intoopen-telemetry:mainfrom
bboreham:retry-cause
Open

otlp: wrap the Cause error when context is canceled#7811
bboreham wants to merge 1 commit intoopen-telemetry:mainfrom
bboreham:retry-cause

Conversation

@bboreham
Copy link
Contributor

@bboreham bboreham commented Jan 20, 2026

This brings things into alignment with the wait function.

I don't believe this is a "notable" change, so doesn't need a CHANGELOG entry.

…ailable

This brings things into alignment with the `wait` function.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.1%. Comparing base (f809f7d) to head (71c5417).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #7811   +/-   ##
=====================================
  Coverage   86.1%   86.1%           
=====================================
  Files        302     302           
  Lines      22046   22046           
=====================================
  Hits       18991   18991           
- Misses      2674    2675    +1     
+ Partials     381     380    -1     
Files with missing lines Coverage Δ
...s/otlp/otlplog/otlploggrpc/internal/retry/retry.go 97.6% <100.0%> (ø)
...s/otlp/otlplog/otlploghttp/internal/retry/retry.go 97.6% <100.0%> (ø)
.../otlpmetric/otlpmetricgrpc/internal/retry/retry.go 97.6% <100.0%> (ø)
.../otlpmetric/otlpmetrichttp/internal/retry/retry.go 97.6% <100.0%> (ø)
...lp/otlptrace/otlptracegrpc/internal/retry/retry.go 97.6% <100.0%> (ø)
...lp/otlptrace/otlptracehttp/internal/retry/retry.go 97.6% <100.0%> (ø)

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

// Check if context is canceled before attempting to wait and retry.
if ctx.Err() != nil {
return fmt.Errorf("%w: %w", ctx.Err(), err)
return fmt.Errorf("%w: %w", context.Cause(ctx), err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a new test case in TestWait that would cover the change?

@pellared pellared changed the title OTLP Retry: When canceled after an error, use the Cause message if available otlp: se the Cause message when context is canceled Jan 20, 2026
@pellared pellared changed the title otlp: se the Cause message when context is canceled otlp: wrap the Cause error when context is canceled Jan 20, 2026
@dashpole dashpole added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants