fix: add read/write timeouts for server stream requests#1203
fix: add read/write timeouts for server stream requests#1203passionworkeer wants to merge 2 commits intoe2b-dev:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 7dcc457 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
This PR aligns timeout handling for Connect server-stream requests with unary requests by applying the provided request_timeout not only to connection/pool acquisition but also to read/write operations. This helps ensure streaming calls respect the configured request timeout behavior consistently across RPC styles.
Changes:
- Add
readandwritetimeout values to the httpcoreextensions["timeout"]dict for server-stream requests. - Keep existing connect-protocol headers and stream timeout header behavior unchanged.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for the review! This is a fix for stream request timeout when using httpx. The stream requests were missing read/write timeout configuration compared to unary requests. Let me add a changeset for this. |
|
Thanks for the review! Here's the changeset: @e2b/python-sdk: patchfix: add read/write timeouts for server stream requests Please add this, or I'll create a new PR from my fork. |
|
Hi, I noticed the commit is currently unsigned. Could you please sign the commit with git commit -S and force push to meet the signature requirement? Let me know if you need help with setting up GPG signing. |
When a sandbox becomes unreachable, commands.run() hangs indefinitely because the underlying httpx stream does not have read/write timeouts set. The _prepare_server_stream_request method only set connect and pool timeouts, but omitted read and write timeouts. This is inconsistent with _prepare_unary_request which correctly sets all four timeouts. This fix adds read and write timeouts to server stream requests, ensuring that commands.run() respects the request_timeout parameter even when the sandbox becomes unreachable. Closes e2b-dev#1128 Signed-off-by: passionworkeer <passionworkeer@users.noreply.github.com>
1d09def to
df57797
Compare
a75aa6f to
7dcc457
Compare
|
Hi, I've signed the commit with GPG. Could you please re-review? |
|
Hi @mishushakov, just checking in on this PR. Copilot reviewed it with no issues, the commit is GPG signed, and the changeset is added. Is there anything else needed from my side to move this forward for merge? Happy to make any adjustments. |
When a sandbox becomes unreachable, commands.run() hangs indefinitely because the underlying httpx stream does not have read/write timeouts set.
The _prepare_server_stream_request method only set connect and pool timeouts, but omitted read and write timeouts. This is inconsistent with _prepare_unary_request which correctly sets all four timeouts.
This fix adds read and write timeouts to server stream requests, ensuring that commands.run() respects the request_timeout parameter even when the sandbox becomes unreachable.
Closes #1128