Skip to content

Commit 42725e5

Browse files
committed
fix(sdk): lower retry backoff base to 100ms
First retry now waits up to ~100ms (was ~500ms) before backing off exponentially, keeping the cap at 8s.
1 parent 7b9588b commit 42725e5

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/js-sdk/src/retry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { parseIntEnv } from './api/metadata'
44
export const DEFAULT_MAX_RETRIES = 3
55

66
/** Base for the exponential backoff, in milliseconds. */
7-
const DEFAULT_BACKOFF_BASE_MS = 500
7+
const DEFAULT_BACKOFF_BASE_MS = 100
88
/** Upper bound for a single backoff delay, in milliseconds. */
99
const DEFAULT_BACKOFF_CAP_MS = 8_000
1010
/**

packages/python-sdk/e2b/_retry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#: Default number of *retries* (i.e. attempts after the first).
1919
DEFAULT_MAX_RETRIES = 3
2020

21-
_BACKOFF_BASE_SEC = 0.5
21+
_BACKOFF_BASE_SEC = 0.1
2222
_BACKOFF_CAP_SEC = 8.0
2323

2424
#: HTTP methods that are idempotent per the HTTP spec and can be retried on any

packages/python-sdk/e2b_connect/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def make_error(error):
111111

112112

113113
# Exponential backoff with full jitter, in seconds.
114-
_BACKOFF_BASE_SEC = 0.5
114+
_BACKOFF_BASE_SEC = 0.1
115115
_BACKOFF_CAP_SEC = 8.0
116116

117117

0 commit comments

Comments
 (0)