Skip to content

Commit 4973ebd

Browse files
committed
fix(python): Retry connections on HTTP/2 API transports
1 parent de47dfd commit 4973ebd

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

.changeset/spicy-llamas-repeat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@e2b/python-sdk": patch
3+
---
4+
5+
Retry connection establishment up to 3 times (`retries=3`) on the HTTP/2 transports used for the E2B API and envd clients.

packages/python-sdk/e2b/api/client_async/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def get_transport(
5252
limits=limits,
5353
proxy=config.proxy,
5454
http2=http2,
55+
retries=3,
5556
)
5657

5758
AsyncTransportWithLogger._instances[key] = transport
@@ -74,6 +75,7 @@ def get_envd_transport(
7475
limits=limits,
7576
proxy=config.proxy,
7677
http2=http2,
78+
retries=3,
7779
)
7880

7981
AsyncEnvdTransportWithLogger._instances[key] = transport

packages/python-sdk/e2b/api/client_sync/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def get_transport(config: ConnectionConfig, http2: bool = True) -> TransportWith
5353
limits=limits,
5454
proxy=config.proxy,
5555
http2=http2,
56+
retries=3,
5657
)
5758
instances[key] = transport
5859
TransportWithLogger._thread_local.instances = instances
@@ -78,6 +79,7 @@ def get_envd_transport(
7879
limits=limits,
7980
proxy=config.proxy,
8081
http2=http2,
82+
retries=3,
8183
)
8284
instances[key] = transport
8385
EnvdTransportWithLogger._thread_local.instances = instances

0 commit comments

Comments
 (0)