Skip to content

Commit 8770e15

Browse files
committed
Delete exponential backoff code that is now unused
1 parent d5ca894 commit 8770e15

File tree

3 files changed

+1
-82
lines changed
  • exporter
    • opentelemetry-exporter-otlp-proto-common
    • opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc

3 files changed

+1
-82
lines changed

exporter/opentelemetry-exporter-otlp-proto-common/src/opentelemetry/exporter/otlp/proto/common/_internal/__init__.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -177,38 +177,3 @@ def _get_resource_data(
177177
)
178178
)
179179
return resource_data
180-
181-
182-
def _create_exp_backoff_generator(max_value: int = 0) -> Iterator[int]:
183-
"""
184-
Generates an infinite sequence of exponential backoff values. The sequence starts
185-
from 1 (2^0) and doubles each time (2^1, 2^2, 2^3, ...). If a max_value is specified
186-
and non-zero, the generated values will not exceed this maximum, capping at max_value
187-
instead of growing indefinitely.
188-
189-
Parameters:
190-
- max_value (int, optional): The maximum value to yield. If 0 or not provided, the
191-
sequence grows without bound.
192-
193-
Returns:
194-
Iterator[int]: An iterator that yields the exponential backoff values, either uncapped or
195-
capped at max_value.
196-
197-
Example:
198-
```
199-
gen = _create_exp_backoff_generator(max_value=10)
200-
for _ in range(5):
201-
print(next(gen))
202-
```
203-
This will print:
204-
1
205-
2
206-
4
207-
8
208-
10
209-
210-
Note: this functionality used to be handled by the 'backoff' package.
211-
"""
212-
for i in count(0):
213-
out = 2**i
214-
yield min(out, max_value) if max_value else out

exporter/opentelemetry-exporter-otlp-proto-common/tests/test_backoff.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
# This policy results in backoffs of 1s, 2s, 4s, and then 8s after the initial failed attempt.
8383
# Timeout set on the RPC call encompasses the retry backoffs AND time spent waiting
8484
# for a response. DEADLINE_EXCEEDED is returned if all the attempts cannot complete within the
85-
# timeout. See https://grpc.io/docs/guides/retry/ for more details.
85+
# timeout, and all fail. See https://grpc.io/docs/guides/retry/ for more details.
8686
"maxAttempts": 5,
8787
"initialBackoff": "1s",
8888
"maxBackoff": "9s",

0 commit comments

Comments
 (0)