-
Notifications
You must be signed in to change notification settings - Fork 887
fix(python-sdk): return from _iterate_events after end event to unblock wait() #1299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
FisherXZ
wants to merge
5
commits into
e2b-dev:main
Choose a base branch
from
FisherXZ:fix/1034-kill-blocking
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+28
−0
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8d83482
chore: add .worktrees to .gitignore
FisherXZ 84589f9
fix(python-sdk): return from _iterate_events after end event to unblo…
FisherXZ bf8422a
test(python-sdk): add handle.kill() and non-blocking wait() tests for…
FisherXZ dbbad45
chore: add changeset for AsyncCommandHandle kill blocking fix
FisherXZ a6bb6ad
fix(python-sdk): aclose() event stream in _handle_events finally bloc…
FisherXZ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@e2b/python-sdk": patch | ||
| --- | ||
|
|
||
| Fix `AsyncCommandHandle.wait()` blocking after `kill()`: `_iterate_events` now returns immediately after the "end" event, so `wait()` completes promptly even if the gRPC stream is slow to close. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ vale-styles | |
| .vercel | ||
| .vscode | ||
| .DS_Store | ||
| .worktrees | ||
|
|
||
| # Logs | ||
| logs | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning immediately here stops consuming
self._events, but the stream generator is kept on the handle and is not closed inwait()(anddisconnect()does notaclose()it). The async stream implementation (e2b_connect.Client.acall_server_stream) holds the HTTP stream inside anasync with, so exiting early without closing/exhausting the generator can keep connections open until the handle is garbage-collected; in workloads that keep many handles, this can accumulate and exhaust the async connection pool.Useful? React with 👍 / 👎.