Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8de667d

Browse files
committedDec 27, 2024··
Update module github.com/cenkalti/backoff/v4 to v5
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
1 parent ffcef93 commit 8de667d

File tree

32 files changed

+79
-38
lines changed

32 files changed

+79
-38
lines changed
 

‎cmd/otelcorecol/go.mod

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module go.opentelemetry.io/collector/cmd/otelcorecol
44

55
go 1.22.0
66

7-
toolchain go1.22.10
7+
toolchain go1.23.3
88

99
require (
1010
go.opentelemetry.io/collector/component v0.116.0
@@ -37,6 +37,7 @@ require (
3737
require (
3838
github.com/beorn7/perks v1.0.1 // indirect
3939
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
40+
github.com/cenkalti/backoff/v5 v5.0.0 // indirect
4041
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4142
github.com/davecgh/go-spew v1.1.1 // indirect
4243
github.com/ebitengine/purego v0.8.1 // indirect

‎cmd/otelcorecol/go.sum

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎config/configretry/backoff.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"errors"
88
"time"
99

10-
"github.com/cenkalti/backoff/v4"
10+
"github.com/cenkalti/backoff/v5"
1111
)
1212

1313
// NewDefaultBackOffConfig returns the default settings for RetryConfig.

‎config/configretry/go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ module go.opentelemetry.io/collector/config/configretry
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
6-
github.com/cenkalti/backoff/v4 v4.3.0
8+
github.com/cenkalti/backoff/v5 v5.0.0
79
github.com/stretchr/testify v1.10.0
810
go.uber.org/goleak v1.3.0
911
)

‎config/configretry/go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎exporter/debugexporter/go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module go.opentelemetry.io/collector/exporter/debugexporter
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
68
github.com/stretchr/testify v1.10.0
79
go.opentelemetry.io/collector/component v0.116.0
@@ -22,7 +24,7 @@ require (
2224
)
2325

2426
require (
25-
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
27+
github.com/cenkalti/backoff/v5 v5.0.0 // indirect
2628
github.com/davecgh/go-spew v1.1.1 // indirect
2729
github.com/go-logr/logr v1.4.2 // indirect
2830
github.com/go-logr/stdr v1.2.2 // indirect

‎exporter/debugexporter/go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎exporter/exporterhelper/internal/queue_sender_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ func TestQueuedRetryHappyPath(t *testing.T) {
196196
) {
197197
t.Run(testName, func(t *testing.T) {
198198
resetFeatureGate := setFeatureGateForTest(t, usePullingBasedExporterQueueBatcher, enableQueueBatcher)
199+
t.Cleanup(func() {
200+
resetFeatureGate()
201+
})
202+
199203
tel, err := componenttest.SetupTelemetry(defaultID)
200204
require.NoError(t, err)
201205
t.Cleanup(func() { require.NoError(t, tel.Shutdown(context.Background())) })
@@ -221,7 +225,6 @@ func TestQueuedRetryHappyPath(t *testing.T) {
221225
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
222226
t.Cleanup(func() {
223227
assert.NoError(t, be.Shutdown(context.Background()))
224-
resetFeatureGate()
225228
})
226229

227230
// Wait until all batches received

‎exporter/exporterhelper/internal/retry_sender.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"fmt"
1010
"time"
1111

12-
"github.com/cenkalti/backoff/v4"
12+
"github.com/cenkalti/backoff/v5"
1313
"go.opentelemetry.io/otel/attribute"
1414
"go.opentelemetry.io/otel/trace"
1515
"go.uber.org/zap"
@@ -65,7 +65,7 @@ func (rs *retrySender) Shutdown(context.Context) error {
6565
return nil
6666
}
6767

68-
// send implements the requestSender interface
68+
// Send implements the requestSender interface
6969
func (rs *retrySender) Send(ctx context.Context, req internal.Request) error {
7070
// Do not use NewExponentialBackOff since it calls Reset and the code here must
7171
// call Reset after changing the InitialInterval (this saves an unnecessary call to Now).
@@ -74,13 +74,15 @@ func (rs *retrySender) Send(ctx context.Context, req internal.Request) error {
7474
RandomizationFactor: rs.cfg.RandomizationFactor,
7575
Multiplier: rs.cfg.Multiplier,
7676
MaxInterval: rs.cfg.MaxInterval,
77-
MaxElapsedTime: rs.cfg.MaxElapsedTime,
78-
Stop: backoff.Stop,
79-
Clock: backoff.SystemClock,
8077
}
81-
expBackoff.Reset()
8278
span := trace.SpanFromContext(ctx)
8379
retryNum := int64(0)
80+
if rs.cfg.MaxElapsedTime > 0 {
81+
var cancel context.CancelFunc
82+
ctx, cancel = context.WithTimeout(ctx, rs.cfg.MaxElapsedTime)
83+
// releases resources if operation completes before timeout elapses
84+
defer cancel()
85+
}
8486
for {
8587
span.AddEvent(
8688
"Sending request.",

‎exporter/exporterhelper/internal/retry_sender_test.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,10 @@ func TestQueueRetryWithDisabledRetires(t *testing.T) {
318318
ocs.run(func() {
319319
require.Error(t, be.Send(context.Background(), mockR))
320320
})
321+
ocs.awaitAsyncProcessing()
321322
assert.Len(t, observed.All(), 1)
322323
assert.Equal(t, "Exporting failed. Rejecting data. "+
323324
"Try enabling retry_on_failure config option to retry on retryable errors.", observed.All()[0].Message)
324-
ocs.awaitAsyncProcessing()
325325
mockR.checkNumRequests(t, 1)
326326
ocs.checkSendItemsCount(t, 0)
327327
ocs.checkDroppedItemsCount(t, 2)
@@ -367,15 +367,13 @@ func TestRetryWithContextTimeout(t *testing.T) {
367367
ocs.run(func() {
368368
ctx, cancel := context.WithTimeout(context.Background(), testTimeout)
369369
defer cancel()
370-
err := be.Send(ctx, mockR)
371-
require.Error(t, err)
372-
require.Equal(t, "request will be cancelled before next retry: transient error", err.Error())
370+
require.EqualError(t, be.Send(ctx, mockR), "request will be cancelled before next retry: transient error")
373371
})
372+
ocs.awaitAsyncProcessing()
374373
assert.Len(t, observed.All(), 2)
375374
assert.Equal(t, "Exporting failed. Will retry the request after interval.", observed.All()[0].Message)
376375
assert.Equal(t, "Exporting failed. Rejecting data. "+
377376
"Try enabling sending_queue to survive temporary failures.", observed.All()[1].Message)
378-
ocs.awaitAsyncProcessing()
379377
ocs.checkDroppedItemsCount(t, 7)
380378
require.Equal(t, 2, mockR.(*mockErrorRequest).getNumRequests())
381379
require.NoError(t, be.Shutdown(context.Background()))

‎exporter/exporterhelper/xexporterhelper/go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module go.opentelemetry.io/collector/exporter/exporterhelper/xexporterhelper
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
68
github.com/stretchr/testify v1.10.0
79
go.opentelemetry.io/collector/component v0.116.0
@@ -25,7 +27,7 @@ require (
2527
)
2628

2729
require (
28-
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
30+
github.com/cenkalti/backoff/v5 v5.0.0 // indirect
2931
github.com/davecgh/go-spew v1.1.1 // indirect
3032
github.com/go-logr/logr v1.4.2 // indirect
3133
github.com/go-logr/stdr v1.2.2 // indirect

‎exporter/exporterhelper/xexporterhelper/go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎exporter/exportertest/go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module go.opentelemetry.io/collector/exporter/exportertest
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
68
github.com/google/uuid v1.6.0
79
github.com/stretchr/testify v1.10.0
@@ -22,7 +24,7 @@ require (
2224
)
2325

2426
require (
25-
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
27+
github.com/cenkalti/backoff/v5 v5.0.0 // indirect
2628
github.com/davecgh/go-spew v1.1.1 // indirect
2729
github.com/go-logr/logr v1.4.2 // indirect
2830
github.com/go-logr/stdr v1.2.2 // indirect

‎exporter/exportertest/go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎exporter/go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ module go.opentelemetry.io/collector/exporter
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
6-
github.com/cenkalti/backoff/v4 v4.3.0
8+
github.com/cenkalti/backoff/v5 v5.0.0
79
github.com/stretchr/testify v1.10.0
810
go.opentelemetry.io/collector/component v0.116.0
911
go.opentelemetry.io/collector/component/componenttest v0.116.0

‎exporter/go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎exporter/nopexporter/go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module go.opentelemetry.io/collector/exporter/nopexporter
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
68
github.com/stretchr/testify v1.10.0
79
go.opentelemetry.io/collector/component v0.116.0

‎exporter/nopexporter/go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎exporter/otlpexporter/go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module go.opentelemetry.io/collector/exporter/otlpexporter
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
68
github.com/stretchr/testify v1.10.0
79
go.opentelemetry.io/collector v0.116.0
@@ -31,7 +33,7 @@ require (
3133
)
3234

3335
require (
34-
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
36+
github.com/cenkalti/backoff/v5 v5.0.0 // indirect
3537
github.com/davecgh/go-spew v1.1.1 // indirect
3638
github.com/fsnotify/fsnotify v1.8.0 // indirect
3739
github.com/go-logr/logr v1.4.2 // indirect

‎exporter/otlpexporter/go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎exporter/otlphttpexporter/go.mod

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module go.opentelemetry.io/collector/exporter/otlphttpexporter
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
68
github.com/stretchr/testify v1.10.0
79
go.opentelemetry.io/collector v0.116.0
@@ -29,7 +31,7 @@ require (
2931
)
3032

3133
require (
32-
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
34+
github.com/cenkalti/backoff/v5 v5.0.0 // indirect
3335
github.com/davecgh/go-spew v1.1.1 // indirect
3436
github.com/felixge/httpsnoop v1.0.4 // indirect
3537
github.com/fsnotify/fsnotify v1.8.0 // indirect

‎exporter/otlphttpexporter/go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎exporter/xexporter/go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module go.opentelemetry.io/collector/exporter/xexporter
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
68
github.com/stretchr/testify v1.10.0
79
go.opentelemetry.io/collector/component v0.116.0

‎internal/e2e/go.mod

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module go.opentelemetry.io/collector/internal/e2e
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
68
github.com/stretchr/testify v1.10.0
79
go.opentelemetry.io/collector v0.116.0
@@ -39,6 +41,7 @@ require (
3941
require (
4042
github.com/beorn7/perks v1.0.1 // indirect
4143
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
44+
github.com/cenkalti/backoff/v5 v5.0.0 // indirect
4245
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4346
github.com/davecgh/go-spew v1.1.1 // indirect
4447
github.com/ebitengine/purego v0.8.1 // indirect

‎internal/e2e/go.sum

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎internal/tools/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module go.opentelemetry.io/collector/internal/tools
22

3-
go 1.23
3+
go 1.22.0
44

55
toolchain go1.23.2
66

‎otelcol/go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module go.opentelemetry.io/collector/otelcol
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
68
github.com/spf13/cobra v1.8.1
79
github.com/stretchr/testify v1.10.0

‎otelcol/go.sum

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎otelcol/otelcoltest/go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module go.opentelemetry.io/collector/otelcol/otelcoltest
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
68
github.com/stretchr/testify v1.10.0
79
go.opentelemetry.io/collector/component v0.116.0

‎otelcol/otelcoltest/go.sum

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎service/go.mod

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module go.opentelemetry.io/collector/service
22

33
go 1.22.0
44

5+
toolchain go1.23.3
6+
57
require (
68
github.com/google/uuid v1.6.0
79
github.com/prometheus/client_golang v1.20.5

‎service/go.sum

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.