Skip to content

Commit ae69716

Browse files
authored
Merge branch 'main' into release-v1.39.0
2 parents 47d3a44 + d03b033 commit ae69716

File tree

8 files changed

+37
-1
lines changed

8 files changed

+37
-1
lines changed

exporters/otlp/otlplog/otlploggrpc/internal/retry/retry.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporters/otlp/otlplog/otlploghttp/client_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,8 @@ func TestClientInstrumentation(t *testing.T) {
879879

880880
client, coll, addr := factory(rCh)
881881
t.Cleanup(func() {
882-
assert.NoError(t, coll.Shutdown(t.Context()))
882+
ctx := context.Background() //nolint:usetesting // required to avoid getting a canceled context at cleanup.
883+
assert.NoError(t, coll.Shutdown(ctx))
883884
})
884885
assert.ErrorIs(t, client.UploadLogs(t.Context(), resourceLogs), internal.PartialSuccess{})
885886

exporters/otlp/otlplog/otlploghttp/internal/retry/retry.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporters/otlp/otlpmetric/otlpmetricgrpc/internal/retry/retry.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporters/otlp/otlpmetric/otlpmetrichttp/internal/retry/retry.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporters/otlp/otlptrace/otlptracehttp/internal/retry/retry.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/shared/otlp/retry/retry.go.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc {
9494
return err
9595
}
9696

97+
// Check if context is canceled before attempting to wait and retry.
98+
if ctx.Err() != nil {
99+
return fmt.Errorf("%w: %w", ctx.Err(), err)
100+
}
101+
97102
if maxElapsedTime != 0 && time.Since(startTime) > maxElapsedTime {
98103
return fmt.Errorf("max retry time elapsed: %w", err)
99104
}

0 commit comments

Comments
 (0)